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

42 lines
930 B
JavaScript

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('vegetables', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
name: {
type: Sequelize.STRING
},
mainPicture: {
type: Sequelize.STRING
},
description: {
type: Sequelize.TEXT
},
lat: {
type: Sequelize.INTEGER
},
lng: {
type: Sequelize.INTEGER
},
vegetableTypes_id: {
type: Sequelize.INTEGER,
references: { model: 'vegetableTypes', key: 'id' }
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
})
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('vegetables')
}
}