@@ -9,50 +9,6 @@ import {
9
9
10
10
import { Connector , sequelize_conn } from "@connectors/lib/models" ;
11
11
12
- export class IntercomConnectorState extends Model <
13
- InferAttributes < IntercomConnectorState > ,
14
- InferCreationAttributes < IntercomConnectorState >
15
- > {
16
- declare id : CreationOptional < number > ;
17
- declare createdAt : CreationOptional < Date > ;
18
- declare updatedAt : CreationOptional < Date > ;
19
-
20
- declare lastGarbageCollectionFinishTime ?: Date ;
21
-
22
- declare connectorId : ForeignKey < Connector [ "id" ] > ;
23
- }
24
-
25
- IntercomConnectorState . init (
26
- {
27
- id : {
28
- type : DataTypes . INTEGER ,
29
- autoIncrement : true ,
30
- primaryKey : true ,
31
- } ,
32
- createdAt : {
33
- type : DataTypes . DATE ,
34
- allowNull : false ,
35
- defaultValue : DataTypes . NOW ,
36
- } ,
37
- updatedAt : {
38
- type : DataTypes . DATE ,
39
- allowNull : false ,
40
- defaultValue : DataTypes . NOW ,
41
- } ,
42
- lastGarbageCollectionFinishTime : {
43
- type : DataTypes . DATE ,
44
- allowNull : true ,
45
- } ,
46
- } ,
47
- {
48
- sequelize : sequelize_conn ,
49
- modelName : "intercom_connector_states" ,
50
- indexes : [ { fields : [ "connectorId" ] , unique : true } ] ,
51
- }
52
- ) ;
53
-
54
- Connector . hasOne ( IntercomConnectorState ) ;
55
-
56
12
export class IntercomCollection extends Model <
57
13
InferAttributes < IntercomCollection > ,
58
14
InferCreationAttributes < IntercomCollection >
@@ -61,7 +17,7 @@ export class IntercomCollection extends Model<
61
17
declare createdAt : CreationOptional < Date > ;
62
18
declare updatedAt : CreationOptional < Date > ;
63
19
64
- declare workspaceId : string ;
20
+ declare intercomWorkspaceId : string ;
65
21
declare collectionId : string ;
66
22
67
23
declare helpCenterId : string | null ;
@@ -90,7 +46,7 @@ IntercomCollection.init(
90
46
allowNull : false ,
91
47
defaultValue : DataTypes . NOW ,
92
48
} ,
93
- workspaceId : {
49
+ intercomWorkspaceId : {
94
50
type : DataTypes . STRING ,
95
51
allowNull : false ,
96
52
} ,
@@ -118,7 +74,10 @@ IntercomCollection.init(
118
74
{
119
75
sequelize : sequelize_conn ,
120
76
indexes : [
121
- { fields : [ "workspaceId" , "collectionId" , "connectorId" ] , unique : true } ,
77
+ {
78
+ fields : [ "intercomWorkspaceId" , "collectionId" , "connectorId" ] ,
79
+ unique : true ,
80
+ } ,
122
81
{ fields : [ "connectorId" ] } ,
123
82
{ fields : [ "collectionId" ] } ,
124
83
] ,
@@ -135,7 +94,7 @@ export class IntercomArticle extends Model<
135
94
declare createdAt : CreationOptional < Date > ;
136
95
declare updatedAt : CreationOptional < Date > ;
137
96
138
- declare workspaceId : string ;
97
+ declare intercomWorkspaceId : string ;
139
98
declare articleId : string ;
140
99
declare authorId : string ;
141
100
@@ -164,7 +123,7 @@ IntercomArticle.init(
164
123
allowNull : false ,
165
124
defaultValue : DataTypes . NOW ,
166
125
} ,
167
- workspaceId : {
126
+ intercomWorkspaceId : {
168
127
type : DataTypes . STRING ,
169
128
allowNull : false ,
170
129
} ,
@@ -192,7 +151,10 @@ IntercomArticle.init(
192
151
{
193
152
sequelize : sequelize_conn ,
194
153
indexes : [
195
- { fields : [ "workspaceId" , "articleId" , "connectorId" ] , unique : true } ,
154
+ {
155
+ fields : [ "intercomWorkspaceId" , "articleId" , "connectorId" ] ,
156
+ unique : true ,
157
+ } ,
196
158
{ fields : [ "connectorId" ] } ,
197
159
{ fields : [ "articleId" ] } ,
198
160
] ,
0 commit comments