add createdAt, updatedAt fields; add default values for not null fields
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = {
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
references: {
|
||||
model: "searchRequests",
|
||||
model: "SearchRequests",
|
||||
key: "id"
|
||||
},
|
||||
onUpdate: "CASCADE",
|
||||
@@ -24,7 +24,7 @@ module.exports = {
|
||||
allowNull: false,
|
||||
primaryKey: true,
|
||||
references: {
|
||||
model: "realEstates",
|
||||
model: "RealEstates",
|
||||
key: "id"
|
||||
},
|
||||
onUpdate: "CASCADE",
|
||||
@@ -34,12 +34,20 @@ module.exports = {
|
||||
type: Sequelize.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
},
|
||||
createdAt: {
|
||||
type: Sequelize.DATE,
|
||||
defaultValue: Sequelize.literal("NOW()")
|
||||
},
|
||||
updatedAt: {
|
||||
type: Sequelize.DATE,
|
||||
defaultValue: Sequelize.literal("NOW()")
|
||||
}
|
||||
};
|
||||
return queryInterface.createTable("searchRequestMatches", tableFields);
|
||||
return queryInterface.createTable("SearchRequestMatches", tableFields);
|
||||
},
|
||||
|
||||
down: queryInterface => {
|
||||
return queryInterface.dropTable("searchRequestMatches", {});
|
||||
return queryInterface.dropTable("SearchRequestMatches", {});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user