agrs-sequelize-sdk 1.1.51 → 1.1.53
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/models/Channel.js +3 -17
- package/package.json +1 -1
package/models/Channel.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// models/Channel.js
|
|
1
2
|
module.exports = (sequelize, DataTypes) => {
|
|
2
3
|
const Channel = sequelize.define(
|
|
3
4
|
"Channel",
|
|
@@ -5,7 +6,7 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
5
6
|
channelId: {
|
|
6
7
|
type: DataTypes.STRING,
|
|
7
8
|
allowNull: false,
|
|
8
|
-
//
|
|
9
|
+
unique: false, // Explicitly set to false to override any default
|
|
9
10
|
},
|
|
10
11
|
styleId: {
|
|
11
12
|
type: DataTypes.STRING,
|
|
@@ -24,26 +25,11 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
24
25
|
allowNull: false,
|
|
25
26
|
defaultValue: [],
|
|
26
27
|
},
|
|
27
|
-
createdAt: {
|
|
28
|
-
type: DataTypes.DATE,
|
|
29
|
-
defaultValue: DataTypes.NOW,
|
|
30
|
-
},
|
|
31
|
-
updatedAt: {
|
|
32
|
-
type: DataTypes.DATE,
|
|
33
|
-
defaultValue: DataTypes.NOW,
|
|
34
|
-
},
|
|
35
28
|
},
|
|
36
29
|
{
|
|
37
30
|
tableName: "channels",
|
|
38
31
|
timestamps: true,
|
|
39
|
-
indexes
|
|
40
|
-
// Add a unique index on the combination of channelId and styleId
|
|
41
|
-
{
|
|
42
|
-
unique: true,
|
|
43
|
-
fields: ["channelId", "styleId"],
|
|
44
|
-
name: "channels_channelId_styleId_unique",
|
|
45
|
-
},
|
|
46
|
-
],
|
|
32
|
+
// Remove any existing indexes here - we'll add the constraint after table creation
|
|
47
33
|
}
|
|
48
34
|
);
|
|
49
35
|
|