-
Notifications
You must be signed in to change notification settings - Fork 0
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 #8 from AloyBranCheung/dev
Dev
- Loading branch information
Showing
34 changed files
with
1,033 additions
and
64 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
20 changes: 20 additions & 0 deletions
20
prisma/migrations/20231126134440_add_activityid_column_optional/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,20 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[activityId]` on the table `Session` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Set" DROP CONSTRAINT "Set_sessionId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Session" ADD COLUMN "activityId" UUID; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Session_activityId_key" ON "Session"("activityId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Session" ADD CONSTRAINT "Session_activityId_fkey" FOREIGN KEY ("activityId") REFERENCES "Activity"("activityId") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Set" ADD CONSTRAINT "Set_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "Session"("sessionId") ON DELETE CASCADE ON UPDATE CASCADE; |
22 changes: 22 additions & 0 deletions
22
prisma/migrations/20231126134657_make_userid_and_activityid_required/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,22 @@ | ||
/* | ||
Warnings: | ||
- Made the column `userId` on table `Session` required. This step will fail if there are existing NULL values in that column. | ||
- Made the column `activityId` on table `Session` required. This step will fail if there are existing NULL values in that column. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Session" DROP CONSTRAINT "Session_activityId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Session" DROP CONSTRAINT "Session_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Session" ALTER COLUMN "userId" SET NOT NULL, | ||
ALTER COLUMN "activityId" SET NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Session" ADD CONSTRAINT "Session_activityId_fkey" FOREIGN KEY ("activityId") REFERENCES "Activity"("activityId") ON DELETE RESTRICT ON UPDATE CASCADE; |
8 changes: 8 additions & 0 deletions
8
prisma/migrations/20231126135005_change_userid_type/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,8 @@ | ||
-- DropForeignKey | ||
ALTER TABLE "Session" DROP CONSTRAINT "Session_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Session" ALTER COLUMN "userId" SET DATA TYPE TEXT; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("userId") ON DELETE CASCADE ON UPDATE CASCADE; |
25 changes: 25 additions & 0 deletions
25
prisma/migrations/20231126140814_change_relation/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,25 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `activityId` on the `Session` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[sessionId]` on the table `Activity` will be added. If there are existing duplicate values, this will fail. | ||
- Added the required column `sessionId` to the `Activity` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Session" DROP CONSTRAINT "Session_activityId_fkey"; | ||
|
||
-- DropIndex | ||
DROP INDEX "Session_activityId_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Activity" ADD COLUMN "sessionId" UUID NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Session" DROP COLUMN "activityId"; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Activity_sessionId_key" ON "Activity"("sessionId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Activity" ADD CONSTRAINT "Activity_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "Session"("sessionId") ON DELETE CASCADE ON UPDATE CASCADE; |
15 changes: 15 additions & 0 deletions
15
prisma/migrations/20231126161443_add_run_id_column_to_activity/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,15 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[runId]` on the table `Activity` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Activity" ADD COLUMN "runId" UUID, | ||
ALTER COLUMN "sessionId" DROP NOT NULL; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Activity_runId_key" ON "Activity"("runId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Activity" ADD CONSTRAINT "Activity_runId_fkey" FOREIGN KEY ("runId") REFERENCES "Run"("runId") 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
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
Oops, something went wrong.