[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:
Weiko
2024-04-02 18:18:43 +02:00
committed by GitHub
parent 9364a58477
commit 35ddb9acb5
5 changed files with 18 additions and 18 deletions

View File

@ -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,