gancio-upstream/server/migrations/20191025134318-places.js
2019-10-28 17:33:20 +01:00

34 lines
733 B
JavaScript

'use strict'
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('places',
{
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
name: {
type: Sequelize.STRING,
unique: true,
index: true,
allowNull: false
},
address: Sequelize.STRING,
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
})
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('places')
}
}