added migration for db
This commit is contained in:
parent
936230a7fc
commit
0f6193b450
1 changed files with 34 additions and 0 deletions
34
server/migrations/File_AddHeightAndWidthColumn.js
Normal file
34
server/migrations/File_AddHeightAndWidthColumn.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
module.exports = {
|
||||||
|
up: (queryInterface, Sequelize) => {
|
||||||
|
// logic for transforming into the new state
|
||||||
|
const changeOne = queryInterface.addColumn(
|
||||||
|
'File',
|
||||||
|
'height',
|
||||||
|
{
|
||||||
|
type : Sequelize.INTEGER,
|
||||||
|
allowNull: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const changeTwo = queryInterface.addColumn(
|
||||||
|
'File',
|
||||||
|
'width',
|
||||||
|
{
|
||||||
|
type : Sequelize.INTEGER,
|
||||||
|
allowNull: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.all([changeOne, changeTwo]);
|
||||||
|
},
|
||||||
|
down: (queryInterface, Sequelize) => {
|
||||||
|
// logic for reverting the changes
|
||||||
|
const reversionOne = queryInterface.removeColumn(
|
||||||
|
'File',
|
||||||
|
'height'
|
||||||
|
);
|
||||||
|
const reversionTwo = queryInterface.removeColumn(
|
||||||
|
'File',
|
||||||
|
'width',
|
||||||
|
);
|
||||||
|
return Promise.all([reversionOne, reversionTwo]);
|
||||||
|
},
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue