mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
30 lines
750 B
JavaScript
30 lines
750 B
JavaScript
'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');
|
|
*/
|
|
}
|
|
};
|