spark-property-manager
Version:
Spark Real Estate Management Application
50 lines (49 loc) • 1.02 kB
JavaScript
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('tenant', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
firstname: {
allowNull: false,
type: Sequelize.STRING
},
lastname: {
type: Sequelize.STRING
},
phone: {
type: Sequelize.STRING
},
email: {
type: Sequelize.STRING
},
lease_start: {
type: Sequelize.DATE
},
lease_end: {
type: Sequelize.DATE
},
company_id: {
type: Sequelize.INTEGER,
references: {
model: 'company',
key: 'id'
}
},
unit_id: {
type: Sequelize.INTEGER,
references: {
model: 'property_unit',
key: 'id'
}
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('tenant');
}
};