feat: conditional schema based on column map instead of column field (#1978)

* feat: wip conditional schema based on column map instead of column field

* feat: conditionalSchema columnMap and singular plural

* fix: remove uuid fix

* feat: add name and label (singular/plural) drop old tableColumnName
This commit is contained in:
Jérémy M
2023-10-12 18:28:27 +02:00
committed by GitHub
parent 8fbad7d3ba
commit 4e993316a6
44 changed files with 1577 additions and 311 deletions

View File

@ -1,4 +1,4 @@
import { ConflictException, Injectable } from '@nestjs/common';
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
@ -22,17 +22,6 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadata> {
}
override async createOne(record: ObjectMetadata): Promise<ObjectMetadata> {
const objectAlreadyExists = await this.objectMetadataRepository.findOne({
where: {
displayName: record.displayName, // deprecated, use singular and plural
workspaceId: record.workspaceId,
},
});
if (objectAlreadyExists) {
throw new ConflictException('Object already exists');
}
const createdObjectMetadata = await super.createOne(record);
await this.tenantMigrationService.createMigration(