43 lines
930 B
JavaScript
43 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')
|
||
|
}
|
||
|
}
|