Remove old message channel sync statuses and create migration command (#6177)

Remove old message channel sync statuses and create migration command

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
bosiraphael
2024-07-12 18:36:42 +02:00
committed by GitHub
parent 1dff5bf957
commit 52aa9abd73
3 changed files with 16 additions and 65 deletions

View File

@ -5,26 +5,20 @@ import {
RelationMetadataType,
RelationOnDeleteAction,
} from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity';
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.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 { 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 { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
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',