agrs-sequelize-sdk 1.4.16 → 1.4.18

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.
Files changed (84) hide show
  1. package/migrations/2026-05-17-PIXELS-FOLLOWUP.md +85 -0
  2. package/migrations/2026-05-17-add-platform-to-ad.js +19 -0
  3. package/migrations/2026-05-17-add-platform-to-adaccount.js +19 -0
  4. package/migrations/2026-05-17-add-platform-to-adperformance.js +19 -0
  5. package/migrations/2026-05-17-add-platform-to-adset.js +19 -0
  6. package/migrations/2026-05-17-add-platform-to-adsetperformance.js +19 -0
  7. package/migrations/2026-05-17-add-platform-to-aiarticleretryqueue.js +19 -0
  8. package/migrations/2026-05-17-add-platform-to-aicampaignqueue.js +19 -0
  9. package/migrations/2026-05-17-add-platform-to-article.js +19 -0
  10. package/migrations/2026-05-17-add-platform-to-campaign.js +19 -0
  11. package/migrations/2026-05-17-add-platform-to-codefuelcampaign.js +19 -0
  12. package/migrations/2026-05-17-add-platform-to-dynamicfeed.js +19 -0
  13. package/migrations/2026-05-17-add-platform-to-facebookretryqueue.js +19 -0
  14. package/migrations/2026-05-17-add-platform-to-pages.js +19 -0
  15. package/migrations/2026-05-17-add-platform-to-presets.js +19 -0
  16. package/migrations/RUN_ME_MANUALLY_2026-05-17.sql +99 -0
  17. package/migrations/add-requested-from-dashboard-to-articles.js +17 -17
  18. package/migrations/change-adset-name-to-text.js +79 -79
  19. package/models/AICampaignQueue.js +143 -136
  20. package/models/AIGenerationLog.js +85 -85
  21. package/models/AIGenerationRequest.js +212 -212
  22. package/models/Ad.js +6 -0
  23. package/models/AdAccount.js +6 -0
  24. package/models/AdAccountValues.js +25 -25
  25. package/models/AdHistory.js +30 -30
  26. package/models/AdPerformance.js +100 -94
  27. package/models/AdSet.js +295 -289
  28. package/models/AdSetHistory.js +30 -30
  29. package/models/AdsetPerformance.js +132 -126
  30. package/models/AiArticleRetryQueue.js +157 -150
  31. package/models/AiCreationRetryQueue.js +127 -127
  32. package/models/Article.js +212 -206
  33. package/models/AutomationRule.js +173 -173
  34. package/models/BannerTemplate.js +129 -129
  35. package/models/Buyers.js +25 -25
  36. package/models/Campaign.js +163 -157
  37. package/models/CampaignActionHistory.js +86 -86
  38. package/models/CampaignCreationLog.js +309 -309
  39. package/models/CampaignCreationLogV2.js +314 -314
  40. package/models/CampaignHistory.js +33 -33
  41. package/models/Channel.js +55 -55
  42. package/models/CodefuelCampaign.js +6 -0
  43. package/models/Domain.js +39 -47
  44. package/models/DynamicFeed.js +218 -212
  45. package/models/ExplorAdsChannel.js +61 -61
  46. package/models/FacebookRetryQueue.js +163 -156
  47. package/models/Feed.js +33 -33
  48. package/models/FeedArticleConfiguration.js +80 -80
  49. package/models/FrontStoryChannel.js +59 -59
  50. package/models/FrontStoryChannelV2.js +60 -60
  51. package/models/GenericFlowRequest.js +114 -114
  52. package/models/MidoWebChannel.js +47 -47
  53. package/models/MineChannel.js +42 -42
  54. package/models/Pages.js +105 -99
  55. package/models/PipelineExecution.js +59 -59
  56. package/models/PolicyDogsCreativeCache.js +50 -50
  57. package/models/PolicyDogsImageCache.js +30 -30
  58. package/models/Presets.js +40 -34
  59. package/models/RSOCFeedCampaign.js +375 -375
  60. package/models/RsocKeywordPerformance.js +110 -110
  61. package/models/RuleAction.js +90 -90
  62. package/models/RuleCondition.js +137 -137
  63. package/models/RuleExecution.js +107 -107
  64. package/models/RulesValues.js +56 -56
  65. package/models/SupportedLocale.js +23 -23
  66. package/models/SyncHistory.js +249 -249
  67. package/models/TTQChannel.js +42 -42
  68. package/models/TemplateMetadata.js +260 -260
  69. package/models/Tier2_AdAccounts.js +110 -110
  70. package/models/Tier2_Assets.js +70 -70
  71. package/models/Tier2_BusinessManagers.js +105 -105
  72. package/models/Tier2_CreditLines.js +99 -99
  73. package/models/Tier2_Pages.js +91 -91
  74. package/models/Tier2_Pixels.js +82 -82
  75. package/models/Tier2_Tokens.js +64 -64
  76. package/models/Tier2_UserAdAccounts.js +83 -83
  77. package/models/TokenRotationState.js +121 -121
  78. package/models/TonicRSOCKeywordPerformance.js +122 -122
  79. package/models/Users.js +148 -148
  80. package/models/Vertical.js +25 -25
  81. package/models/newFiles.js +137 -137
  82. package/package.json +19 -21
  83. package/run.sh +214 -214
  84. package/services/sequelizeService.js +110 -110
