Skip to content

Commit 8f7d457

Browse files
fix(content): constraint name
1 parent 2decb81 commit 8f7d457

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

microservices/content/migrations/1675809166176-init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class init1675809166176 implements MigrationInterface {
88
`CREATE TABLE "component" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "alias" character varying(255) NOT NULL, "title" character varying(255) NOT NULL, "schema" json NOT NULL DEFAULT '[]', "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "component(uq):alias" UNIQUE ("alias"), CONSTRAINT "component(pk):id" PRIMARY KEY ("id"))`,
99
);
1010
await queryRunner.query(
11-
`CREATE TABLE "single_type" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "title" character varying(255) NOT NULL, "alias" character varying(255) NOT NULL, "value" json NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "article(uq):alias" UNIQUE ("alias"), CONSTRAINT "article(pk):id" PRIMARY KEY ("id"))`,
11+
`CREATE TABLE "single_type" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "title" character varying(255) NOT NULL, "alias" character varying(255) NOT NULL, "value" json NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "singleType(uq):alias" UNIQUE ("alias"), CONSTRAINT "singleType(pk):id" PRIMARY KEY ("id"))`,
1212
);
1313
await queryRunner.query(
1414
`CREATE TABLE "component_parent_component" ("childrenId" uuid NOT NULL, "parentId" uuid NOT NULL, CONSTRAINT "component_parent_component(pk:childrenId_parentId" PRIMARY KEY ("childrenId", "parentId"))`,

microservices/content/src/entities/single-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SingleType {
3333
@Length(1, 255)
3434
title: string;
3535

36-
@Unique('article(uq):alias', ['alias'])
36+
@Unique('singleType(uq):alias', ['alias'])
3737
@Column({ type: 'varchar', length: 255 })
3838
@Length(1, 255)
3939
@Validate(IsCamelCaseString)

0 commit comments

Comments
 (0)