Skip to content

Commit 0d9a19c

Browse files
committed
wip
1 parent 10a984e commit 0d9a19c

File tree

7 files changed

+1145
-904
lines changed

7 files changed

+1145
-904
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- CreateEnum
2+
CREATE TYPE "PaperType" AS ENUM ('POSITION_PAPER', 'WORKING_PAPER', 'PRESENTATION_PAPER');
3+
4+
-- CreateTable
5+
CREATE TABLE "Paper" (
6+
"id" TEXT NOT NULL,
7+
"content" JSONB NOT NULL,
8+
"authorId" TEXT NOT NULL,
9+
"delegationId" TEXT,
10+
"committeeId" TEXT,
11+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12+
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13+
"conferenceId" TEXT,
14+
15+
CONSTRAINT "Paper_pkey" PRIMARY KEY ("id")
16+
);
17+
18+
-- AddForeignKey
19+
ALTER TABLE "Paper" ADD CONSTRAINT "Paper_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
20+
21+
-- AddForeignKey
22+
ALTER TABLE "Paper" ADD CONSTRAINT "Paper_delegationId_fkey" FOREIGN KEY ("delegationId") REFERENCES "Delegation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
23+
24+
-- AddForeignKey
25+
ALTER TABLE "Paper" ADD CONSTRAINT "Paper_committeeId_fkey" FOREIGN KEY ("committeeId") REFERENCES "Committee"("id") ON DELETE SET NULL ON UPDATE CASCADE;
26+
27+
-- AddForeignKey
28+
ALTER TABLE "Paper" ADD CONSTRAINT "Paper_conferenceId_fkey" FOREIGN KEY ("conferenceId") REFERENCES "Conference"("id") ON DELETE SET NULL ON UPDATE CASCADE;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
Warnings:
3+
4+
- Made the column `delegationId` on table `Paper` required. This step will fail if there are existing NULL values in that column.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "Paper" ALTER COLUMN "delegationId" SET NOT NULL;

0 commit comments

Comments
 (0)