@@ -1,156 +1,163 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const FacebookRetryQueue = sequelize.define(
3
- "FacebookRetryQueue",
4
- {
5
- id: {
6
- type: DataTypes.INTEGER,
7
- primaryKey: true,
8
- autoIncrement: true,
9
- },
10
- process_id: {
11
- type: DataTypes.UUID,
12
- allowNull: false,
13
- field: "process_id",
14
- comment: "Process ID from the original campaign creation request",
15
- },
16
- feed_campaign_id: {
17
- type: DataTypes.STRING(255),
18
- allowNull: true,
19
- field: "feed_campaign_id",
20
- comment: "AGRS_CID from the feed campaign",
21
- },
22
- feed_provider: {
23
- type: DataTypes.STRING(100),
24
- allowNull: false,
25
- field: "feed_provider",
26
- },
27
- country_group: {
28
- type: DataTypes.JSONB,
29
- allowNull: false,
30
- field: "country_group",
31
- comment: 'Array of country codes, e.g. ["US"] or ["US", "GB"]',
32
- },
33
- campaign_name: {
34
- type: DataTypes.STRING(500),
35
- allowNull: true,
36
- field: "campaign_name",
37
- },
38
- account_id: {
39
- type: DataTypes.STRING(100),
40
- allowNull: true,
41
- field: "account_id",
42
- comment: "Facebook ad account ID",
43
- },
44
- original_request: {
45
- type: DataTypes.JSONB,
46
- allowNull: false,
47
- field: "original_request",
48
- comment: "Full campaignData from the original HTTP request",
49
- },
50
- facebook_payload: {
51
- type: DataTypes.JSONB,
52
- allowNull: false,
53
- field: "facebook_payload",
54
- comment:
55
- "facebookCampaignData passed to createFullCampaignController",
56
- },
57
- feed_campaign_result: {
58
- type: DataTypes.JSONB,
59
- allowNull: true,
60
- field: "feed_campaign_result",
61
- comment:
62
- "feedCampaign result (AGRS_CID, rac, urlTags, channelId, etc.)",
63
- },
64
- last_error: {
65
- type: DataTypes.TEXT,
66
- allowNull: true,
67
- field: "last_error",
68
- },
69
- last_error_code: {
70
- type: DataTypes.INTEGER,
71
- allowNull: true,
72
- field: "last_error_code",
73
- },
74
- is_transient: {
75
- type: DataTypes.BOOLEAN,
76
- allowNull: true,
77
- field: "is_transient",
78
- },
79
- status: {
80
- type: DataTypes.STRING(50),
81
- allowNull: false,
82
- defaultValue: "pending",
83
- validate: {
84
- isIn: [
85
- ["pending", "processing", "completed", "failed", "abandoned"],
86
- ],
87
- },
88
- },
89
- retry_count: {
90
- type: DataTypes.INTEGER,
91
- allowNull: false,
92
- defaultValue: 0,
93
- field: "retry_count",
94
- },
95
- max_retries: {
96
- type: DataTypes.INTEGER,
97
- allowNull: false,
98
- defaultValue: 5,
99
- field: "max_retries",
100
- },
101
- next_retry_at: {
102
- type: DataTypes.DATE,
103
- allowNull: false,
104
- field: "next_retry_at",
105
- comment: "When the next retry should be attempted",
106
- },
107
- last_attempt_at: {
108
- type: DataTypes.DATE,
109
- allowNull: true,
110
- field: "last_attempt_at",
111
- },
112
- completed_at: {
113
- type: DataTypes.DATE,
114
- allowNull: true,
115
- field: "completed_at",
116
- },
117
- facebook_campaign_id: {
118
- type: DataTypes.STRING(255),
119
- allowNull: true,
120
- field: "facebook_campaign_id",
121
- comment: "Facebook campaign ID (populated on success)",
122
- },
123
- created_at: {
124
- type: DataTypes.DATE,
125
- allowNull: false,
126
- defaultValue: DataTypes.NOW,
127
- field: "created_at",
128
- },
129
- },
130
- {
131
- tableName: "facebook_retry_queue",
132
- timestamps: false,
133
- indexes: [
134
- {
135
- fields: ["status", "next_retry_at"],
136
- name: "idx_fb_retry_status_next",
137
- },
138
- {
139
- fields: ["process_id"],
140
- },
141
- {
142
- fields: ["feed_provider"],
143
- },
144
- {
145
- fields: ["created_at"],
146
- },
147
- ],
148
- }
149
- );
150
-
151
- FacebookRetryQueue.associate = (models) => {
152
- // No associations needed
153
- };
154
-
155
- return FacebookRetryQueue;
156
- };
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const FacebookRetryQueue = sequelize.define(
3
+ "FacebookRetryQueue",
4
+ {
5
+ id: {
6
+ type: DataTypes.INTEGER,
7
+ primaryKey: true,
8
+ autoIncrement: true,
9
+ },
10
+ process_id: {
11
+ type: DataTypes.UUID,
12
+ allowNull: false,
13
+ field: "process_id",
14
+ comment: "Process ID from the original campaign creation request",
15
+ },
16
+ feed_campaign_id: {
17
+ type: DataTypes.STRING(255),
18
+ allowNull: true,
19
+ field: "feed_campaign_id",
20
+ comment: "AGRS_CID from the feed campaign",
21
+ },
22
+ feed_provider: {
23
+ type: DataTypes.STRING(100),
24
+ allowNull: false,
25
+ field: "feed_provider",
26
+ },
27
+ country_group: {
28
+ type: DataTypes.JSONB,
29
+ allowNull: false,
30
+ field: "country_group",
31
+ comment: 'Array of country codes, e.g. ["US"] or ["US", "GB"]',
32
+ },
33
+ campaign_name: {
34
+ type: DataTypes.STRING(500),
35
+ allowNull: true,
36
+ field: "campaign_name",
37
+ },
38
+ account_id: {
39
+ type: DataTypes.STRING(100),
40
+ allowNull: true,
41
+ field: "account_id",
42
+ comment: "Facebook ad account ID",
43
+ },
44
+ original_request: {
45
+ type: DataTypes.JSONB,
46
+ allowNull: false,
47
+ field: "original_request",
48
+ comment: "Full campaignData from the original HTTP request",
49
+ },
50
+ facebook_payload: {
51
+ type: DataTypes.JSONB,
52
+ allowNull: false,
53
+ field: "facebook_payload",
54
+ comment:
55
+ "facebookCampaignData passed to createFullCampaignController",
56
+ },
57
+ feed_campaign_result: {
58
+ type: DataTypes.JSONB,
59
+ allowNull: true,
60
+ field: "feed_campaign_result",
61
+ comment:
62
+ "feedCampaign result (AGRS_CID, rac, urlTags, channelId, etc.)",
63
+ },
64
+ last_error: {
65
+ type: DataTypes.TEXT,
66
+ allowNull: true,
67
+ field: "last_error",
68
+ },
69
+ last_error_code: {
70
+ type: DataTypes.INTEGER,
71
+ allowNull: true,
72
+ field: "last_error_code",
73
+ },
74
+ is_transient: {
75
+ type: DataTypes.BOOLEAN,
76
+ allowNull: true,
77
+ field: "is_transient",
78
+ },
79
+ status: {
80
+ type: DataTypes.STRING(50),
81
+ allowNull: false,
82
+ defaultValue: "pending",
83
+ validate: {
84
+ isIn: [
85
+ ["pending", "processing", "completed", "failed", "abandoned"],
86
+ ],
87
+ },
88
+ },
89
+ retry_count: {
90
+ type: DataTypes.INTEGER,
91
+ allowNull: false,
92
+ defaultValue: 0,
93
+ field: "retry_count",
94
+ },
95
+ max_retries: {
96
+ type: DataTypes.INTEGER,
97
+ allowNull: false,
98
+ defaultValue: 5,
99
+ field: "max_retries",
100
+ },
101
+ next_retry_at: {
102
+ type: DataTypes.DATE,
103
+ allowNull: false,
104
+ field: "next_retry_at",
105
+ comment: "When the next retry should be attempted",
106
+ },
107
+ last_attempt_at: {
108
+ type: DataTypes.DATE,
109
+ allowNull: true,
110
+ field: "last_attempt_at",
111
+ },
112
+ completed_at: {
113
+ type: DataTypes.DATE,
114
+ allowNull: true,
115
+ field: "completed_at",
116
+ },
117
+ facebook_campaign_id: {
118
+ type: DataTypes.STRING(255),
119
+ allowNull: true,
120
+ field: "facebook_campaign_id",
121
+ comment: "Facebook campaign ID (populated on success)",
122
+ },
123
+ created_at: {
124
+ type: DataTypes.DATE,
125
+ allowNull: false,
126
+ defaultValue: DataTypes.NOW,
127
+ field: "created_at",
128
+ },
129
+ platform: {
130
+ type: DataTypes.ENUM("fb", "tt", "snp"),
131
+ allowNull: false,
132
+ defaultValue: "fb",
133
+ field: "platform",
134
+ comment: "Ad platform identifier: fb=Facebook, tt=TikTok, snp=Snapchat",
135
+ },
136
+ },
137
+ {
138
+ tableName: "facebook_retry_queue",
139
+ timestamps: false,
140
+ indexes: [
141
+ {
142
+ fields: ["status", "next_retry_at"],
143
+ name: "idx_fb_retry_status_next",
144
+ },
145
+ {
146
+ fields: ["process_id"],
147
+ },
148
+ {
149
+ fields: ["feed_provider"],
150
+ },
151
+ {
152
+ fields: ["created_at"],
153
+ },
154
+ ],
155
+ }
156
+ );
157
+
158
+ FacebookRetryQueue.associate = (models) => {
159
+ // No associations needed
160
+ };
161
+
162
+ return FacebookRetryQueue;
163
+ };
package/models/Feed.js CHANGED
@@ -1,34 +1,34 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const Feed = sequelize.define(
3
- "Feed",
4
- {
5
- id: {
6
- type: DataTypes.UUID,
7
- defaultValue: DataTypes.UUIDV4,
8
- primaryKey: true,
9
- },
10
- label: {
11
- type: DataTypes.STRING,
12
- allowNull: false,
13
- },
14
- code: {
15
- type: DataTypes.STRING,
16
- allowNull: false,
17
- unique: true,
18
- },
19
- sheet: {
20
- type: DataTypes.STRING,
21
- allowNull: false,
22
- },
23
- feedProvider: {
24
- type: DataTypes.STRING,
25
- allowNull: false,
26
- },
27
- },
28
- {
29
- tableName: "Feed",
30
- }
31
- );
32
-
33
- return Feed;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const Feed = sequelize.define(
3
+ "Feed",
4
+ {
5
+ id: {
6
+ type: DataTypes.UUID,
7
+ defaultValue: DataTypes.UUIDV4,
8
+ primaryKey: true,
9
+ },
10
+ label: {
11
+ type: DataTypes.STRING,
12
+ allowNull: false,
13
+ },
14
+ code: {
15
+ type: DataTypes.STRING,
16
+ allowNull: false,
17
+ unique: true,
18
+ },
19
+ sheet: {
20
+ type: DataTypes.STRING,
21
+ allowNull: false,
22
+ },
23
+ feedProvider: {
24
+ type: DataTypes.STRING,
25
+ allowNull: false,
26
+ },
27
+ },
28
+ {
29
+ tableName: "Feed",
30
+ }
31
+ );
32
+
33
+ return Feed;
34
34
  };
