add models for new DB design
This commit is contained in:
47
app/models/searchRequestMatch.js
Normal file
47
app/models/searchRequestMatch.js
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
const SearchRequestMatch = sequelize.define(
|
||||
"SearchRequestMatch",
|
||||
{
|
||||
id: {
|
||||
type: DataTypes.BIGINT,
|
||||
autoIncrement: true,
|
||||
allowNull: false
|
||||
},
|
||||
searchRequestId: {
|
||||
type: DataTypes.UUID,
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
references: {
|
||||
model: "SearchRequest",
|
||||
key: "id"
|
||||
}
|
||||
},
|
||||
realEstateId: {
|
||||
type: DataTypes.BIGINT,
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
references: {
|
||||
model: "RealEstate",
|
||||
key: "id"
|
||||
},
|
||||
onUpdate: "CASCADE",
|
||||
onDelete: "SET NULL"
|
||||
},
|
||||
notified: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: {
|
||||
singular: "searchRequestMatch",
|
||||
plural: "searchRequestMatches"
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return SearchRequestMatch;
|
||||
};
|
||||
Reference in New Issue
Block a user