Files
old-web/app/migrations/20190912215556-add-searchRequestMatches-table.js
2019-09-13 09:46:59 +02:00

46 lines
1.0 KiB
JavaScript

"use strict";
module.exports = {
up: (queryInterface, Sequelize) => {
const tableFields = {
id: {
type: Sequelize.BIGINT,
autoIncrement: true,
allowNull: false
},
searchRequestId: {
type: Sequelize.UUID,
allowNull: false,
primaryKey: true,
references: {
model: "searchRequests",
key: "id"
},
onUpdate: "CASCADE",
onDelete: "SET NULL"
},
realEstateId: {
type: Sequelize.BIGINT,
allowNull: false,
primaryKey: true,
references: {
model: "realEstates",
key: "id"
},
onUpdate: "CASCADE",
onDelete: "SET NULL"
},
notified: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false
}
};
return queryInterface.createTable("searchRequestMatches", tableFields);
},
down: queryInterface => {
return queryInterface.dropTable("searchRequestMatches", {});
}
};