Skip to content

Commit

Permalink
Fixed migration
Browse files Browse the repository at this point in the history
  • Loading branch information
igolubic committed Aug 14, 2023
1 parent 5d6b6af commit 69e53b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/database/migrations/1691769417263-Articles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class Articles1691769417263 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "article" ("id" SERIAL NOT NULL, "title" character varying NOT NULL, "published" boolean NOT NULL DEFAULT true, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "editedAt" TIMESTAMP, "content" text NOT NULL, "authorId" integer, CONSTRAINT "PK_40808690eb7b915046558c0f81b" PRIMARY KEY ("id"))`,
`CREATE TABLE "article" ("id" SERIAL NOT NULL, "title" character varying NOT NULL, "published" boolean NOT NULL DEFAULT true, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "editedAt" TIMESTAMP NOT NULL DEFAULT now(), "content" text NOT NULL, "authorId" integer, CONSTRAINT "PK_40808690eb7b915046558c0f81b" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`ALTER TABLE "article" ADD CONSTRAINT "FK_a9c5f4ec6cceb1604b4a3c84c87" FOREIGN KEY ("authorId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
Expand Down

0 comments on commit 69e53b0

Please sign in to comment.