api/migrations/20180907185312-create-vegetables.js

43 lines
928 B
JavaScript
Raw Normal View History

2018-09-07 21:14:05 +02:00
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
},
2018-09-08 00:00:47 +02:00
vegetableTypeId: {
2018-09-07 21:14:05 +02:00
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')
}
}