Created
April 20, 2019 18:12
-
-
Save victorsteven/f38d25f787af6b0430db118380260e85 to your computer and use it in GitHub Desktop.
Book Migration file
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 characters
| module.exports = { | |
| up: (queryInterface, Sequelize) => { | |
| return queryInterface.createTable('Books', { | |
| id: { | |
| allowNull: false, | |
| autoIncrement: true, | |
| primaryKey: true, | |
| type: Sequelize.INTEGER | |
| }, | |
| title: { | |
| type: Sequelize.STRING, | |
| allowNull: false, | |
| }, | |
| price: { | |
| type: Sequelize.STRING, | |
| allowNull: false, | |
| }, | |
| description: { | |
| type: Sequelize.STRING, | |
| allowNull: false, | |
| }, | |
| createdAt: { | |
| allowNull: false, | |
| type: Sequelize.DATE | |
| }, | |
| updatedAt: { | |
| allowNull: false, | |
| type: Sequelize.DATE | |
| } | |
| }); | |
| }, | |
| down: (queryInterface) => { | |
| return queryInterface.dropTable('Books'); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment