@tomei/sso 0.50.3 → 0.50.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -30,16 +30,6 @@ module.exports = {
|
|
30
30
|
onDelete: 'CASCADE',
|
31
31
|
onUpdate: 'CASCADE',
|
32
32
|
},
|
33
|
-
SystemCode: {
|
34
|
-
type: Sequelize.STRING(10),
|
35
|
-
allowNull: false,
|
36
|
-
references: {
|
37
|
-
model: 'sso_System',
|
38
|
-
key: 'SystemCode',
|
39
|
-
},
|
40
|
-
onDelete: 'CASCADE',
|
41
|
-
onUpdate: 'CASCADE',
|
42
|
-
},
|
43
33
|
Status: {
|
44
34
|
type: Sequelize.STRING(10),
|
45
35
|
defaultValue: 'Active',
|
@@ -3,7 +3,7 @@
|
|
3
3
|
/** @type {import('sequelize-cli').Migration} */
|
4
4
|
module.exports = {
|
5
5
|
async up(queryInterface, Sequelize) {
|
6
|
-
await queryInterface.createTable('
|
6
|
+
await queryInterface.createTable('sso_ApiKey', {
|
7
7
|
APIKeyId: {
|
8
8
|
primaryKey: true,
|
9
9
|
type: Sequelize.INTEGER,
|
@@ -16,7 +16,12 @@ module.exports = {
|
|
16
16
|
onDelete: 'CASCADE',
|
17
17
|
},
|
18
18
|
BuildingType: {
|
19
|
-
type: Sequelize.ENUM(
|
19
|
+
type: Sequelize.ENUM(
|
20
|
+
'Outlet',
|
21
|
+
'Office',
|
22
|
+
'Fulfillment Center',
|
23
|
+
'Warehouse',
|
24
|
+
),
|
20
25
|
allowNull: true,
|
21
26
|
},
|
22
27
|
Email: {
|
@@ -78,18 +83,6 @@ module.exports = {
|
|
78
83
|
type: Sequelize.DATE,
|
79
84
|
},
|
80
85
|
});
|
81
|
-
|
82
|
-
// Add a trigger to keep GroupCode and ObjectId in sync on updates
|
83
|
-
await queryInterface.sequelize.query(`
|
84
|
-
CREATE TRIGGER update_GroupCode_ObjectId
|
85
|
-
BEFORE UPDATE ON sso_Building
|
86
|
-
FOR EACH ROW
|
87
|
-
BEGIN
|
88
|
-
IF NEW.ObjectId != OLD.ObjectId THEN
|
89
|
-
SET NEW.GroupCode = NEW.ObjectId;
|
90
|
-
END IF;
|
91
|
-
END;
|
92
|
-
`);
|
93
86
|
},
|
94
87
|
|
95
88
|
down: async (queryInterface, Sequelize) => {
|