-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from Rituraj67/master
added Poll Migration
- Loading branch information
Showing
16 changed files
with
108 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- DropForeignKey | ||
ALTER TABLE "Rooms" DROP CONSTRAINT "Rooms_CreatorId_fkey"; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Rooms" ADD CONSTRAINT "Rooms_CreatorId_fkey" FOREIGN KEY ("CreatorId") REFERENCES "User"("username") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- DropForeignKey | ||
ALTER TABLE "Rooms" DROP CONSTRAINT "Rooms_CreatorId_fkey"; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Rooms" ADD CONSTRAINT "Rooms_CreatorId_fkey" FOREIGN KEY ("CreatorId") REFERENCES "User"("userID") ON DELETE CASCADE ON UPDATE CASCADE; |
24 changes: 24 additions & 0 deletions
24
backend/prisma/migrations/20240816011135_init/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- CreateTable | ||
CREATE TABLE "Leetcode" ( | ||
"id" TEXT NOT NULL, | ||
"acceptanceRate" DOUBLE PRECISION NOT NULL, | ||
"contributionPoints" INTEGER NOT NULL, | ||
"easySolved" INTEGER NOT NULL, | ||
"hardSolved" INTEGER NOT NULL, | ||
"mediumSolved" INTEGER NOT NULL, | ||
"ranking" INTEGER NOT NULL, | ||
"totalEasy" INTEGER NOT NULL, | ||
"totalHard" INTEGER NOT NULL, | ||
"totalMedium" INTEGER NOT NULL, | ||
"totalQuestions" INTEGER NOT NULL, | ||
"totalSolved" INTEGER NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Leetcode_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Leetcode_userId_key" ON "Leetcode"("userId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Leetcode" ADD CONSTRAINT "Leetcode_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("userID") ON DELETE RESTRICT ON UPDATE CASCADE; |
14 changes: 14 additions & 0 deletions
14
backend/prisma/migrations/20240816063047_init/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `Leetcode` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Leetcode" DROP CONSTRAINT "Leetcode_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "leetcode" TEXT; | ||
|
||
-- DropTable | ||
DROP TABLE "Leetcode"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "showLC" BOOLEAN NOT NULL DEFAULT false; |
3 changes: 3 additions & 0 deletions
3
backend/prisma/migrations/20240820113120_development/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "codeforces" TEXT, | ||
ADD COLUMN "showCf" BOOLEAN NOT NULL DEFAULT false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "bgImg" TEXT; |
23 changes: 0 additions & 23 deletions
23
backend/prisma/migrations/20240905164750_development/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
backend/prisma/migrations/20240907193820_development/migration.sql
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
backend/prisma/migrations/20240908104001_poll/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
-- CreateTable | ||
CREATE TABLE "Poll" ( | ||
"id" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"topic" TEXT, | ||
"description" TEXT, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"subCommunity" TEXT, | ||
|
||
CONSTRAINT "Poll_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "PollOption" ( | ||
"id" TEXT NOT NULL, | ||
"text" TEXT NOT NULL, | ||
"pollId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "PollOption_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Vote" ( | ||
"id" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"optionId" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "Vote_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Poll" ADD CONSTRAINT "Poll_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("userID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Poll" ADD CONSTRAINT "Poll_subCommunity_fkey" FOREIGN KEY ("subCommunity") REFERENCES "Rooms"("title") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "PollOption" ADD CONSTRAINT "PollOption_pollId_fkey" FOREIGN KEY ("pollId") REFERENCES "Poll"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Vote" ADD CONSTRAINT "Vote_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("userID") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Vote" ADD CONSTRAINT "Vote_optionId_fkey" FOREIGN KEY ("optionId") REFERENCES "PollOption"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters