Last active
February 4, 2022 17:34
-
-
Save s1moe2/38e6b065f85237ebe48cb9ecc9d10036 to your computer and use it in GitHub Desktop.
Revisions
-
s1moe2 revised this gist
Jul 14, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ // NOTE: MySQL does not support transactional DDL (https://dev.mysql.com/doc/internals/en/transactions-notes-on-ddl-and-normal-transaction.html) // You should use this with a (cool) DBMS such as PostgreSQL. module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.sequelize.transaction((t) => { -
s1moe2 revised this gist
Jul 14, 2020 . No changes.There are no files selected for viewing
-
s1moe2 created this gist
Nov 20, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.sequelize.transaction((t) => { return Promise.all([ queryInterface.addColumn('table_name', 'column_name1', { type: Sequelize.STRING }, { transaction: t }), queryInterface.addColumn('table_name', 'column_name2', { type: Sequelize.STRING, }, { transaction: t }) ]) }) }, down: (queryInterface, Sequelize) => { return queryInterface.sequelize.transaction((t) => { return Promise.all([ queryInterface.removeColumn('table_name', 'column_name1', { transaction: t }), queryInterface.removeColumn('table_name', 'column_name2', { transaction: t }) ]) }) } };