1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
module.exports = (Sequelize, sequelize) => {
const MandalMaster = sequelize.define("mandal_master", {
mandal_id: {
type: Sequelize.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
mandal_name: {
type: Sequelize.STRING(155),
allowNull: false,
},
district_id: {
type: Sequelize.INTEGER,
allowNull: false,
// FOREIGN KEY (district_id) REFERENCES public.district_master(district_id) ON DELETE CASCADE;
references: {
model: "district_master",
key: "district_id",
onDelete: "CASCADE",
},
},
});
return MandalMaster;
};
|