Improve health check command (#3553)
* Improve health check command * Fix health check * Fix health check
This commit is contained in:
@ -101,7 +101,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
},
|
||||
icon: 'Icon123',
|
||||
description: 'Id',
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isActive: true,
|
||||
isCustom: false,
|
||||
isSystem: true,
|
||||
@ -117,7 +117,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
},
|
||||
icon: 'IconAbc',
|
||||
description: 'Name',
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isActive: true,
|
||||
isCustom: false,
|
||||
workspaceId: objectMetadataInput.workspaceId,
|
||||
@ -132,7 +132,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
},
|
||||
icon: 'IconCalendar',
|
||||
description: 'Creation date',
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isActive: true,
|
||||
isCustom: false,
|
||||
workspaceId: objectMetadataInput.workspaceId,
|
||||
@ -147,7 +147,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
},
|
||||
icon: 'IconCalendar',
|
||||
description: 'Update date',
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isActive: true,
|
||||
isCustom: false,
|
||||
isSystem: true,
|
||||
@ -245,7 +245,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
{
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: 'name',
|
||||
columnType: 'varchar',
|
||||
columnType: 'text',
|
||||
defaultValue: "'Untitled'",
|
||||
} satisfies WorkspaceMigrationColumnCreate,
|
||||
],
|
||||
@ -330,6 +330,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
) {
|
||||
return this.objectMetadataRepository.find({
|
||||
relations: [
|
||||
'fields.object',
|
||||
'fields',
|
||||
'fields.fromRelationMetadata',
|
||||
'fields.toRelationMetadata',
|
||||
|
||||
@ -20,14 +20,13 @@ import { WorkspaceMigrationColumnActionType } from 'src/metadata/workspace-migra
|
||||
import { ObjectMetadataEntity } from 'src/metadata/object-metadata/object-metadata.entity';
|
||||
import { createCustomColumnName } from 'src/metadata/utils/create-custom-column-name.util';
|
||||
import { computeObjectTargetTable } from 'src/workspace/utils/compute-object-target-table.util';
|
||||
import { createRelationForeignKeyColumnName } from 'src/metadata/relation-metadata/utils/create-relation-foreign-key-column-name.util';
|
||||
|
||||
import {
|
||||
RelationMetadataEntity,
|
||||
RelationMetadataType,
|
||||
} from './relation-metadata.entity';
|
||||
|
||||
import { createRelationMetadataForeignKey } from './utils/create-relation-metadata-foreign-key.util';
|
||||
|
||||
@Injectable()
|
||||
export class RelationMetadataService extends TypeOrmQueryService<RelationMetadataEntity> {
|
||||
constructor(
|
||||
@ -56,7 +55,7 @@ export class RelationMetadataService extends TypeOrmQueryService<RelationMetadat
|
||||
// NOTE: this logic is called to create relation through metadata graphql endpoint (so only for custom field relations)
|
||||
const isCustom = true;
|
||||
const baseColumnName = `${camelCase(relationMetadataInput.toName)}Id`;
|
||||
const foreignKeyColumnName = createRelationMetadataForeignKey(
|
||||
const foreignKeyColumnName = createRelationForeignKeyColumnName(
|
||||
relationMetadataInput.toName,
|
||||
isCustom,
|
||||
);
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createCustomColumnName } from 'src/metadata/utils/create-custom-column-name.util';
|
||||
import { camelCase } from 'src/utils/camel-case';
|
||||
|
||||
export const createRelationMetadataForeignKey = (
|
||||
export const createRelationForeignKeyColumnName = (
|
||||
name: string,
|
||||
isCustom?: boolean,
|
||||
isCustom: boolean,
|
||||
) => {
|
||||
const baseColumnName = `${camelCase(name)}Id`;
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
import { camelCase } from 'src/utils/camel-case';
|
||||
|
||||
export const createRelationForeignKeyFieldMetadataName = (name: string) => {
|
||||
return `${camelCase(name)}Id`;
|
||||
};
|
||||
Reference in New Issue
Block a user