[messaging] rename syncExternalId to syncCursor (#4752)
## Context SyncExternalId should be renamed because this won't always represent an id. For example, microsoft API does not use ids but dates for their sync. Also we think external is a bit redundant so we are removing it. Note: this field is not used by the front-end (and will probably never be)
This commit is contained in:
@ -123,9 +123,9 @@ export class MessageChannelRepository {
|
||||
);
|
||||
}
|
||||
|
||||
public async updateLastSyncExternalIdIfHigher(
|
||||
public async updateLastSyncCursorIfHigher(
|
||||
id: string,
|
||||
syncExternalId: string,
|
||||
syncCursor: string,
|
||||
workspaceId: string,
|
||||
transactionManager?: EntityManager,
|
||||
) {
|
||||
@ -133,16 +133,16 @@ export class MessageChannelRepository {
|
||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||
|
||||
await this.workspaceDataSourceService.executeRawQuery(
|
||||
`UPDATE ${dataSourceSchema}."messageChannel" SET "syncExternalId" = $1
|
||||
`UPDATE ${dataSourceSchema}."messageChannel" SET "syncCursor" = $1
|
||||
WHERE "id" = $2
|
||||
AND ("syncExternalId" < $1 OR "syncExternalId" = '')`,
|
||||
[syncExternalId, id],
|
||||
AND ("syncCursor" < $1 OR "syncCursor" = '')`,
|
||||
[syncCursor, id],
|
||||
workspaceId,
|
||||
transactionManager,
|
||||
);
|
||||
}
|
||||
|
||||
public async resetSyncExternalId(
|
||||
public async resetSyncCursor(
|
||||
id: string,
|
||||
workspaceId: string,
|
||||
transactionManager?: EntityManager,
|
||||
@ -151,7 +151,7 @@ export class MessageChannelRepository {
|
||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||
|
||||
await this.workspaceDataSourceService.executeRawQuery(
|
||||
`UPDATE ${dataSourceSchema}."messageChannel" SET "syncExternalId" = ''
|
||||
`UPDATE ${dataSourceSchema}."messageChannel" SET "syncCursor" = ''
|
||||
WHERE "id" = $1`,
|
||||
[id],
|
||||
workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user