vr-models 1.0.49 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/ban.models.js +3 -3
- package/dist/models/devicePaymentPlan.models.js +1 -1
- package/dist/models/installment.models.js +1 -1
- package/dist/models/phoneContact.models.js +2 -0
- package/dist/models/pricing.models.js +1 -1
- package/dist/models/product.models.js +1 -1
- package/dist/models/suspension.models.js +3 -3
- package/dist/models/transaction.models.js +1 -1
- package/dist/models/user.models.js +4 -4
- package/package.json +1 -1
|
@@ -79,19 +79,19 @@ class Ban extends vr_migrations_1.Model {
|
|
|
79
79
|
this.belongsTo(models.User, {
|
|
80
80
|
foreignKey: "userId",
|
|
81
81
|
as: "user",
|
|
82
|
-
onDelete: "
|
|
82
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
83
83
|
onUpdate: "CASCADE",
|
|
84
84
|
});
|
|
85
85
|
this.belongsTo(models.User, {
|
|
86
86
|
foreignKey: "adminId",
|
|
87
87
|
as: "admin",
|
|
88
|
-
onDelete: "
|
|
88
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
89
89
|
onUpdate: "CASCADE",
|
|
90
90
|
});
|
|
91
91
|
this.belongsTo(models.User, {
|
|
92
92
|
foreignKey: "revokedBy",
|
|
93
93
|
as: "revokingAdmin",
|
|
94
|
-
onDelete: "
|
|
94
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
95
95
|
onUpdate: "CASCADE",
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -88,7 +88,7 @@ class DevicePaymentPlan extends vr_migrations_1.Model {
|
|
|
88
88
|
this.hasMany(models.Installment, {
|
|
89
89
|
foreignKey: "devicePaymentPlanId",
|
|
90
90
|
as: "installments",
|
|
91
|
-
onDelete: "
|
|
91
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
92
92
|
onUpdate: "CASCADE",
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -106,7 +106,7 @@ class Installment extends vr_migrations_1.Model {
|
|
|
106
106
|
this.belongsTo(models.DevicePaymentPlan, {
|
|
107
107
|
foreignKey: "devicePaymentPlanId",
|
|
108
108
|
as: "paymentPlan",
|
|
109
|
-
onDelete: "
|
|
109
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
110
110
|
onUpdate: "CASCADE",
|
|
111
111
|
});
|
|
112
112
|
this.belongsTo(models.Payment, {
|
|
@@ -34,7 +34,7 @@ class Product extends vr_migrations_1.Model {
|
|
|
34
34
|
this.hasMany(models.Pricing, {
|
|
35
35
|
foreignKey: "productId",
|
|
36
36
|
as: "pricings",
|
|
37
|
-
onDelete: "
|
|
37
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
38
38
|
onUpdate: "CASCADE",
|
|
39
39
|
});
|
|
40
40
|
this.hasMany(models.Device, {
|
|
@@ -85,19 +85,19 @@ class Suspension extends vr_migrations_1.Model {
|
|
|
85
85
|
this.belongsTo(models.User, {
|
|
86
86
|
foreignKey: "userId",
|
|
87
87
|
as: "user",
|
|
88
|
-
onDelete: "
|
|
88
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
89
89
|
onUpdate: "CASCADE",
|
|
90
90
|
});
|
|
91
91
|
this.belongsTo(models.User, {
|
|
92
92
|
foreignKey: "adminId",
|
|
93
93
|
as: "admin",
|
|
94
|
-
onDelete: "
|
|
94
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
95
95
|
onUpdate: "CASCADE",
|
|
96
96
|
});
|
|
97
97
|
this.belongsTo(models.User, {
|
|
98
98
|
foreignKey: "revokedBy",
|
|
99
99
|
as: "revokingAdmin",
|
|
100
|
-
onDelete: "
|
|
100
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
101
101
|
onUpdate: "CASCADE",
|
|
102
102
|
});
|
|
103
103
|
}
|
|
@@ -42,7 +42,7 @@ class Transaction extends vr_migrations_1.Model {
|
|
|
42
42
|
this.belongsTo(models.Payment, {
|
|
43
43
|
foreignKey: "paymentId",
|
|
44
44
|
as: "payment",
|
|
45
|
-
onDelete: "
|
|
45
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
46
46
|
onUpdate: "CASCADE",
|
|
47
47
|
});
|
|
48
48
|
this.belongsTo(models.User, {
|
|
@@ -122,25 +122,25 @@ class User extends vr_migrations_1.Model {
|
|
|
122
122
|
this.hasMany(models.Device, {
|
|
123
123
|
foreignKey: "userId",
|
|
124
124
|
as: "devices",
|
|
125
|
-
onDelete: "
|
|
125
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
126
126
|
onUpdate: "CASCADE",
|
|
127
127
|
});
|
|
128
128
|
this.hasMany(models.Payment, {
|
|
129
129
|
foreignKey: "userId",
|
|
130
130
|
as: "payments",
|
|
131
|
-
onDelete: "
|
|
131
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
132
132
|
onUpdate: "CASCADE",
|
|
133
133
|
});
|
|
134
134
|
this.hasMany(models.Suspension, {
|
|
135
135
|
foreignKey: "userId",
|
|
136
136
|
as: "suspensions",
|
|
137
|
-
onDelete: "
|
|
137
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
138
138
|
onUpdate: "CASCADE",
|
|
139
139
|
});
|
|
140
140
|
this.hasMany(models.Ban, {
|
|
141
141
|
foreignKey: "userId",
|
|
142
142
|
as: "bans",
|
|
143
|
-
onDelete: "
|
|
143
|
+
onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
|
|
144
144
|
onUpdate: "CASCADE",
|
|
145
145
|
});
|
|
146
146
|
}
|