@@ -1,81 +1,81 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const FeedArticleConfiguration = sequelize.define(
3
- "FeedArticleConfiguration",
4
- {
5
- id: {
6
- type: DataTypes.INTEGER,
7
- primaryKey: true,
8
- autoIncrement: true,
9
- },
10
- feedProvider: {
11
- type: DataTypes.STRING(100),
12
- allowNull: false,
13
- unique: true,
14
- field: "feed_provider",
15
- },
16
- requiredFields: {
17
- type: DataTypes.JSONB,
18
- allowNull: false,
19
- defaultValue: [],
20
- field: "required_fields",
21
- comment: "Array of field configs: [{ name, description, allowedValues }]"
22
- },
23
- model: {
24
- type: DataTypes.STRING(50),
25
- allowNull: false,
26
- defaultValue: "gpt-4o-mini",
27
- comment: "OpenAI model to use for this feed"
28
- },
29
- temperature: {
30
- type: DataTypes.FLOAT,
31
- allowNull: false,
32
- defaultValue: 0.7,
33
- comment: "Temperature for AI generation (0.0-1.0)"
34
- },
35
- baseUrl: {
36
- type: DataTypes.STRING(500),
37
- allowNull: true,
38
- field: "base_url",
39
- },
40
- isActive: {
41
- type: DataTypes.BOOLEAN,
42
- allowNull: false,
43
- defaultValue: true,
44
- field: "is_active",
45
- },
46
- createdAt: {
47
- type: DataTypes.DATE,
48
- allowNull: false,
49
- defaultValue: DataTypes.NOW,
50
- field: "created_at",
51
- },
52
- updatedAt: {
53
- type: DataTypes.DATE,
54
- allowNull: false,
55
- defaultValue: DataTypes.NOW,
56
- field: "updated_at",
57
- },
58
- },
59
- {
60
- tableName: "feed_article_configurations",
61
- timestamps: true,
62
- createdAt: "created_at",
63
- updatedAt: "updated_at",
64
- indexes: [
65
- {
66
- unique: true,
67
- fields: ["feed_provider"],
68
- },
69
- {
70
- fields: ["is_active"],
71
- },
72
- ],
73
- }
74
- );
75
-
76
- FeedArticleConfiguration.associate = (models) => {
77
- // Future: Add associations if needed
78
- };
79
-
80
- return FeedArticleConfiguration;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const FeedArticleConfiguration = sequelize.define(
3
+ "FeedArticleConfiguration",
4
+ {
5
+ id: {
6
+ type: DataTypes.INTEGER,
7
+ primaryKey: true,
8
+ autoIncrement: true,
9
+ },
10
+ feedProvider: {
11
+ type: DataTypes.STRING(100),
12
+ allowNull: false,
13
+ unique: true,
14
+ field: "feed_provider",
15
+ },
16
+ requiredFields: {
17
+ type: DataTypes.JSONB,
18
+ allowNull: false,
19
+ defaultValue: [],
20
+ field: "required_fields",
21
+ comment: "Array of field configs: [{ name, description, allowedValues }]"
22
+ },
23
+ model: {
24
+ type: DataTypes.STRING(50),
25
+ allowNull: false,
26
+ defaultValue: "gpt-4o-mini",
27
+ comment: "OpenAI model to use for this feed"
28
+ },
29
+ temperature: {
30
+ type: DataTypes.FLOAT,
31
+ allowNull: false,
32
+ defaultValue: 0.7,
33
+ comment: "Temperature for AI generation (0.0-1.0)"
34
+ },
35
+ baseUrl: {
36
+ type: DataTypes.STRING(500),
37
+ allowNull: true,
38
+ field: "base_url",
39
+ },
40
+ isActive: {
41
+ type: DataTypes.BOOLEAN,
42
+ allowNull: false,
43
+ defaultValue: true,
44
+ field: "is_active",
45
+ },
46
+ createdAt: {
47
+ type: DataTypes.DATE,
48
+ allowNull: false,
49
+ defaultValue: DataTypes.NOW,
50
+ field: "created_at",
51
+ },
52
+ updatedAt: {
53
+ type: DataTypes.DATE,
54
+ allowNull: false,
55
+ defaultValue: DataTypes.NOW,
56
+ field: "updated_at",
57
+ },
58
+ },
59
+ {
60
+ tableName: "feed_article_configurations",
61
+ timestamps: true,
62
+ createdAt: "created_at",
63
+ updatedAt: "updated_at",
64
+ indexes: [
65
+ {
66
+ unique: true,
67
+ fields: ["feed_provider"],
68
+ },
69
+ {
70
+ fields: ["is_active"],
71
+ },
72
+ ],
73
+ }
74
+ );
75
+
76
+ FeedArticleConfiguration.associate = (models) => {
77
+ // Future: Add associations if needed
78
+ };
79
+
80
+ return FeedArticleConfiguration;
81
81
  };
