Fix migration file (#15168)

as title
This commit is contained in:
martmull
2025-10-17 13:16:23 +02:00
committed by GitHub
parent 91b54e7e68
commit bc336a9fdc
5 changed files with 3379 additions and 3277 deletions
@@ -13,6 +13,9 @@ import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadat
import { WorkspaceMigrationModule } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.module';
import { WorkspaceSchemaManagerModule } from 'src/engine/twenty-orm/workspace-schema-manager/workspace-schema-manager.module';
import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.module';
import { FillNullServerlessFunctionLayerIdCommand } from 'src/database/commands/upgrade-version-command/1-8/1-8-fill-null-serverless-function-layer-id.command';
import { ServerlessFunctionEntity } from 'src/engine/metadata-modules/serverless-function/serverless-function.entity';
import { ServerlessFunctionLayerEntity } from 'src/engine/metadata-modules/serverless-function-layer/serverless-function-layer.entity';
@Module({
imports: [
@@ -21,6 +24,8 @@ import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/wor
FieldMetadataEntity,
ObjectMetadataEntity,
IndexMetadataEntity,
ServerlessFunctionEntity,
ServerlessFunctionLayerEntity,
]),
IndexMetadataModule,
WorkspaceMigrationRunnerModule,
@@ -31,12 +36,14 @@ import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/wor
MigrateWorkflowStepFilterOperandValueCommand,
MigrateChannelSyncStagesCommand,
DeduplicateUniqueFieldsCommand,
FillNullServerlessFunctionLayerIdCommand,
RegeneratePersonSearchVectorWithPhonesCommand,
],
exports: [
MigrateChannelSyncStagesCommand,
MigrateWorkflowStepFilterOperandValueCommand,
DeduplicateUniqueFieldsCommand,
FillNullServerlessFunctionLayerIdCommand,
RegeneratePersonSearchVectorWithPhonesCommand,
],
})
@@ -37,6 +37,7 @@ import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twent
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
import { SyncWorkspaceMetadataCommand } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command';
import { FillNullServerlessFunctionLayerIdCommand } from 'src/database/commands/upgrade-version-command/1-8/1-8-fill-null-serverless-function-layer-id.command';
@Command({
name: 'upgrade',
@@ -93,6 +94,7 @@ export class UpgradeCommand extends UpgradeCommandRunner {
protected readonly deduplicateUniqueFieldsCommand: DeduplicateUniqueFieldsCommand,
protected readonly regeneratePersonSearchVectorWithPhonesCommand: RegeneratePersonSearchVectorWithPhonesCommand,
protected readonly migrateChannelSyncStagesCommand: MigrateChannelSyncStagesCommand,
protected readonly fillNullServerlessFunctionLayerIdCommand: FillNullServerlessFunctionLayerIdCommand,
) {
super(
workspaceRepository,
@@ -192,6 +194,7 @@ export class UpgradeCommand extends UpgradeCommandRunner {
this.deduplicateUniqueFieldsCommand,
this.regeneratePersonSearchVectorWithPhonesCommand,
this.migrateChannelSyncStagesCommand,
this.fillNullServerlessFunctionLayerIdCommand,
],
afterSyncMetadata: [],
};
@@ -72,7 +72,8 @@ export class ServerlessFunctionEntity
@Column({ nullable: true, type: 'text' })
checksum: string | null;
@Column({ nullable: false, type: 'uuid' })
// TODO: should be set to nullable: false when 1.8 released in production
@Column({ nullable: true, type: 'uuid' })
serverlessFunctionLayerId: string;
@ManyToOne(