aboutsummaryrefslogtreecommitdiff
path: root/interface/models/mandal_master.model.js
diff options
context:
space:
mode:
Diffstat (limited to 'interface/models/mandal_master.model.js')
-rw-r--r--interface/models/mandal_master.model.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/interface/models/mandal_master.model.js b/interface/models/mandal_master.model.js
new file mode 100644
index 0000000..7b7d16f
--- /dev/null
+++ b/interface/models/mandal_master.model.js
@@ -0,0 +1,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;
+};