Last active
August 21, 2020 11:25
-
-
Save matsuaki-jp/de47d063e24b79dc2bce264c4ef325fb to your computer and use it in GitHub Desktop.
sequelize with ts
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
'use strict'; | |
import { QueryInterface, DataTypes } from 'sequelize'; | |
module.exports = { | |
up: async (queryInterface:QueryInterface) => { | |
await queryInterface.createTable('hellos', { | |
id: { | |
allowNull: false, | |
autoIncrement: true, | |
primaryKey: true, | |
type: DataTypes.INTEGER | |
}, | |
name: { | |
type: DataTypes.STRING | |
}, | |
createdAt: { | |
allowNull: false, | |
type: DataTypes.DATE | |
}, | |
updatedAt: { | |
allowNull: false, | |
type: DataTypes.DATE | |
} | |
}); | |
}, | |
down: async (queryInterface:QueryInterface) => { | |
await queryInterface.dropTable('hellos'); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment