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
|
@ -7,11 +7,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
beforeId: {
|
||||
type: 'number'
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
projectId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
position: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
position: {
|
||||
|
|
|
@ -13,11 +13,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
labelId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -10,11 +10,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
labelId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -13,11 +13,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -10,11 +10,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -9,7 +9,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
listId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
position: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -12,11 +12,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
listId: {
|
||||
type: 'number'
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/
|
||||
},
|
||||
position: {
|
||||
type: 'number'
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
text: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
text: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
boardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
boardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
position: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
position: {
|
||||
|
|
|
@ -13,11 +13,13 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
projectId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
cardId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,8 @@ const Errors = {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
},
|
||||
isAdmin: {
|
||||
|
|
|
@ -65,7 +65,8 @@ const createReceiver = () => {
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@ module.exports = {
|
|||
},
|
||||
userOrUserId: {
|
||||
type: 'ref',
|
||||
custom: value => _.isPlainObject(value) || _.isFinite(value),
|
||||
custom: value => _.isPlainObject(value) || _.isString(value),
|
||||
required: true
|
||||
},
|
||||
request: {
|
||||
|
|
|
@ -4,11 +4,11 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
beforeId: {
|
||||
type: 'number'
|
||||
type: 'string'
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
exceptBoardId: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value)
|
||||
custom: value => _.isString(value) || _.isArray(value)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
exceptCardId: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value)
|
||||
custom: value => _.isString(value) || _.isArray(value)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
exceptListId: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value)
|
||||
custom: value => _.isString(value) || _.isArray(value)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
withProjectMemberships: {
|
||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
exceptUserId: {
|
||||
type: 'number',
|
||||
custom: value => _.isInteger(value) || _.isArray(value)
|
||||
type: 'json',
|
||||
custom: value => _.isString(value) || _.isArray(value)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
exceptUserId: {
|
||||
type: 'number',
|
||||
custom: value => _.isInteger(value) || _.isArray(value)
|
||||
type: 'json',
|
||||
custom: value => _.isString(value) || _.isArray(value)
|
||||
},
|
||||
withCardSubscriptions: {
|
||||
type: 'boolean',
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
|
|
|
@ -2,12 +2,12 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
},
|
||||
exceptUserId: {
|
||||
type: 'number',
|
||||
custom: value => _.isInteger(value) || _.isArray(value)
|
||||
type: 'json',
|
||||
custom: value => _.isString(value) || _.isArray(value)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isArray(value),
|
||||
custom: value => _.isString(value) || _.isArray(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = {
|
|||
inputs: {
|
||||
criteria: {
|
||||
type: 'json',
|
||||
custom: value => _.isInteger(value) || _.isPlainObject(value),
|
||||
custom: value => _.isString(value) || _.isPlainObject(value),
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
@ -12,7 +12,7 @@ module.exports = {
|
|||
deletedAt: null
|
||||
};
|
||||
|
||||
if (_.isInteger(inputs.criteria)) {
|
||||
if (_.isString(inputs.criteria)) {
|
||||
criteria.id = inputs.criteria;
|
||||
} else if (_.isPlainObject(inputs.criteria)) {
|
||||
Object.assign(criteria, inputs.criteria);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const GAP = 2 ** 14;
|
||||
const MIN_GAP = 0.125;
|
||||
const MAX_POSITION = 2 ** 40; // 2 ** 50
|
||||
const MAX_POSITION = 2 ** 50;
|
||||
|
||||
const findBeginnings = positions => {
|
||||
positions.unshift(0);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -12,7 +12,7 @@ module.exports = function defineCurrentUserHook(sails) {
|
|||
let id;
|
||||
|
||||
try {
|
||||
id = Number(sails.helpers.verifyToken(accessToken));
|
||||
id = sails.helpers.verifyToken(accessToken);
|
||||
} catch (unusedError) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
columnName: 'from_model'
|
||||
},
|
||||
originalRecordId: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
required: true,
|
||||
columnName: 'original_record_id'
|
||||
},
|
||||
|
|
|
@ -66,7 +66,7 @@ module.exports.models = {
|
|||
|
||||
attributes: {
|
||||
id: {
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
autoIncrement: true,
|
||||
},
|
||||
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 => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.text('from_model').notNullable();
|
||||
table.integer('original_record_id').notNullable();
|
||||
table.bigInteger('original_record_id').notNullable();
|
||||
table.json('original_record').notNullable();
|
||||
|
||||
table.timestamp('created_at', true);
|
|
@ -3,7 +3,10 @@ module.exports.up = knex =>
|
|||
.createTable('user', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.text('email').notNullable();
|
||||
table.text('password').notNullable();
|
|
@ -2,7 +2,10 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('project', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.text('name').notNullable();
|
||||
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('project_membership', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('project_id').notNullable();
|
||||
table.integer('user_id').notNullable();
|
||||
table.bigInteger('project_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
|
||||
table.timestamp('created_at', true);
|
||||
table.timestamp('updated_at', true);
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('board', table => {
|
||||
/* 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.text('name').notNullable();
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('list', table => {
|
||||
/* 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.text('name').notNullable();
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('label', table => {
|
||||
/* 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('color').notNullable();
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('card', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('list_id').notNullable();
|
||||
table.integer('board_id').notNullable();
|
||||
table.bigInteger('list_id').notNullable();
|
||||
table.bigInteger('board_id').notNullable();
|
||||
|
||||
table.specificType('position', 'double precision').notNullable();
|
||||
table.text('name').notNullable();
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('card_subscription', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('card_id').notNullable();
|
||||
table.integer('user_id').notNullable();
|
||||
table.bigInteger('card_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
|
||||
table.boolean('is_permanent').notNullable();
|
||||
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('card_membership', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('card_id').notNullable();
|
||||
table.integer('user_id').notNullable();
|
||||
table.bigInteger('card_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
|
||||
table.timestamp('created_at', true);
|
||||
table.timestamp('updated_at', true);
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('card_label', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('card_id').notNullable();
|
||||
table.integer('label_id').notNullable();
|
||||
table.bigInteger('card_id').notNullable();
|
||||
table.bigInteger('label_id').notNullable();
|
||||
|
||||
table.timestamp('created_at', true);
|
||||
table.timestamp('updated_at', true);
|
|
@ -2,9 +2,12 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('task', table => {
|
||||
/* 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.boolean('is_completed').notNullable();
|
|
@ -2,10 +2,13 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('action', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('card_id').notNullable();
|
||||
table.integer('user_id').notNullable();
|
||||
table.bigInteger('card_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
|
||||
table.text('type').notNullable();
|
||||
table.jsonb('data').notNullable();
|
|
@ -2,11 +2,14 @@ module.exports.up = knex =>
|
|||
knex.schema.createTable('notification', table => {
|
||||
/* Columns */
|
||||
|
||||
table.increments();
|
||||
table
|
||||
.bigInteger('id')
|
||||
.primary()
|
||||
.defaultTo(knex.raw('next_id()'));
|
||||
|
||||
table.integer('user_id').notNullable();
|
||||
table.integer('action_id').notNullable();
|
||||
table.integer('card_id').notNullable();
|
||||
table.bigInteger('user_id').notNullable();
|
||||
table.bigInteger('action_id').notNullable();
|
||||
table.bigInteger('card_id').notNullable();
|
||||
|
||||
table.boolean('is_read').notNullable();
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue