vr-migrations 1.0.28 → 1.0.30

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.
@@ -18,7 +18,7 @@ module.exports = {
18
18
  key: "id",
19
19
  },
20
20
  onUpdate: "CASCADE",
21
- onDelete: "CASCADE",
21
+ onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
22
22
  },
23
23
  name: {
24
24
  type: Sequelize.STRING(100),
@@ -7,7 +7,7 @@ module.exports = {
7
7
  type: Sequelize.UUID,
8
8
  defaultValue: Sequelize.UUIDV4,
9
9
  primaryKey: true,
10
- allowNull: false
10
+ allowNull: false,
11
11
  },
12
12
 
13
13
  userId: {
@@ -15,10 +15,10 @@ module.exports = {
15
15
  allowNull: false,
16
16
  references: {
17
17
  model: "users",
18
- key: "id"
18
+ key: "id",
19
19
  },
20
20
  onUpdate: "CASCADE",
21
- onDelete: "RESTRICT"
21
+ onDelete: "RESTRICT",
22
22
  },
23
23
 
24
24
  devicePaymentPlanId: {
@@ -26,15 +26,15 @@ module.exports = {
26
26
  allowNull: false,
27
27
  references: {
28
28
  model: "device_payment_plans",
29
- key: "id"
29
+ key: "id",
30
30
  },
31
31
  onUpdate: "CASCADE",
32
- onDelete: "RESTRICT"
32
+ onDelete: "RESTRICT",
33
33
  },
34
34
 
35
35
  transactionId: {
36
36
  type: Sequelize.UUID,
37
- allowNull: true
37
+ allowNull: true,
38
38
  },
39
39
 
40
40
  idempotencyKeyId: {
@@ -42,50 +42,50 @@ module.exports = {
42
42
  allowNull: true,
43
43
  references: {
44
44
  model: "idempotency_records",
45
- key: "id"
45
+ key: "id",
46
46
  },
47
47
  onUpdate: "CASCADE",
48
- onDelete: "SET NULL"
48
+ onDelete: "SET NULL",
49
49
  },
50
50
 
51
51
  amount: {
52
52
  type: Sequelize.FLOAT,
53
- allowNull: false
53
+ allowNull: false,
54
54
  },
55
55
 
56
56
  provider: {
57
57
  type: Sequelize.ENUM("mtn_momo", "airtel_money"),
58
- allowNull: false
58
+ allowNull: false,
59
59
  },
60
60
 
61
61
  providerReference: {
62
62
  type: Sequelize.STRING,
63
- allowNull: true
63
+ allowNull: true,
64
64
  },
65
65
 
66
66
  status: {
67
- type: Sequelize.ENUM("pending", "succeeded", "failed"),
67
+ type: Sequelize.ENUM("PENDING", "SUCCESSFUL", "FAILED"),
68
68
  allowNull: false,
69
- defaultValue: "pending"
69
+ defaultValue: "PENDING",
70
70
  },
71
71
 
72
72
  metadata: {
73
73
  type: Sequelize.JSONB,
74
74
  allowNull: false,
75
- defaultValue: {}
75
+ defaultValue: {},
76
76
  },
77
77
 
78
78
  createdAt: {
79
79
  type: Sequelize.DATE,
80
80
  allowNull: false,
81
- defaultValue: Sequelize.fn("NOW")
81
+ defaultValue: Sequelize.fn("NOW"),
82
82
  },
83
83
 
84
84
  updatedAt: {
85
85
  type: Sequelize.DATE,
86
86
  allowNull: false,
87
- defaultValue: Sequelize.fn("NOW")
88
- }
87
+ defaultValue: Sequelize.fn("NOW"),
88
+ },
89
89
  });
90
90
 
91
91
  await queryInterface.addIndex("payments", ["userId"]);
@@ -102,5 +102,5 @@ module.exports = {
102
102
  await queryInterface.sequelize.query(
103
103
  'DROP TYPE IF EXISTS "enum_payments_status";'
104
104
  );
105
- }
105
+ },
106
106
  };
@@ -23,7 +23,7 @@ module.exports = {
23
23
  key: "id",
24
24
  },
25
25
  onUpdate: "CASCADE",
26
- onDelete: "CASCADE",
26
+ onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
27
27
  },
28
28
  installmentNumber: {
29
29
  type: Sequelize.INTEGER,
@@ -24,7 +24,7 @@ module.exports = {
24
24
  key: "id",
25
25
  },
26
26
  onUpdate: "CASCADE",
27
- onDelete: "CASCADE",
27
+ onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
28
28
  },
29
29
  adminId: {
30
30
  type: Sequelize.UUID,
@@ -34,7 +34,7 @@ module.exports = {
34
34
  key: "id",
35
35
  },
36
36
  onUpdate: "CASCADE",
37
- onDelete: "CASCADE",
37
+ onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
38
38
  },
39
39
  reason: {
40
40
  type: Sequelize.TEXT,
@@ -24,7 +24,7 @@ module.exports = {
24
24
  key: "id",
25
25
  },
26
26
  onUpdate: "CASCADE",
27
- onDelete: "CASCADE",
27
+ onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
28
28
  },
29
29
  adminId: {
30
30
  type: Sequelize.UUID,
@@ -34,7 +34,7 @@ module.exports = {
34
34
  key: "id",
35
35
  },
36
36
  onUpdate: "CASCADE",
37
- onDelete: "CASCADE",
37
+ onDelete: "SET NULL", // ← This is SET NULL, not CASCADE
38
38
  },
39
39
  reason: {
40
40
  type: Sequelize.TEXT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-migrations",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "Database migration and seeding package for VR applications",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",