Replace shouldSyncNameAndLabel with isLabelSyncedWithName (#8067)
For consistency. This was not deployed yet so allowing myself just to rename everything, meaning developers will need to reset their db.
This commit is contained in:
@ -1,19 +1,19 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddShouldSyncLabelAndName1728579416430
|
||||
export class AddIsLabelSyncedWithName1728579416430
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddShouldSyncLabelAndName1728579416430';
|
||||
name = 'AddIsLabelSyncedWithName1728579416430';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."objectMetadata" ADD "shouldSyncLabelAndName" boolean NOT NULL DEFAULT false`,
|
||||
`ALTER TABLE "metadata"."objectMetadata" ADD "isLabelSyncedWithName" boolean NOT NULL DEFAULT false`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "shouldSyncLabelAndName"`,
|
||||
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "isLabelSyncedWithName"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -90,5 +90,5 @@ export class CreateObjectInput {
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Field({ nullable: true })
|
||||
shouldSyncLabelAndName?: boolean;
|
||||
isLabelSyncedWithName?: boolean;
|
||||
}
|
||||
|
||||
@ -84,5 +84,5 @@ export class ObjectMetadataDTO {
|
||||
imageIdentifierFieldMetadataId?: string | null;
|
||||
|
||||
@Field()
|
||||
shouldSyncLabelAndName: boolean;
|
||||
isLabelSyncedWithName: boolean;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ export class UpdateObjectPayload {
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Field({ nullable: true })
|
||||
shouldSyncLabelAndName?: boolean;
|
||||
isLabelSyncedWithName?: boolean;
|
||||
}
|
||||
|
||||
@InputType()
|
||||
|
||||
@ -79,7 +79,7 @@ export class ObjectMetadataEntity implements ObjectMetadataInterface {
|
||||
imageIdentifierFieldMetadataId?: string | null;
|
||||
|
||||
@Column({ default: true })
|
||||
shouldSyncLabelAndName: boolean;
|
||||
isLabelSyncedWithName: boolean;
|
||||
|
||||
@Column({ nullable: false, type: 'uuid' })
|
||||
workspaceId: string;
|
||||
|
||||
@ -204,7 +204,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
);
|
||||
}
|
||||
|
||||
if (objectMetadataInput.shouldSyncLabelAndName === true) {
|
||||
if (objectMetadataInput.isLabelSyncedWithName === true) {
|
||||
validateNameAndLabelAreSyncOrThrow(
|
||||
objectMetadataInput.labelSingular,
|
||||
objectMetadataInput.nameSingular,
|
||||
@ -436,7 +436,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
existingObjectMetadataId: fullObjectMetadataAfterUpdate.id,
|
||||
});
|
||||
|
||||
if (fullObjectMetadataAfterUpdate.shouldSyncLabelAndName) {
|
||||
if (fullObjectMetadataAfterUpdate.isLabelSyncedWithName) {
|
||||
validateNameAndLabelAreSyncOrThrow(
|
||||
fullObjectMetadataAfterUpdate.labelSingular,
|
||||
fullObjectMetadataAfterUpdate.nameSingular,
|
||||
|
||||
Reference in New Issue
Block a user