Fix seeds for local workspace and newly created workspaces (#2333)
* Update metadata/data seeds * fix * fix * move seeding into a transaction * add no-non-null-assertion --------- Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import { Command, CommandRunner, Option } from 'nest-commander';
|
||||
|
||||
import { ObjectMetadataService } from 'src/metadata/object-metadata/services/object-metadata.service';
|
||||
import { TenantInitialisationService } from 'src/metadata/tenant-initialisation/tenant-initialisation.service';
|
||||
import { DataSourceMetadataService } from 'src/metadata/data-source-metadata/data-source-metadata.service';
|
||||
|
||||
// TODO: implement dry-run
|
||||
@ -17,7 +16,6 @@ export class SyncTenantMetadataCommand extends CommandRunner {
|
||||
constructor(
|
||||
private readonly objectMetadataService: ObjectMetadataService,
|
||||
private readonly dataSourceMetadataService: DataSourceMetadataService,
|
||||
private readonly tenantInitialisationService: TenantInitialisationService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@ -37,8 +35,7 @@ export class SyncTenantMetadataCommand extends CommandRunner {
|
||||
workspaceId: { eq: options.workspaceId },
|
||||
});
|
||||
|
||||
// TODO: this should not be the responsibility of tenantInitialisationService.
|
||||
await this.tenantInitialisationService.createObjectsAndFieldsMetadata(
|
||||
await this.objectMetadataService.createStandardObjectsAndFieldsMetadata(
|
||||
dataSourceMetadata.id,
|
||||
options.workspaceId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user