Skip to content

Commit

Permalink
rename 0.40 commands to 0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
Weiko committed Dec 20, 2024
1 parent fefe737 commit af00a13
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { UpgradeTo0_32CommandModule } from 'src/database/commands/upgrade-versio
import { UpgradeTo0_33CommandModule } from 'src/database/commands/upgrade-version/0-33/0-33-upgrade-version.module';
import { UpgradeTo0_34CommandModule } from 'src/database/commands/upgrade-version/0-34/0-34-upgrade-version.module';
import { UpgradeTo0_35CommandModule } from 'src/database/commands/upgrade-version/0-35/0-35-upgrade-version.module';
import { UpgradeTo0_40CommandModule } from 'src/database/commands/upgrade-version/0-40/0-40-upgrade-version.module';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
Expand Down Expand Up @@ -54,7 +53,6 @@ import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/worksp
UpgradeTo0_33CommandModule,
UpgradeTo0_34CommandModule,
UpgradeTo0_35CommandModule,
UpgradeTo0_40CommandModule,
FeatureFlagModule,
],
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const isCallingCode = (callingCode: string): boolean => {
};

@Command({
name: 'upgrade-0.40:phone-calling-code-migrate-data',
name: 'upgrade-0.35:phone-calling-code-migrate-data',
description: 'Add calling code and change country code with default one',
})
export class PhoneCallingCodeMigrateDataCommand extends ActiveWorkspacesCommandRunner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Repository } from 'typeorm';
import { ActiveWorkspacesCommandRunner } from 'src/database/commands/active-workspaces.command';
import { BaseCommandOptions } from 'src/database/commands/base.command';
import { PhoneCallingCodeCreateColumnCommand } from 'src/database/commands/upgrade-version/0-35/0-35-phone-calling-code-create-column.command';
import { PhoneCallingCodeMigrateDataCommand } from 'src/database/commands/upgrade-version/0-35/0-35-phone-calling-code-migrate-data.command';
import { RecordPositionBackfillCommand } from 'src/database/commands/upgrade-version/0-35/0-35-record-position-backfill.command';
import { ViewGroupNoValueBackfillCommand } from 'src/database/commands/upgrade-version/0-35/0-35-view-group-no-value-backfill.command';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
Expand All @@ -21,6 +22,7 @@ export class UpgradeTo0_35Command extends ActiveWorkspacesCommandRunner {
protected readonly workspaceRepository: Repository<Workspace>,
private readonly viewGroupNoValueBackfillCommand: ViewGroupNoValueBackfillCommand,
private readonly syncWorkspaceMetadataCommand: SyncWorkspaceMetadataCommand,
private readonly phoneCallingCodeMigrateDataCommand: PhoneCallingCodeMigrateDataCommand,
private readonly phoneCallingCodeCreateColumnCommand: PhoneCallingCodeCreateColumnCommand,
private readonly recordPositionBackfillCommand: RecordPositionBackfillCommand,
) {
Expand All @@ -32,6 +34,10 @@ export class UpgradeTo0_35Command extends ActiveWorkspacesCommandRunner {
options: BaseCommandOptions,
workspaceIds: string[],
): Promise<void> {
this.logger.log(
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail',
);

await this.recordPositionBackfillCommand.executeActiveWorkspacesCommand(
passedParam,
options,
Expand All @@ -44,6 +50,12 @@ export class UpgradeTo0_35Command extends ActiveWorkspacesCommandRunner {
workspaceIds,
);

await this.phoneCallingCodeMigrateDataCommand.executeActiveWorkspacesCommand(
passedParam,
options,
workspaceIds,
);

await this.viewGroupNoValueBackfillCommand.executeActiveWorkspacesCommand(
passedParam,
options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { PhoneCallingCodeCreateColumnCommand } from 'src/database/commands/upgrade-version/0-35/0-35-phone-calling-code-create-column.command';
import { PhoneCallingCodeMigrateDataCommand } from 'src/database/commands/upgrade-version/0-35/0-35-phone-calling-code-migrate-data.command';
import { RecordPositionBackfillCommand } from 'src/database/commands/upgrade-version/0-35/0-35-record-position-backfill.command';
import { UpgradeTo0_35Command } from 'src/database/commands/upgrade-version/0-35/0-35-upgrade-version.command';
import { ViewGroupNoValueBackfillCommand } from 'src/database/commands/upgrade-version/0-35/0-35-view-group-no-value-backfill.command';
Expand Down Expand Up @@ -36,6 +37,7 @@ import { WorkspaceSyncMetadataCommandsModule } from 'src/engine/workspace-manage
providers: [
UpgradeTo0_35Command,
PhoneCallingCodeCreateColumnCommand,
PhoneCallingCodeMigrateDataCommand,
WorkspaceMigrationFactory,
RecordPositionBackfillCommand,
ViewGroupNoValueBackfillCommand,
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit af00a13

Please sign in to comment.