@@ -1,60 +1,60 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const FrontStoryChannel = sequelize.define(
3
- "FrontStoryChannel",
4
- {
5
- channelId: {
6
- type: DataTypes.STRING,
7
- allowNull: false,
8
- // Not setting as primary key or unique since duplicates are allowed
9
- },
10
- channelName: {
11
- type: DataTypes.STRING,
12
- allowNull: true,
13
- comment: 'Human-readable name for the channel'
14
- },
15
- styleId: {
16
- type: DataTypes.STRING,
17
- allowNull: false,
18
- },
19
- status: {
20
- type: DataTypes.STRING,
21
- allowNull: false,
22
- defaultValue: "free",
23
- validate: {
24
- isIn: [["free", "used", "archived"]],
25
- },
26
- },
27
- connectedCampaigns: {
28
- type: DataTypes.JSONB, // Use JSONB for better querying capabilities
29
- allowNull: false,
30
- defaultValue: [],
31
- },
32
- },
33
- {
34
- tableName: "front_story_channels",
35
- timestamps: true,
36
- // indexes: [
37
- // // Add a composite unique index on channelId and styleId if needed
38
- // {
39
- // unique: true,
40
- // fields: ["channelId", "styleId"],
41
- // name: "unique_front_story_channel_style",
42
- // },
43
- // ],
44
- }
45
- );
46
-
47
- // Define associations without enforcing constraints
48
- FrontStoryChannel.associate = (models) => {
49
- if (models.RSOCFeedCampaign) {
50
- FrontStoryChannel.hasMany(models.RSOCFeedCampaign, {
51
- foreignKey: "channelId",
52
- sourceKey: "channelId",
53
- as: "RSOCFeedCampaigns",
54
- constraints: false, // Disable FK constraint
55
- });
56
- }
57
- };
58
-
59
- return FrontStoryChannel;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const FrontStoryChannel = sequelize.define(
3
+ "FrontStoryChannel",
4
+ {
5
+ channelId: {
6
+ type: DataTypes.STRING,
7
+ allowNull: false,
8
+ // Not setting as primary key or unique since duplicates are allowed
9
+ },
10
+ channelName: {
11
+ type: DataTypes.STRING,
12
+ allowNull: true,
13
+ comment: 'Human-readable name for the channel'
14
+ },
15
+ styleId: {
16
+ type: DataTypes.STRING,
17
+ allowNull: false,
18
+ },
19
+ status: {
20
+ type: DataTypes.STRING,
21
+ allowNull: false,
22
+ defaultValue: "free",
23
+ validate: {
24
+ isIn: [["free", "used", "archived"]],
25
+ },
26
+ },
27
+ connectedCampaigns: {
28
+ type: DataTypes.JSONB, // Use JSONB for better querying capabilities
29
+ allowNull: false,
30
+ defaultValue: [],
31
+ },
32
+ },
33
+ {
34
+ tableName: "front_story_channels",
35
+ timestamps: true,
36
+ // indexes: [
37
+ // // Add a composite unique index on channelId and styleId if needed
38
+ // {
39
+ // unique: true,
40
+ // fields: ["channelId", "styleId"],
41
+ // name: "unique_front_story_channel_style",
42
+ // },
43
+ // ],
44
+ }
45
+ );
46
+
47
+ // Define associations without enforcing constraints
48
+ FrontStoryChannel.associate = (models) => {
49
+ if (models.RSOCFeedCampaign) {
50
+ FrontStoryChannel.hasMany(models.RSOCFeedCampaign, {
51
+ foreignKey: "channelId",
52
+ sourceKey: "channelId",
53
+ as: "RSOCFeedCampaigns",
54
+ constraints: false, // Disable FK constraint
55
+ });
56
+ }
57
+ };
58
+
59
+ return FrontStoryChannel;
60
60
  };