Skip to content

Instantly share code, notes, and snippets.

@matsuaki-jp
Last active August 21, 2020 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsuaki-jp/de47d063e24b79dc2bce264c4ef325fb to your computer and use it in GitHub Desktop.
Save matsuaki-jp/de47d063e24b79dc2bce264c4ef325fb to your computer and use it in GitHub Desktop.
sequelize with ts
'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