diff --git a/packages/twenty-server/src/database/commands/0-20-update-message-channel-sync-status-enum.command.ts b/packages/twenty-server/src/database/commands/0-22-update-message-channel-sync-status-enum.command.ts similarity index 91% rename from packages/twenty-server/src/database/commands/0-20-update-message-channel-sync-status-enum.command.ts rename to packages/twenty-server/src/database/commands/0-22-update-message-channel-sync-status-enum.command.ts index 1a1e345ff232..d31a0fcd2e48 100644 --- a/packages/twenty-server/src/database/commands/0-20-update-message-channel-sync-status-enum.command.ts +++ b/packages/twenty-server/src/database/commands/0-22-update-message-channel-sync-status-enum.command.ts @@ -1,17 +1,17 @@ -import { InjectRepository } from '@nestjs/typeorm'; import { Logger } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import chalk from 'chalk'; import { Command, CommandRunner, Option } from 'nest-commander'; import { Repository } from 'typeorm'; -import chalk from 'chalk'; import { v4 } from 'uuid'; -import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service'; -import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; import { TypeORMService } from 'src/database/typeorm/typeorm.service'; +import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; +import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service'; import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { WorkspaceCacheVersionService } from 'src/engine/metadata-modules/workspace-cache-version/workspace-cache-version.service'; import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity'; +import { WorkspaceCacheVersionService } from 'src/engine/metadata-modules/workspace-cache-version/workspace-cache-version.service'; import { MessageChannelSyncStatus } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity'; interface UpdateMessageChannelSyncStatusEnumCommandOptions { @@ -19,7 +19,7 @@ interface UpdateMessageChannelSyncStatusEnumCommandOptions { } @Command({ - name: 'migrate-0.20:update-message-channel-sync-status-enum', + name: 'migrate-0.22:update-message-channel-sync-status-enum', description: 'Update messageChannel syncStatus', }) export class UpdateMessageChannelSyncStatusEnumCommand extends CommandRunner { @@ -94,9 +94,7 @@ export class UpdateMessageChannelSyncStatusEnumCommand extends CommandRunner { `ALTER TYPE "${dataSourceMetadata.schema}"."messageChannel_syncStatus_enum" RENAME TO "messageChannel_syncStatus_enum_old"`, ); await queryRunner.query( - `CREATE TYPE "${dataSourceMetadata.schema}"."messageChannel_syncStatus_enum" AS ENUM ('PENDING', - 'SUCCEEDED', - 'FAILED', + `CREATE TYPE "${dataSourceMetadata.schema}"."messageChannel_syncStatus_enum" AS ENUM ( 'ONGOING', 'NOT_SYNCED', 'COMPLETED', @@ -166,27 +164,6 @@ export class UpdateMessageChannelSyncStatusEnumCommand extends CommandRunner { } const newOptions = [ - { - id: v4(), - value: MessageChannelSyncStatus.PENDING, - label: 'Pending', - position: 0, - color: 'blue', - }, - { - id: v4(), - value: MessageChannelSyncStatus.SUCCEEDED, - label: 'Succeeded', - position: 2, - color: 'green', - }, - { - id: v4(), - value: MessageChannelSyncStatus.FAILED, - label: 'Failed', - position: 3, - color: 'red', - }, { id: v4(), value: MessageChannelSyncStatus.ONGOING, diff --git a/packages/twenty-server/src/database/commands/database-command.module.ts b/packages/twenty-server/src/database/commands/database-command.module.ts index 99e40ed5554a..2a5f649aa8af 100644 --- a/packages/twenty-server/src/database/commands/database-command.module.ts +++ b/packages/twenty-server/src/database/commands/database-command.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { UpdateMessageChannelSyncStatusEnumCommand } from 'src/database/commands/0-20-update-message-channel-sync-status-enum.command'; import { AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand } from 'src/database/commands/0-22-add-new-address-field-to-views-with-deprecated-address.command'; +import { UpdateMessageChannelSyncStatusEnumCommand } from 'src/database/commands/0-22-update-message-channel-sync-status-enum.command'; import { StartDataSeedDemoWorkspaceCronCommand } from 'src/database/commands/data-seed-demo-workspace/crons/start-data-seed-demo-workspace.cron.command'; import { StopDataSeedDemoWorkspaceCronCommand } from 'src/database/commands/data-seed-demo-workspace/crons/stop-data-seed-demo-workspace.cron.command'; import { DataSeedDemoWorkspaceCommand } from 'src/database/commands/data-seed-demo-workspace/data-seed-demo-workspace-command'; diff --git a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts index 682e367e4c0d..565e705095dc 100644 --- a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts +++ b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts @@ -5,26 +5,20 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { MESSAGE_CHANNEL_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; -import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity'; import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity'; import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator'; -import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator'; -import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator'; import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator'; +import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator'; import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator'; +import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator'; +import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator'; import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator'; +import { MESSAGE_CHANNEL_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity'; import { MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity'; -import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator'; export enum MessageChannelSyncStatus { - // TO BE DEPRECATED - PENDING = 'PENDING', - SUCCEEDED = 'SUCCEEDED', - FAILED = 'FAILED', - - // NEW STATUSES NOT_SYNCED = 'NOT_SYNCED', ONGOING = 'ONGOING', COMPLETED = 'COMPLETED', @@ -230,26 +224,6 @@ export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity { description: 'Sync status', icon: 'IconStatusChange', options: [ - // TO BE DEPRECATED: PENDING, SUCCEEDED, FAILED - { - value: MessageChannelSyncStatus.PENDING, - label: 'Pending', - position: 0, - color: 'blue', - }, - { - value: MessageChannelSyncStatus.SUCCEEDED, - label: 'Succeeded', - position: 2, - color: 'green', - }, - { - value: MessageChannelSyncStatus.FAILED, - label: 'Failed', - position: 3, - color: 'red', - }, - // NEW STATUSES { value: MessageChannelSyncStatus.ONGOING, label: 'Ongoing',