RICH_TEXT_V2 upgrade command (#10094)
Adds two migration commands: - copy note and task `body` data to `bodyV2` - hide `body` view field and swap position with `bodyV2` view field Related to issue https://github.com/twentyhq/twenty/issues/7613 --------- Co-authored-by: ad-elias <elias@autodiligence.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -0,0 +1,187 @@
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import chalk from 'chalk';
|
||||
import { Command } from 'nest-commander';
|
||||
import { In, Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
ActiveWorkspacesCommandOptions,
|
||||
ActiveWorkspacesCommandRunner,
|
||||
} from 'src/database/commands/active-workspaces.command';
|
||||
import { isCommandLogger } from 'src/database/commands/logger';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { WorkspaceMetadataVersionService } from 'src/engine/metadata-modules/workspace-metadata-version/services/workspace-metadata-version.service';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
import { ViewFieldWorkspaceEntity } from 'src/modules/view/standard-objects/view-field.workspace-entity';
|
||||
import { ViewWorkspaceEntity } from 'src/modules/view/standard-objects/view.workspace-entity';
|
||||
|
||||
@Command({
|
||||
name: 'upgrade-0.42:fix-body-v2-view-field-position',
|
||||
description: 'Make bodyV2 field position to match body field position',
|
||||
})
|
||||
export class FixBodyV2ViewFieldPositionCommand extends ActiveWorkspacesCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@InjectRepository(ObjectMetadataEntity, 'metadata')
|
||||
private readonly objectMetadataRepository: Repository<ObjectMetadataEntity>,
|
||||
private readonly twentyORMGlobalManager: TwentyORMGlobalManager,
|
||||
private readonly workspaceMetadataVersionService: WorkspaceMetadataVersionService,
|
||||
) {
|
||||
super(workspaceRepository);
|
||||
}
|
||||
|
||||
async executeActiveWorkspacesCommand(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log('Running command to fix bodyV2 field position');
|
||||
|
||||
if (isCommandLogger(this.logger)) {
|
||||
this.logger.setVerbose(options.verbose ?? false);
|
||||
}
|
||||
|
||||
try {
|
||||
for (const [index, workspaceId] of workspaceIds.entries()) {
|
||||
await this.processWorkspace(workspaceId, index, workspaceIds.length);
|
||||
}
|
||||
|
||||
this.logger.log(chalk.green('Command completed!'));
|
||||
} catch (error) {
|
||||
this.logger.log(chalk.red('Error executing command'));
|
||||
}
|
||||
}
|
||||
|
||||
private async processWorkspace(
|
||||
workspaceId: string,
|
||||
index: number,
|
||||
total: number,
|
||||
): Promise<void> {
|
||||
try {
|
||||
this.logger.log(
|
||||
`Running command for workspace ${workspaceId} ${index + 1}/${total}`,
|
||||
);
|
||||
|
||||
const viewRepository =
|
||||
await this.twentyORMGlobalManager.getRepositoryForWorkspace<ViewWorkspaceEntity>(
|
||||
workspaceId,
|
||||
'view',
|
||||
);
|
||||
|
||||
const viewFieldRepository =
|
||||
await this.twentyORMGlobalManager.getRepositoryForWorkspace<ViewFieldWorkspaceEntity>(
|
||||
workspaceId,
|
||||
'viewField',
|
||||
false,
|
||||
);
|
||||
|
||||
const taskAndNoteObjectMetadatas =
|
||||
await this.objectMetadataRepository.find({
|
||||
where: {
|
||||
workspaceId,
|
||||
nameSingular: In(['note', 'task']),
|
||||
},
|
||||
relations: ['fields'],
|
||||
});
|
||||
|
||||
const taskAndNoteViews = await viewRepository.find({
|
||||
where: {
|
||||
objectMetadataId: In(
|
||||
taskAndNoteObjectMetadatas.map((object) => object.id),
|
||||
),
|
||||
},
|
||||
});
|
||||
|
||||
const fieldMetadatas = taskAndNoteObjectMetadatas.flatMap(
|
||||
(objectMetadata) => objectMetadata.fields,
|
||||
);
|
||||
|
||||
const fieldNameByMetadataId: Record<string, string> =
|
||||
fieldMetadatas.reduce(
|
||||
(fieldNameByMetadataId, fieldMetadata) => ({
|
||||
...fieldNameByMetadataId,
|
||||
[fieldMetadata.id]: fieldMetadata.name,
|
||||
}),
|
||||
{},
|
||||
);
|
||||
|
||||
for (const view of taskAndNoteViews) {
|
||||
this.logger.log(
|
||||
`Updating bodyV2 field position for view ${view.id} - ${view.name}`,
|
||||
);
|
||||
const viewFields = await viewFieldRepository.find({
|
||||
where: {
|
||||
viewId: view.id,
|
||||
},
|
||||
});
|
||||
|
||||
const bodyViewField = viewFields.find(
|
||||
(viewField) =>
|
||||
fieldNameByMetadataId[viewField.fieldMetadataId] === 'body',
|
||||
);
|
||||
const bodyV2ViewField = viewFields.find(
|
||||
(viewField) =>
|
||||
fieldNameByMetadataId[viewField.fieldMetadataId] === 'bodyV2',
|
||||
);
|
||||
|
||||
if (bodyViewField && bodyV2ViewField) {
|
||||
this.logger.log(
|
||||
`Setting body field position to ${bodyV2ViewField?.position} and bodyV2 field position to ${bodyViewField?.position}`,
|
||||
);
|
||||
|
||||
await viewFieldRepository.update(
|
||||
{ id: bodyViewField.id },
|
||||
{
|
||||
position: bodyV2ViewField.position,
|
||||
isVisible: false,
|
||||
},
|
||||
);
|
||||
await viewFieldRepository.update(
|
||||
{ id: bodyV2ViewField.id },
|
||||
{
|
||||
position: bodyViewField.position,
|
||||
isVisible: bodyViewField.isVisible,
|
||||
},
|
||||
);
|
||||
} else if (bodyViewField && !bodyV2ViewField) {
|
||||
this.logger.log(
|
||||
`Creating bodyV2 view field for view ${view.id} with position ${viewFields.length}`,
|
||||
);
|
||||
|
||||
const bodyV2FieldMetadataId = fieldMetadatas.find(
|
||||
(field) => field.name === 'bodyV2',
|
||||
)?.id;
|
||||
|
||||
await viewFieldRepository.create({
|
||||
fieldMetadataId: bodyV2FieldMetadataId,
|
||||
viewId: view.id,
|
||||
position: bodyViewField.position,
|
||||
isVisible: bodyViewField.isVisible,
|
||||
size: bodyViewField.size,
|
||||
aggregateOperation: bodyViewField.aggregateOperation,
|
||||
});
|
||||
|
||||
await viewFieldRepository.update(
|
||||
{ id: bodyViewField.id },
|
||||
{
|
||||
position: viewFields.length,
|
||||
isVisible: false,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await this.workspaceMetadataVersionService.incrementMetadataVersion(
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
this.logger.log(
|
||||
chalk.green(`Command completed for workspace ${workspaceId}`),
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.log(chalk.red(`Error in workspace ${workspaceId}`));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,251 @@
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import { ServerBlockNoteEditor } from '@blocknote/server-util';
|
||||
import chalk from 'chalk';
|
||||
import { Command } from 'nest-commander';
|
||||
import { FieldMetadataType } from 'twenty-shared';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import {
|
||||
ActiveWorkspacesCommandOptions,
|
||||
ActiveWorkspacesCommandRunner,
|
||||
} from 'src/database/commands/active-workspaces.command';
|
||||
import { isCommandLogger } from 'src/database/commands/logger';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { WorkspaceMetadataVersionService } from 'src/engine/metadata-modules/workspace-metadata-version/services/workspace-metadata-version.service';
|
||||
import { generateMigrationName } from 'src/engine/metadata-modules/workspace-migration/utils/generate-migration-name.util';
|
||||
import {
|
||||
WorkspaceMigrationColumnActionType,
|
||||
WorkspaceMigrationColumnCreate,
|
||||
WorkspaceMigrationTableAction,
|
||||
WorkspaceMigrationTableActionType,
|
||||
} from 'src/engine/metadata-modules/workspace-migration/workspace-migration.entity';
|
||||
import { WorkspaceMigrationService } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.service';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
||||
import { computeTableName } from 'src/engine/utils/compute-table-name.util';
|
||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||
import { WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.service';
|
||||
|
||||
@Command({
|
||||
name: 'upgrade-0.42:migrate-rich-text-field',
|
||||
description: 'Migrate RICH_TEXT fields to new composite structure',
|
||||
})
|
||||
export class MigrateRichTextFieldCommand extends ActiveWorkspacesCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
@InjectRepository(FieldMetadataEntity, 'metadata')
|
||||
private readonly fieldMetadataRepository: Repository<FieldMetadataEntity>,
|
||||
@InjectRepository(ObjectMetadataEntity, 'metadata')
|
||||
private readonly objectMetadataRepository: Repository<ObjectMetadataEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
protected readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||
private readonly twentyORMGlobalManager: TwentyORMGlobalManager,
|
||||
private readonly workspaceMigrationService: WorkspaceMigrationService,
|
||||
private readonly workspaceMigrationRunnerService: WorkspaceMigrationRunnerService,
|
||||
private readonly workspaceMetadataVersionService: WorkspaceMetadataVersionService,
|
||||
) {
|
||||
super(workspaceRepository);
|
||||
}
|
||||
|
||||
async executeActiveWorkspacesCommand(
|
||||
_passedParam: string[],
|
||||
options: ActiveWorkspacesCommandOptions,
|
||||
workspaceIds: string[],
|
||||
): Promise<void> {
|
||||
this.logger.log(
|
||||
'Running command to migrate RICH_TEXT fields to new composite structure',
|
||||
);
|
||||
|
||||
if (isCommandLogger(this.logger)) {
|
||||
this.logger.setVerbose(options.verbose ?? false);
|
||||
}
|
||||
|
||||
try {
|
||||
for (const [index, workspaceId] of workspaceIds.entries()) {
|
||||
await this.processWorkspace(workspaceId, index, workspaceIds.length);
|
||||
}
|
||||
|
||||
this.logger.log(chalk.green('Command completed!'));
|
||||
} catch (error) {
|
||||
this.logger.log(chalk.red('Error in workspace'));
|
||||
}
|
||||
}
|
||||
|
||||
private async processWorkspace(
|
||||
workspaceId: string,
|
||||
index: number,
|
||||
total: number,
|
||||
): Promise<void> {
|
||||
try {
|
||||
this.logger.log(
|
||||
`Running command for workspace ${workspaceId} ${index + 1}/${total}`,
|
||||
);
|
||||
|
||||
const richTextFields = await this.fieldMetadataRepository.find({
|
||||
where: {
|
||||
workspaceId,
|
||||
type: FieldMetadataType.RICH_TEXT,
|
||||
},
|
||||
});
|
||||
|
||||
if (!richTextFields.length) {
|
||||
this.logger.log(
|
||||
chalk.yellow('No RICH_TEXT fields found in this workspace'),
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.log(`Found ${richTextFields.length} RICH_TEXT fields`);
|
||||
|
||||
for (const richTextField of richTextFields) {
|
||||
await this.processRichTextField(richTextField, workspaceId);
|
||||
}
|
||||
|
||||
await this.workspaceMigrationRunnerService.executeMigrationFromPendingMigrations(
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
await this.workspaceMetadataVersionService.incrementMetadataVersion(
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
await this.migrateRichTextContent(richTextFields, workspaceId);
|
||||
|
||||
await this.enableRichTextV2FeatureFlag(workspaceId);
|
||||
|
||||
this.logger.log(
|
||||
chalk.green(`Command completed for workspace ${workspaceId}`),
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.log(chalk.red(`Error in workspace ${workspaceId}: ${error}`));
|
||||
}
|
||||
}
|
||||
|
||||
private async enableRichTextV2FeatureFlag(
|
||||
workspaceId: string,
|
||||
): Promise<void> {
|
||||
await this.featureFlagRepository.upsert(
|
||||
{
|
||||
workspaceId,
|
||||
key: FeatureFlagKey.IsRichTextV2Enabled,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
conflictPaths: ['workspaceId', 'key'],
|
||||
skipUpdateIfNoValuesChanged: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
private async processRichTextField(
|
||||
richTextField: FieldMetadataEntity,
|
||||
workspaceId: string,
|
||||
) {
|
||||
const newRichTextField: Partial<FieldMetadataEntity> = {
|
||||
...richTextField,
|
||||
name: `${richTextField.name}V2`,
|
||||
id: undefined,
|
||||
type: FieldMetadataType.RICH_TEXT_V2,
|
||||
defaultValue: null,
|
||||
};
|
||||
|
||||
await this.fieldMetadataRepository.insert(newRichTextField);
|
||||
|
||||
const objectMetadata = await this.objectMetadataRepository.findOne({
|
||||
where: { id: richTextField.objectMetadataId },
|
||||
});
|
||||
|
||||
if (objectMetadata === null) {
|
||||
this.logger.log(
|
||||
`Object metadata not found for rich text field ${richTextField.name} in workspace ${workspaceId}`,
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
await this.workspaceMigrationService.createCustomMigration(
|
||||
generateMigrationName(
|
||||
`migrate-rich-text-field-${objectMetadata.nameSingular}-${richTextField.name}`,
|
||||
),
|
||||
workspaceId,
|
||||
[
|
||||
{
|
||||
name: computeObjectTargetTable(objectMetadata),
|
||||
action: WorkspaceMigrationTableActionType.ALTER,
|
||||
columns: [
|
||||
{
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: `${richTextField.name}V2Blocknote`,
|
||||
columnType: 'text',
|
||||
isNullable: true,
|
||||
defaultValue: null,
|
||||
} satisfies WorkspaceMigrationColumnCreate,
|
||||
{
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: `${richTextField.name}V2Markdown`,
|
||||
columnType: 'text',
|
||||
isNullable: true,
|
||||
defaultValue: null,
|
||||
} satisfies WorkspaceMigrationColumnCreate,
|
||||
],
|
||||
} satisfies WorkspaceMigrationTableAction,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
private async migrateRichTextContent(
|
||||
richTextFields: FieldMetadataEntity[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
const serverBlockNoteEditor = ServerBlockNoteEditor.create();
|
||||
|
||||
for (const richTextField of richTextFields) {
|
||||
const objectMetadata = await this.objectMetadataRepository.findOne({
|
||||
where: { id: richTextField.objectMetadataId },
|
||||
});
|
||||
|
||||
if (objectMetadata === null) {
|
||||
this.logger.log(
|
||||
`Object metadata not found for rich text field ${richTextField.name} in workspace ${workspaceId}`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
const schemaName =
|
||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||
|
||||
const workspaceDataSource =
|
||||
await this.twentyORMGlobalManager.getDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
const rows = await workspaceDataSource.query(
|
||||
`SELECT id, "${richTextField.name}" FROM "${schemaName}"."${computeTableName(objectMetadata.nameSingular, objectMetadata.isCustom)}"`,
|
||||
);
|
||||
|
||||
this.logger.log(`Generating markdown for ${rows.length} records`);
|
||||
|
||||
for (const row of rows) {
|
||||
const blocknoteFieldValue = row[richTextField.name];
|
||||
const markdownFieldValue = blocknoteFieldValue
|
||||
? await serverBlockNoteEditor.blocksToMarkdownLossy(
|
||||
JSON.parse(blocknoteFieldValue),
|
||||
)
|
||||
: null;
|
||||
|
||||
await workspaceDataSource.query(
|
||||
`UPDATE "${schemaName}"."${computeTableName(objectMetadata.nameSingular, objectMetadata.isCustom)}" SET "${richTextField.name}V2Blocknote" = $1, "${richTextField.name}V2Markdown" = $2 WHERE id = $3`,
|
||||
[blocknoteFieldValue, markdownFieldValue, row.id],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,9 @@ import { Repository } from 'typeorm';
|
||||
|
||||
import { ActiveWorkspacesCommandRunner } from 'src/database/commands/active-workspaces.command';
|
||||
import { BaseCommandOptions } from 'src/database/commands/base.command';
|
||||
import { FixBodyV2ViewFieldPositionCommand } from 'src/database/commands/upgrade-version/0-42/0-42-fix-body-v2-view-field-position.command';
|
||||
import { LimitAmountOfViewFieldCommand } from 'src/database/commands/upgrade-version/0-42/0-42-limit-amount-of-view-field';
|
||||
import { MigrateRichTextFieldCommand } from 'src/database/commands/upgrade-version/0-42/0-42-migrate-rich-text-field.command';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Command({
|
||||
@ -16,6 +18,8 @@ export class UpgradeTo0_42Command extends ActiveWorkspacesCommandRunner {
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
protected readonly workspaceRepository: Repository<Workspace>,
|
||||
private readonly migrateRichTextFieldCommand: MigrateRichTextFieldCommand,
|
||||
private readonly fixBodyV2ViewFieldPositionCommand: FixBodyV2ViewFieldPositionCommand,
|
||||
private readonly limitAmountOfViewFieldCommand: LimitAmountOfViewFieldCommand,
|
||||
) {
|
||||
super(workspaceRepository);
|
||||
@ -28,6 +32,18 @@ export class UpgradeTo0_42Command extends ActiveWorkspacesCommandRunner {
|
||||
): Promise<void> {
|
||||
this.logger.log('Running command to upgrade to 0.42');
|
||||
|
||||
await this.migrateRichTextFieldCommand.executeActiveWorkspacesCommand(
|
||||
passedParam,
|
||||
options,
|
||||
workspaceIds,
|
||||
);
|
||||
|
||||
await this.fixBodyV2ViewFieldPositionCommand.executeActiveWorkspacesCommand(
|
||||
passedParam,
|
||||
options,
|
||||
workspaceIds,
|
||||
);
|
||||
|
||||
await this.limitAmountOfViewFieldCommand.executeActiveWorkspacesCommand(
|
||||
passedParam,
|
||||
options,
|
||||
|
||||
@ -1,36 +1,37 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FixBodyV2ViewFieldPositionCommand } from 'src/database/commands/upgrade-version/0-42/0-42-fix-body-v2-view-field-position.command';
|
||||
import { LimitAmountOfViewFieldCommand } from 'src/database/commands/upgrade-version/0-42/0-42-limit-amount-of-view-field';
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { MigrateRichTextFieldCommand } from 'src/database/commands/upgrade-version/0-42/0-42-migrate-rich-text-field.command';
|
||||
import { UpgradeTo0_42Command } from 'src/database/commands/upgrade-version/0-42/0-42-upgrade-version.command';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { DataSourceModule } from 'src/engine/metadata-modules/data-source/data-source.module';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { ObjectMetadataModule } from 'src/engine/metadata-modules/object-metadata/object-metadata.module';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { WorkspaceMetadataVersionModule } from 'src/engine/metadata-modules/workspace-metadata-version/workspace-metadata-version.module';
|
||||
import { WorkspaceMigrationModule } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.module';
|
||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||
import { WorkspaceHealthModule } from 'src/engine/workspace-manager/workspace-health/workspace-health.module';
|
||||
import { SyncWorkspaceLoggerService } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/services/sync-workspace-logger.service';
|
||||
import { SyncWorkspaceMetadataCommand } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command';
|
||||
import { WorkspaceSyncMetadataCommandsModule } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/workspace-sync-metadata-commands.module';
|
||||
import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.module';
|
||||
import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([Workspace], 'core'),
|
||||
TypeOrmModule.forFeature([FieldMetadataEntity], 'metadata'),
|
||||
TypeORMModule,
|
||||
DataSourceModule,
|
||||
ObjectMetadataModule,
|
||||
WorkspaceSyncMetadataCommandsModule,
|
||||
WorkspaceSyncMetadataModule,
|
||||
WorkspaceHealthModule,
|
||||
WorkspaceDataSourceModule,
|
||||
TypeOrmModule.forFeature([Workspace, FeatureFlag], 'core'),
|
||||
TypeOrmModule.forFeature(
|
||||
[ObjectMetadataEntity, FieldMetadataEntity],
|
||||
'metadata',
|
||||
),
|
||||
WorkspaceMigrationRunnerModule,
|
||||
WorkspaceMigrationModule,
|
||||
WorkspaceMetadataVersionModule,
|
||||
WorkspaceDataSourceModule,
|
||||
FeatureFlagModule,
|
||||
],
|
||||
providers: [
|
||||
SyncWorkspaceLoggerService,
|
||||
SyncWorkspaceMetadataCommand,
|
||||
UpgradeTo0_42Command,
|
||||
MigrateRichTextFieldCommand,
|
||||
FixBodyV2ViewFieldPositionCommand,
|
||||
LimitAmountOfViewFieldCommand,
|
||||
],
|
||||
})
|
||||
|
||||
@ -7,7 +7,7 @@ import { DEV_SEED_WORKSPACE_MEMBER_IDS } from 'src/database/typeorm-seeds/worksp
|
||||
const tableName = 'opportunity';
|
||||
|
||||
export const DEV_SEED_OPPORTUNITY_IDS = {
|
||||
OPPORTUNITY_1: '20202020-be10-412b-a663-16bd3c2228e1',
|
||||
OPPORTUNITY_1: '20202020-be10-422b-a663-16bd3c2228e1',
|
||||
OPPORTUNITY_2: '20202020-0543-4cc2-9f96-95cc699960f2',
|
||||
OPPORTUNITY_3: '20202020-2f89-406f-90ea-180f433b2445',
|
||||
OPPORTUNITY_4: '20202020-35b1-4045-9cde-42f715148954',
|
||||
|
||||
Reference in New Issue
Block a user