Skip to content

Commit

Permalink
Merge pull request #194 from makeopensource/fix-migration-error
Browse files Browse the repository at this point in the history
Added file to create the sticky-notes table
  • Loading branch information
jessehartloff authored Nov 13, 2024
2 parents eccf8ad + 8db0978 commit d980c97
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions devU-api/src/migration/1731177885475-add-sticky-notes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class AddStickyNotes1731177885475 implements MigrationInterface {
name = 'AddStickyNotes1731177885475'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "sticky_notes" ("id" SERIAL NOT NULL, "submissionId" integer NOT NULL, "content" character varying NOT NULL, CONSTRAINT "PK_615fc1d0c6b75c46aa2a7dd5f0a" PRIMARY KEY ("id"))`);
await queryRunner.query(`ALTER TABLE "sticky_notes" ADD CONSTRAINT "FK_a92bd7a1dc5c606db210b176a43" FOREIGN KEY ("submissionId") REFERENCES "submissions"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "sticky_notes" DROP CONSTRAINT "FK_a92bd7a1dc5c606db210b176a43"`);
await queryRunner.query(`DROP TABLE "sticky_notes"`);
}

}

0 comments on commit d980c97

Please sign in to comment.