Revert "Convert metadata tables to camelCase" (#2419)

Revert "Convert metadata tables to camelCase (#2400)"

This reverts commit 1cf08c797f.
This commit is contained in:
Charles Bochet
2023-11-10 11:48:44 +01:00
committed by GitHub
parent 1cf08c797f
commit 7b9175a4a4
238 changed files with 2253 additions and 1852 deletions

View File

@ -1,45 +0,0 @@
import { Command, CommandRunner, Option } from 'nest-commander';
import { TenantMigrationService } from 'src/metadata/tenant-migration/tenant-migration.service';
import { TenantMigrationRunnerService } from 'src/tenant-migration-runner/tenant-migration-runner.service';
// TODO: implement dry-run
interface RunTenantMigrationsOptions {
workspaceId: string;
}
@Command({
name: 'tenant:migrate',
description: 'Run tenant migrations',
})
export class RunTenantMigrationsCommand extends CommandRunner {
constructor(
private readonly tenantMigrationService: TenantMigrationService,
private readonly tenantMigrationRunnerService: TenantMigrationRunnerService,
) {
super();
}
async run(
_passedParam: string[],
options: RunTenantMigrationsOptions,
): Promise<void> {
// TODO: run in a dedicated job + run queries in a transaction.
await this.tenantMigrationService.insertStandardMigrations(
options.workspaceId,
);
await this.tenantMigrationRunnerService.executeMigrationFromPendingMigrations(
options.workspaceId,
);
}
// TODO: workspaceId should be optional and we should run migrations for all workspaces
@Option({
flags: '-w, --workspace-id [workspace_id]',
description: 'workspace id',
required: true,
})
parseWorkspaceId(value: string): string {
return value;
}
}

View File

@ -1,12 +0,0 @@
import { Module } from '@nestjs/common';
import { TenantMigrationModule } from 'src/metadata/tenant-migration/tenant-migration.module';
import { TenantMigrationRunnerModule } from 'src/tenant-migration-runner/tenant-migration-runner.module';
import { RunTenantMigrationsCommand } from './run-tenant-migrations.command';
@Module({
imports: [TenantMigrationModule, TenantMigrationRunnerModule],
providers: [RunTenantMigrationsCommand],
})
export class TenantMigrationRunnerCommandsModule {}