api/migrations/20180907185320-create-vegetables_pictures.js

34 lines
761 B
JavaScript
Raw Permalink Normal View History

2018-09-07 21:14:05 +02:00
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
},
2018-09-16 23:46:39 +02:00
vegetableId: {
2018-09-07 21:14:05 +02:00
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')
}
}