Added migrations and saving real estate type correctly

This commit is contained in:
Senad Uka
2019-04-20 05:26:14 +02:00
parent c534c1ee34
commit 298c901759
13 changed files with 157 additions and 54 deletions

View File

@@ -0,0 +1,19 @@
'use strict';
module.exports = (sequelize, DataTypes) => {
const RealEstateRequest = sequelize.define('RealEstateRequest', {
uniqueId: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
allowNull: false
},
realEstateType: {
type: DataTypes.ENUM,
values: ['kuca','stan','vikendica','plac','poslovni_prostor','apartman','garaza']
},
email: DataTypes.STRING
}, {});
RealEstateRequest.associate = function(models) {
// associations can be defined here
};
return RealEstateRequest;
};