.
This commit is contained in:
30
migrations/20190521100417-act_ids_comment_data.js
Normal file
30
migrations/20190521100417-act_ids_comment_data.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add altering commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||
*/
|
||||
const a = queryInterface.addColumn('events', 'activitypub_ids', Sequelize.ARRAY(Sequelize.DOUBLE), { index: true })
|
||||
const b = queryInterface.addColumn('comments', 'data', Sequelize.JSON)
|
||||
return Promise.all([a, b])
|
||||
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add reverting commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.dropTable('users');
|
||||
*/
|
||||
const b = queryInterface.removeColumn('comments', 'data')
|
||||
const a = queryInterface.removeColumn('events', 'activitypub_ids')
|
||||
return Promise.all([a, b])
|
||||
}
|
||||
};
|
||||
27
migrations/20190522104158-bigint.js
Normal file
27
migrations/20190522104158-bigint.js
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add altering commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||
*/
|
||||
const a = queryInterface.changeColumn('events', 'activitypub_id', { type: Sequelize.BIGINT, index: true })
|
||||
const b = queryInterface.changeColumn('events', 'activitypub_ids', { type: Sequelize.ARRAY(Sequelize.BIGINT), index: true, defaultValue: [] })
|
||||
const c = queryInterface.changeColumn('comments', 'activitypub_id', { type: Sequelize.BIGINT, index: true})
|
||||
return Promise.all([a, b, c])
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add reverting commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
};
|
||||
29
migrations/20190527205032-tag_id_weight.js
Normal file
29
migrations/20190527205032-tag_id_weight.js
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add altering commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||
*/
|
||||
await queryInterface.addColumn('tags', 'weigth', Sequelize.INTEGER)
|
||||
await queryInterface.sequelize.query('update "tags" SET weigth=subquery.c from (SELECT COUNT(*) as c, "tagTag" from "tagEvent" group by "tagTag") as subquery where "subquery"."tagTag"="tags"."tag";')
|
||||
await queryInterface.addColumn('places', 'weigth', Sequelize.INTEGER)
|
||||
await queryInterface.sequelize.query('update "places" SET weigth=subquery.c from (SELECT COUNT(*) as c, "placeId" from "events" group by "placeId") as subquery where "subquery"."placeId"="places"."id";')
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add reverting commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.dropTable('users');
|
||||
*/
|
||||
await queryInterface.removeColumn('tags', 'weigth', Sequelize.INTEGER)
|
||||
await queryInterface.removeColumn('places', 'weigth', Sequelize.INTEGER)
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user