Skip to content

Commit

Permalink
Add missing commands to 0.22 (#6286)
Browse files Browse the repository at this point in the history
  • Loading branch information
Weiko authored Jul 16, 2024
1 parent 4a67cfa commit 8eb0215
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand } from 'src/database/commands/0-22-add-new-address-field-to-views-with-deprecated-address.command';
import { UpdateMessageChannelSyncStageEnumCommand } from 'src/database/commands/0-22-update-message-channel-sync-stage-enum.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';
import { DataSeedDemoWorkspaceModule } from 'src/database/commands/data-seed-demo-workspace/data-seed-demo-workspace.module';
import { DataSeedWorkspaceCommand } from 'src/database/commands/data-seed-dev-workspace.command';
import { ConfirmationQuestion } from 'src/database/commands/questions/confirmation.question';
import { UpdateMessageChannelVisibilityEnumCommand } from 'src/database/commands/update-message-channel-visibility-enum.command';
import { UpdateMessageChannelVisibilityEnumCommand } from 'src/database/commands/upgrade-version/0-20/0-20-update-message-channel-visibility-enum.command';
import { UpgradeTo0_22CommandModule } from 'src/database/commands/upgrade-version/0-22/0-22-upgrade-version.module';
import { WorkspaceAddTotalCountCommand } from 'src/database/commands/workspace-add-total-count.command';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
Expand Down Expand Up @@ -59,9 +56,6 @@ import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/worksp
StartDataSeedDemoWorkspaceCronCommand,
StopDataSeedDemoWorkspaceCronCommand,
UpdateMessageChannelVisibilityEnumCommand,
UpdateMessageChannelSyncStatusEnumCommand,
UpdateMessageChannelSyncStageEnumCommand,
AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand,
],
})
export class DatabaseCommandModule {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Command, CommandRunner, Option } from 'nest-commander';

import { AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand } from 'src/database/commands/upgrade-version/0-22/0-22-add-new-address-field-to-views-with-deprecated-address.command';
import { FixObjectMetadataIdStandardIdCommand } from 'src/database/commands/upgrade-version/0-22/0-22-fix-object-metadata-id-standard-id.command';
import { UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand } from 'src/database/commands/upgrade-version/0-22/0-22-update-boolean-fields-null-default-values-and-null-values.command';
import { UpdateMessageChannelSyncStageEnumCommand } from 'src/database/commands/upgrade-version/0-22/0-22-update-message-channel-sync-stage-enum.command';
import { UpdateMessageChannelSyncStatusEnumCommand } from 'src/database/commands/upgrade-version/0-22/0-22-update-message-channel-sync-status-enum.command';

interface UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommandOptions {
workspaceId?: string;
Expand All @@ -15,6 +18,9 @@ export class UpgradeTo0_22Command extends CommandRunner {
constructor(
private readonly fixObjectMetadataIdStandardIdCommand: FixObjectMetadataIdStandardIdCommand,
private readonly updateBooleanFieldsNullDefaultValuesAndNullValuesCommand: UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand,
private readonly addNewAddressFieldToViewsWithDeprecatedAddressFieldCommand: AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand,
private readonly updateMessageChannelSyncStatusEnumCommand: UpdateMessageChannelSyncStatusEnumCommand,
private readonly updateMessageChannelSyncStageEnumCommand: UpdateMessageChannelSyncStageEnumCommand,
) {
super();
}
Expand All @@ -37,5 +43,17 @@ export class UpgradeTo0_22Command extends CommandRunner {
_passedParam,
options,
);
await this.addNewAddressFieldToViewsWithDeprecatedAddressFieldCommand.run(
_passedParam,
options,
);
await this.updateMessageChannelSyncStatusEnumCommand.run(
_passedParam,
options,
);
await this.updateMessageChannelSyncStageEnumCommand.run(
_passedParam,
options,
);
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,55 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { DataSeedDemoWorkspaceModule } from 'src/database/commands/data-seed-demo-workspace/data-seed-demo-workspace.module';
import { AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand } from 'src/database/commands/upgrade-version/0-22/0-22-add-new-address-field-to-views-with-deprecated-address.command';
import { FixObjectMetadataIdStandardIdCommand } from 'src/database/commands/upgrade-version/0-22/0-22-fix-object-metadata-id-standard-id.command';
import { UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand } from 'src/database/commands/upgrade-version/0-22/0-22-update-boolean-fields-null-default-values-and-null-values.command';
import { UpdateMessageChannelSyncStageEnumCommand } from 'src/database/commands/upgrade-version/0-22/0-22-update-message-channel-sync-stage-enum.command';
import { UpdateMessageChannelSyncStatusEnumCommand } from 'src/database/commands/upgrade-version/0-22/0-22-update-message-channel-sync-status-enum.command';
import { UpgradeTo0_22Command } from 'src/database/commands/upgrade-version/0-22/0-22-upgrade-version.command';
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';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { WorkspaceModule } from 'src/engine/core-modules/workspace/workspace.module';
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 { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
import { ObjectMetadataModule } from 'src/engine/metadata-modules/object-metadata/object-metadata.module';
import { WorkspaceCacheVersionModule } from 'src/engine/metadata-modules/workspace-cache-version/workspace-cache-version.module';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
import { WorkspaceManagerModule } from 'src/engine/workspace-manager/workspace-manager.module';
import { WorkspaceStatusModule } from 'src/engine/workspace-manager/workspace-status/workspace-manager.module';
import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/workspace-sync-metadata/workspace-sync-metadata.module';

@Module({
imports: [
TypeOrmModule.forFeature([Workspace], 'core'),
WorkspaceCacheVersionModule,
TypeORMModule,
WorkspaceManagerModule,
DataSourceModule,
TypeORMModule,
TypeOrmModule.forFeature(
[Workspace, BillingSubscription, FeatureFlagEntity],
'core',
),
TypeOrmModule.forFeature(
[FieldMetadataEntity, ObjectMetadataEntity],
'metadata',
),
WorkspaceModule,
WorkspaceDataSourceModule,
WorkspaceSyncMetadataModule,
WorkspaceStatusModule,
ObjectMetadataModule,
DataSeedDemoWorkspaceModule,
WorkspaceCacheVersionModule,
],
providers: [
FixObjectMetadataIdStandardIdCommand,
UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand,
UpdateMessageChannelSyncStatusEnumCommand,
UpdateMessageChannelSyncStageEnumCommand,
AddNewAddressFieldToViewsWithDeprecatedAddressFieldCommand,
UpgradeTo0_22Command,
],
})
Expand Down

0 comments on commit 8eb0215

Please sign in to comment.