s/cohort/collection
This commit is contained in:
30
server/migrations/20220617203517-collection.js
Normal file
30
server/migrations/20220617203517-collection.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
async up (queryInterface, Sequelize) {
|
||||
return Promise.all(
|
||||
[
|
||||
await queryInterface.renameTable('cohorts', 'collections'),
|
||||
await queryInterface.renameColumn('filters', 'cohortId', 'collectionId'),
|
||||
await queryInterface.changeColumn('filters', 'collectionId', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: true,
|
||||
references: {
|
||||
model: 'collections',
|
||||
key: 'id'
|
||||
},
|
||||
onUpdate: 'CASCADE',
|
||||
onDelete: 'SET NULL'
|
||||
}),
|
||||
])
|
||||
},
|
||||
|
||||
async down (queryInterface, Sequelize) {
|
||||
/**
|
||||
* Add reverting commands here.
|
||||
*
|
||||
* Example:
|
||||
* await queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user