Created
November 30, 2018 22:24
-
-
Save in43sh/fdaeefc3810b599bbf77829825261c25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = (sequelize, DataTypes) => { | |
const Properties = sequelize.define('Properties', { | |
name: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
address: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
category: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
open_time: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
close_time: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
description: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
photo: { | |
allowNull: false, | |
type: DataTypes.STRING | |
}, | |
geoloc: { | |
allowNull: false, | |
type: DataTypes.GEOMETRY | |
} | |
}, { | |
timestamps: true, | |
paranoid: true | |
}); | |
Properties.associate = function(models) { | |
// associations can be defined here | |
Properties.hasMany(models.Deals, { | |
foreignKey: 'id', | |
onDelete: 'CASCADE' | |
}) | |
}; | |
return Properties; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment