api/migrations/20180907185320-create-vegetables_pictures.js
2018-09-07 21:14:05 +02:00

33 lines
763 B
JavaScript

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('vegetablePictures', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
url: {
type: Sequelize.STRING
},
order: {
type: Sequelize.INTEGER
},
vegetables_id: {
type: Sequelize.INTEGER,
references: { model: 'vegetables', key: 'id' }
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
})
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('vegetablePictures')
}
}