mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Change id generation algorithm, display notifications total on the main page
This commit is contained in:
parent
9ebc82bf22
commit
3848cc194a
86 changed files with 264 additions and 159 deletions
|
@ -13,7 +13,7 @@ import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-ic
|
||||||
|
|
||||||
import styles from './Board.module.css';
|
import styles from './Board.module.css';
|
||||||
|
|
||||||
const parseDNDId = (dndId) => parseInt(dndId.split(':').pop(), 10);
|
const parseDndId = (dndId) => dndId.split(':')[1];
|
||||||
|
|
||||||
const Board = React.memo(
|
const Board = React.memo(
|
||||||
({
|
({
|
||||||
|
@ -51,7 +51,7 @@ const Board = React.memo(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = parseDNDId(draggableId);
|
const id = parseDndId(draggableId);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DroppableTypes.LIST:
|
case DroppableTypes.LIST:
|
||||||
|
@ -59,7 +59,7 @@ const Board = React.memo(
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DroppableTypes.CARD:
|
case DroppableTypes.CARD:
|
||||||
onCardMove(id, parseDNDId(destination.droppableId), destination.index);
|
onCardMove(id, parseDndId(destination.droppableId), destination.index);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -168,7 +168,7 @@ const Boards = React.memo(
|
||||||
|
|
||||||
Boards.propTypes = {
|
Boards.propTypes = {
|
||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
currentId: PropTypes.number,
|
currentId: PropTypes.string,
|
||||||
isEditable: PropTypes.bool.isRequired,
|
isEditable: PropTypes.bool.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -74,7 +74,7 @@ const Card = React.memo(
|
||||||
)}
|
)}
|
||||||
<div className={styles.name}>{name}</div>
|
<div className={styles.name}>{name}</div>
|
||||||
{tasks.length > 0 && <Tasks items={tasks} />}
|
{tasks.length > 0 && <Tasks items={tasks} />}
|
||||||
{(dueDate || timer) && (
|
{(dueDate || timer || notificationsTotal > 0) && (
|
||||||
<span className={styles.attachments}>
|
<span className={styles.attachments}>
|
||||||
{notificationsTotal > 0 && (
|
{notificationsTotal > 0 && (
|
||||||
<span
|
<span
|
||||||
|
@ -168,7 +168,7 @@ const Card = React.memo(
|
||||||
);
|
);
|
||||||
|
|
||||||
Card.propTypes = {
|
Card.propTypes = {
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
index: PropTypes.number.isRequired,
|
index: PropTypes.number.isRequired,
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
dueDate: PropTypes.instanceOf(Date),
|
dueDate: PropTypes.instanceOf(Date),
|
||||||
|
|
|
@ -110,7 +110,7 @@ const List = React.memo(
|
||||||
);
|
);
|
||||||
|
|
||||||
List.propTypes = {
|
List.propTypes = {
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
index: PropTypes.number.isRequired,
|
index: PropTypes.number.isRequired,
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
isPersisted: PropTypes.bool.isRequired,
|
isPersisted: PropTypes.bool.isRequired,
|
||||||
|
|
|
@ -31,6 +31,9 @@ const Projects = React.memo(({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className={classNames(styles.card, styles.open)}>
|
<div className={classNames(styles.card, styles.open)}>
|
||||||
|
{item.notificationsTotal > 0 && (
|
||||||
|
<span className={styles.notification}>{item.notificationsTotal}</span>
|
||||||
|
)}
|
||||||
<div className={styles.cardOverlay} />
|
<div className={styles.cardOverlay} />
|
||||||
<div className={styles.openTitle}>{item.name}</div>
|
<div className={styles.openTitle}>{item.name}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,7 +72,7 @@ const Projects = React.memo(({
|
||||||
|
|
||||||
Projects.propTypes = {
|
Projects.propTypes = {
|
||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
currentId: PropTypes.number,
|
currentId: PropTypes.string,
|
||||||
isEditable: PropTypes.bool.isRequired,
|
isEditable: PropTypes.bool.isRequired,
|
||||||
onAdd: PropTypes.func.isRequired,
|
onAdd: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,6 +59,20 @@
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification {
|
||||||
|
background: #eb5a46;
|
||||||
|
color: #fff;
|
||||||
|
float: right;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
padding: 0px 6px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 3px;
|
||||||
|
outline: none;
|
||||||
|
text-align: left;
|
||||||
|
transition: background 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
.open {
|
.open {
|
||||||
background: #555;
|
background: #555;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
|
@ -2,15 +2,9 @@ import { call, put, select } from 'redux-saga/effects';
|
||||||
|
|
||||||
import { goToBoardService, goToProjectService } from './router';
|
import { goToBoardService, goToProjectService } from './router';
|
||||||
import { createBoardRequest, deleteBoardRequest, updateBoardRequest } from '../requests';
|
import { createBoardRequest, deleteBoardRequest, updateBoardRequest } from '../requests';
|
||||||
import {
|
import { boardByIdSelector, nextBoardPositionSelector, pathSelector } from '../../../selectors';
|
||||||
boardByIdSelector,
|
|
||||||
maxIdSelector,
|
|
||||||
nextBoardPositionSelector,
|
|
||||||
pathSelector,
|
|
||||||
} from '../../../selectors';
|
|
||||||
import { createBoard, deleteBoard, updateBoard } from '../../../actions';
|
import { createBoard, deleteBoard, updateBoard } from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { Board } from '../../../models';
|
|
||||||
|
|
||||||
export function* createBoardService(projectId, data) {
|
export function* createBoardService(projectId, data) {
|
||||||
const nextData = {
|
const nextData = {
|
||||||
|
@ -18,7 +12,7 @@ export function* createBoardService(projectId, data) {
|
||||||
position: yield select(nextBoardPositionSelector, projectId),
|
position: yield select(nextBoardPositionSelector, projectId),
|
||||||
};
|
};
|
||||||
|
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, Board.modelName));
|
const localId = yield call(createLocalId);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
createBoard({
|
createBoard({
|
||||||
|
|
|
@ -2,10 +2,9 @@ import { call, put, select } from 'redux-saga/effects';
|
||||||
|
|
||||||
import { goToBoardService } from './router';
|
import { goToBoardService } from './router';
|
||||||
import { createCardRequest, deleteCardRequest, updateCardRequest } from '../requests';
|
import { createCardRequest, deleteCardRequest, updateCardRequest } from '../requests';
|
||||||
import { maxIdSelector, nextCardPositionSelector, pathSelector } from '../../../selectors';
|
import { nextCardPositionSelector, pathSelector } from '../../../selectors';
|
||||||
import { createCard, deleteCard, updateCard } from '../../../actions';
|
import { createCard, deleteCard, updateCard } from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { Card } from '../../../models';
|
|
||||||
|
|
||||||
export function* createCardService(listId, data) {
|
export function* createCardService(listId, data) {
|
||||||
const nextData = {
|
const nextData = {
|
||||||
|
@ -13,7 +12,7 @@ export function* createCardService(listId, data) {
|
||||||
position: yield select(nextCardPositionSelector, listId),
|
position: yield select(nextCardPositionSelector, listId),
|
||||||
};
|
};
|
||||||
|
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, Card.modelName));
|
const localId = yield call(createLocalId);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
createCard({
|
createCard({
|
||||||
|
|
|
@ -5,14 +5,13 @@ import {
|
||||||
deleteCommentActionRequest,
|
deleteCommentActionRequest,
|
||||||
updateCommentActionRequest,
|
updateCommentActionRequest,
|
||||||
} from '../requests';
|
} from '../requests';
|
||||||
import { currentUserIdSelector, maxIdSelector, pathSelector } from '../../../selectors';
|
import { currentUserIdSelector, pathSelector } from '../../../selectors';
|
||||||
import { createCommentAction, deleteCommentAction, updateCommentAction } from '../../../actions';
|
import { createCommentAction, deleteCommentAction, updateCommentAction } from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { Action } from '../../../models';
|
|
||||||
import { ActionTypes } from '../../../constants/Enums';
|
import { ActionTypes } from '../../../constants/Enums';
|
||||||
|
|
||||||
export function* createCommentActionService(cardId, data) {
|
export function* createCommentActionService(cardId, data) {
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, Action.modelName));
|
const localId = yield call(createLocalId);
|
||||||
const userId = yield select(currentUserIdSelector);
|
const userId = yield select(currentUserIdSelector);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
deleteLabelRequest,
|
deleteLabelRequest,
|
||||||
updateLabelRequest,
|
updateLabelRequest,
|
||||||
} from '../requests';
|
} from '../requests';
|
||||||
import { maxIdSelector, pathSelector } from '../../../selectors';
|
import { pathSelector } from '../../../selectors';
|
||||||
import {
|
import {
|
||||||
addLabelToBoardFilter,
|
addLabelToBoardFilter,
|
||||||
addLabelToCard,
|
addLabelToCard,
|
||||||
|
@ -17,11 +17,10 @@ import {
|
||||||
removeLabelFromCard,
|
removeLabelFromCard,
|
||||||
updateLabel,
|
updateLabel,
|
||||||
} from '../../../actions';
|
} from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { Label } from '../../../models';
|
|
||||||
|
|
||||||
export function* createLabelService(boardId, data) {
|
export function* createLabelService(boardId, data) {
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, Label.modelName));
|
const localId = yield call(createLocalId);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
createLabel({
|
createLabel({
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
import { call, put, select } from 'redux-saga/effects';
|
import { call, put, select } from 'redux-saga/effects';
|
||||||
|
|
||||||
import { createListRequest, deleteListRequest, updateListRequest } from '../requests';
|
import { createListRequest, deleteListRequest, updateListRequest } from '../requests';
|
||||||
import {
|
import { listByIdSelector, nextListPositionSelector, pathSelector } from '../../../selectors';
|
||||||
listByIdSelector,
|
|
||||||
maxIdSelector,
|
|
||||||
nextListPositionSelector,
|
|
||||||
pathSelector,
|
|
||||||
} from '../../../selectors';
|
|
||||||
import { createList, deleteList, updateList } from '../../../actions';
|
import { createList, deleteList, updateList } from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { List } from '../../../models';
|
|
||||||
|
|
||||||
export function* createListService(boardId, data) {
|
export function* createListService(boardId, data) {
|
||||||
const nextData = {
|
const nextData = {
|
||||||
|
@ -17,7 +11,7 @@ export function* createListService(boardId, data) {
|
||||||
position: yield select(nextListPositionSelector, boardId),
|
position: yield select(nextListPositionSelector, boardId),
|
||||||
};
|
};
|
||||||
|
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, List.modelName));
|
const localId = yield call(createLocalId);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
createList({
|
createList({
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { call, put, select } from 'redux-saga/effects';
|
import { call, put, select } from 'redux-saga/effects';
|
||||||
|
|
||||||
import { createProjectMembershipRequest, deleteProjectMembershipRequest } from '../requests';
|
import { createProjectMembershipRequest, deleteProjectMembershipRequest } from '../requests';
|
||||||
import { maxIdSelector, pathSelector } from '../../../selectors';
|
import { pathSelector } from '../../../selectors';
|
||||||
import { createProjectMembership, deleteProjectMembership } from '../../../actions';
|
import { createProjectMembership, deleteProjectMembership } from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { ProjectMembership } from '../../../models';
|
|
||||||
|
|
||||||
export function* createProjectMembershipService(projectId, data) {
|
export function* createProjectMembershipService(projectId, data) {
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, ProjectMembership.modelName));
|
const localId = yield call(createLocalId);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
createProjectMembership({
|
createProjectMembership({
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { call, put, select } from 'redux-saga/effects';
|
import { call, put, select } from 'redux-saga/effects';
|
||||||
|
|
||||||
import { createTaskRequest, deleteTaskRequest, updateTaskRequest } from '../requests';
|
import { createTaskRequest, deleteTaskRequest, updateTaskRequest } from '../requests';
|
||||||
import { maxIdSelector, pathSelector } from '../../../selectors';
|
import { pathSelector } from '../../../selectors';
|
||||||
import { createTask, deleteTask, updateTask } from '../../../actions';
|
import { createTask, deleteTask, updateTask } from '../../../actions';
|
||||||
import { nextLocalId } from '../../../utils/local-id';
|
import { createLocalId } from '../../../utils/local-id';
|
||||||
import { Task } from '../../../models';
|
|
||||||
|
|
||||||
export function* createTaskService(cardId, data) {
|
export function* createTaskService(cardId, data) {
|
||||||
const localId = nextLocalId(yield select(maxIdSelector, Task.modelName));
|
const localId = yield call(createLocalId);
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
createTask({
|
createTask({
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
export const maxIdSelector = ({ db }, modelName) => db[modelName].meta.maxId;
|
|
||||||
|
|
||||||
export const accessTokenSelector = ({ auth: { accessToken } }) => accessToken;
|
export const accessTokenSelector = ({ auth: { accessToken } }) => accessToken;
|
||||||
|
|
||||||
export const isAppInitializingSelector = ({ app: { isInitializing } }) => isInitializing;
|
export const isAppInitializingSelector = ({ app: { isInitializing } }) => isInitializing;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export const nextLocalId = (maxId = 0) => maxId + Date.now() / 10000000000000;
|
export const createLocalId = () => `local:${Date.now()}`;
|
||||||
|
|
||||||
export const isLocalId = (id) => id % 1 !== 0;
|
export const isLocalId = (id) => id.startsWith('local:');
|
||||||
|
|
|
@ -7,11 +7,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
beforeId: {
|
beforeId: {
|
||||||
type: 'number'
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
projectId: {
|
projectId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
|
|
|
@ -13,11 +13,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
labelId: {
|
labelId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,11 +10,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
labelId: {
|
labelId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,11 +13,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
userId: {
|
userId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,11 +10,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
userId: {
|
userId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
listId: {
|
listId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,11 +12,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
listId: {
|
listId: {
|
||||||
type: 'number'
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
type: 'number'
|
type: 'number'
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
boardId: {
|
boardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
boardId: {
|
boardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
|
|
|
@ -13,11 +13,13 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
projectId: {
|
projectId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
userId: {
|
userId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
cardId: {
|
cardId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
isAdmin: {
|
isAdmin: {
|
||||||
|
|
|
@ -65,7 +65,8 @@ const createReceiver = () => {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
|
regex: /^[0-9]+$/,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
userOrUserId: {
|
userOrUserId: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
custom: value => _.isPlainObject(value) || _.isFinite(value),
|
custom: value => _.isPlainObject(value) || _.isString(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
|
|
|
@ -4,11 +4,11 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
beforeId: {
|
beforeId: {
|
||||||
type: 'number'
|
type: 'string'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
exceptBoardId: {
|
exceptBoardId: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value)
|
custom: value => _.isString(value) || _.isArray(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
exceptCardId: {
|
exceptCardId: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value)
|
custom: value => _.isString(value) || _.isArray(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
exceptListId: {
|
exceptListId: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value)
|
custom: value => _.isString(value) || _.isArray(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
withProjectMemberships: {
|
withProjectMemberships: {
|
||||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
exceptUserId: {
|
exceptUserId: {
|
||||||
type: 'number',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value)
|
custom: value => _.isString(value) || _.isArray(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
exceptUserId: {
|
exceptUserId: {
|
||||||
type: 'number',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value)
|
custom: value => _.isString(value) || _.isArray(value)
|
||||||
},
|
},
|
||||||
withCardSubscriptions: {
|
withCardSubscriptions: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
userId: {
|
userId: {
|
||||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
exceptUserId: {
|
exceptUserId: {
|
||||||
type: 'number',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value)
|
custom: value => _.isString(value) || _.isArray(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isArray(value),
|
custom: value => _.isString(value) || _.isArray(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
criteria: {
|
criteria: {
|
||||||
type: 'json',
|
type: 'json',
|
||||||
custom: value => _.isInteger(value) || _.isPlainObject(value),
|
custom: value => _.isString(value) || _.isPlainObject(value),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,7 @@ module.exports = {
|
||||||
deletedAt: null
|
deletedAt: null
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_.isInteger(inputs.criteria)) {
|
if (_.isString(inputs.criteria)) {
|
||||||
criteria.id = inputs.criteria;
|
criteria.id = inputs.criteria;
|
||||||
} else if (_.isPlainObject(inputs.criteria)) {
|
} else if (_.isPlainObject(inputs.criteria)) {
|
||||||
Object.assign(criteria, inputs.criteria);
|
Object.assign(criteria, inputs.criteria);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const GAP = 2 ** 14;
|
const GAP = 2 ** 14;
|
||||||
const MIN_GAP = 0.125;
|
const MIN_GAP = 0.125;
|
||||||
const MAX_POSITION = 2 ** 40; // 2 ** 50
|
const MAX_POSITION = 2 ** 50;
|
||||||
|
|
||||||
const findBeginnings = positions => {
|
const findBeginnings = positions => {
|
||||||
positions.unshift(0);
|
positions.unshift(0);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
userId: {
|
userId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,7 @@ module.exports = function defineCurrentUserHook(sails) {
|
||||||
let id;
|
let id;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
id = Number(sails.helpers.verifyToken(accessToken));
|
id = sails.helpers.verifyToken(accessToken);
|
||||||
} catch (unusedError) {
|
} catch (unusedError) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
||||||
columnName: 'from_model'
|
columnName: 'from_model'
|
||||||
},
|
},
|
||||||
originalRecordId: {
|
originalRecordId: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
columnName: 'original_record_id'
|
columnName: 'original_record_id'
|
||||||
},
|
},
|
||||||
|
|
|
@ -66,7 +66,7 @@ module.exports.models = {
|
||||||
|
|
||||||
attributes: {
|
attributes: {
|
||||||
id: {
|
id: {
|
||||||
type: 'number',
|
type: 'string',
|
||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
},
|
},
|
||||||
createdAt: {
|
createdAt: {
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
module.exports.up = knex => knex.raw(`
|
||||||
|
CREATE SEQUENCE next_id_seq;
|
||||||
|
|
||||||
|
CREATE FUNCTION next_id(OUT id BIGINT) AS $$
|
||||||
|
DECLARE
|
||||||
|
shard INT := 1;
|
||||||
|
epoch BIGINT := 1567191600000;
|
||||||
|
|
||||||
|
sequence BIGINT;
|
||||||
|
milliseconds BIGINT;
|
||||||
|
BEGIN
|
||||||
|
SELECT nextval('next_id_seq') % 1024 INTO sequence;
|
||||||
|
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 1000) INTO milliseconds;
|
||||||
|
|
||||||
|
id := (milliseconds - epoch) << 23;
|
||||||
|
id := id | (shard << 10);
|
||||||
|
id := id | (sequence);
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE PLPGSQL;
|
||||||
|
`);
|
||||||
|
|
||||||
|
module.exports.down = knex => knex.raw(`
|
||||||
|
DROP SEQUENCE next_id_seq;
|
||||||
|
|
||||||
|
DROP FUNCTION next_id(OUT id BIGINT);
|
||||||
|
`);
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('archive', table => {
|
knex.schema.createTable('archive', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.text('from_model').notNullable();
|
table.text('from_model').notNullable();
|
||||||
table.integer('original_record_id').notNullable();
|
table.bigInteger('original_record_id').notNullable();
|
||||||
table.json('original_record').notNullable();
|
table.json('original_record').notNullable();
|
||||||
|
|
||||||
table.timestamp('created_at', true);
|
table.timestamp('created_at', true);
|
|
@ -3,7 +3,10 @@ module.exports.up = knex =>
|
||||||
.createTable('user', table => {
|
.createTable('user', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.text('email').notNullable();
|
table.text('email').notNullable();
|
||||||
table.text('password').notNullable();
|
table.text('password').notNullable();
|
|
@ -2,7 +2,10 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('project', table => {
|
knex.schema.createTable('project', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.text('name').notNullable();
|
table.text('name').notNullable();
|
||||||
|
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('project_membership', table => {
|
knex.schema.createTable('project_membership', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('project_id').notNullable();
|
table.bigInteger('project_id').notNullable();
|
||||||
table.integer('user_id').notNullable();
|
table.bigInteger('user_id').notNullable();
|
||||||
|
|
||||||
table.timestamp('created_at', true);
|
table.timestamp('created_at', true);
|
||||||
table.timestamp('updated_at', true);
|
table.timestamp('updated_at', true);
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('board', table => {
|
knex.schema.createTable('board', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('project_id').notNullable();
|
table.bigInteger('project_id').notNullable();
|
||||||
|
|
||||||
table.specificType('position', 'double precision').notNullable();
|
table.specificType('position', 'double precision').notNullable();
|
||||||
table.text('name').notNullable();
|
table.text('name').notNullable();
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('list', table => {
|
knex.schema.createTable('list', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('board_id').notNullable();
|
table.bigInteger('board_id').notNullable();
|
||||||
|
|
||||||
table.specificType('position', 'double precision').notNullable();
|
table.specificType('position', 'double precision').notNullable();
|
||||||
table.text('name').notNullable();
|
table.text('name').notNullable();
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('label', table => {
|
knex.schema.createTable('label', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('board_id').notNullable();
|
table.bigInteger('board_id').notNullable();
|
||||||
|
|
||||||
table.text('name');
|
table.text('name');
|
||||||
table.text('color').notNullable();
|
table.text('color').notNullable();
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('card', table => {
|
knex.schema.createTable('card', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('list_id').notNullable();
|
table.bigInteger('list_id').notNullable();
|
||||||
table.integer('board_id').notNullable();
|
table.bigInteger('board_id').notNullable();
|
||||||
|
|
||||||
table.specificType('position', 'double precision').notNullable();
|
table.specificType('position', 'double precision').notNullable();
|
||||||
table.text('name').notNullable();
|
table.text('name').notNullable();
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('card_subscription', table => {
|
knex.schema.createTable('card_subscription', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('card_id').notNullable();
|
table.bigInteger('card_id').notNullable();
|
||||||
table.integer('user_id').notNullable();
|
table.bigInteger('user_id').notNullable();
|
||||||
|
|
||||||
table.boolean('is_permanent').notNullable();
|
table.boolean('is_permanent').notNullable();
|
||||||
|
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('card_membership', table => {
|
knex.schema.createTable('card_membership', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('card_id').notNullable();
|
table.bigInteger('card_id').notNullable();
|
||||||
table.integer('user_id').notNullable();
|
table.bigInteger('user_id').notNullable();
|
||||||
|
|
||||||
table.timestamp('created_at', true);
|
table.timestamp('created_at', true);
|
||||||
table.timestamp('updated_at', true);
|
table.timestamp('updated_at', true);
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('card_label', table => {
|
knex.schema.createTable('card_label', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('card_id').notNullable();
|
table.bigInteger('card_id').notNullable();
|
||||||
table.integer('label_id').notNullable();
|
table.bigInteger('label_id').notNullable();
|
||||||
|
|
||||||
table.timestamp('created_at', true);
|
table.timestamp('created_at', true);
|
||||||
table.timestamp('updated_at', true);
|
table.timestamp('updated_at', true);
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('task', table => {
|
knex.schema.createTable('task', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('card_id').notNullable();
|
table.bigInteger('card_id').notNullable();
|
||||||
|
|
||||||
table.text('name').notNullable();
|
table.text('name').notNullable();
|
||||||
table.boolean('is_completed').notNullable();
|
table.boolean('is_completed').notNullable();
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('action', table => {
|
knex.schema.createTable('action', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('card_id').notNullable();
|
table.bigInteger('card_id').notNullable();
|
||||||
table.integer('user_id').notNullable();
|
table.bigInteger('user_id').notNullable();
|
||||||
|
|
||||||
table.text('type').notNullable();
|
table.text('type').notNullable();
|
||||||
table.jsonb('data').notNullable();
|
table.jsonb('data').notNullable();
|
|
@ -2,11 +2,14 @@ module.exports.up = knex =>
|
||||||
knex.schema.createTable('notification', table => {
|
knex.schema.createTable('notification', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table.increments();
|
table
|
||||||
|
.bigInteger('id')
|
||||||
|
.primary()
|
||||||
|
.defaultTo(knex.raw('next_id()'));
|
||||||
|
|
||||||
table.integer('user_id').notNullable();
|
table.bigInteger('user_id').notNullable();
|
||||||
table.integer('action_id').notNullable();
|
table.bigInteger('action_id').notNullable();
|
||||||
table.integer('card_id').notNullable();
|
table.bigInteger('card_id').notNullable();
|
||||||
|
|
||||||
table.boolean('is_read').notNullable();
|
table.boolean('is_read').notNullable();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue