Created
July 30, 2018 09:50
-
-
Save samratshaw/e673dc65c8d80b50dd96959c2c9797ea to your computer and use it in GitHub Desktop.
Medium: Sequelize Typescript create migration
This file contains 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 characters
cat > ./src/db/migrations/$(date +"%Y%m%d%H%M%S")-$1.ts << EOF | |
import { QueryInterface, SequelizeStatic } from 'sequelize'; | |
module.exports = { | |
// tslint:disable-next-line:variable-name | |
up: async (queryInterface: QueryInterface, Sequelize: SequelizeStatic) => { | |
// Write migration code here. | |
}, | |
// tslint:disable-next-line:variable-name | |
down: async (queryInterface: QueryInterface, Sequelize: SequelizeStatic) => { | |
// If migration fails, this will be called. Rollback your migration changes. | |
}, | |
}; | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment