add createdAt, updatedAt fields; add default values for not null fields
This commit is contained in:
@@ -53,12 +53,20 @@ module.exports = {
|
||||
sold: {
|
||||
type: Sequelize.BOOLEAN,
|
||||
allowNull: false
|
||||
},
|
||||
createdAt: {
|
||||
type: Sequelize.DATE,
|
||||
defaultValue: Sequelize.literal("NOW()")
|
||||
},
|
||||
updatedAt: {
|
||||
type: Sequelize.DATE,
|
||||
defaultValue: Sequelize.literal("NOW()")
|
||||
}
|
||||
};
|
||||
return queryInterface.createTable("realEstates", tableFields);
|
||||
return queryInterface.createTable("RealEstates", tableFields);
|
||||
},
|
||||
|
||||
down: queryInterface => {
|
||||
return queryInterface.dropTable("realEstates", {});
|
||||
return queryInterface.dropTable("RealEstates", {});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user