-
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 #6 from AloyBranCheung/dev
Dev
- Loading branch information
Showing
42 changed files
with
789 additions
and
620 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
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
prisma/migrations/20231105154844_add_exercise_unit_to_exercise_table/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 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `unit` to the `Exercise` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Exercise" ADD COLUMN "unit" TEXT NOT NULL; |
11 changes: 11 additions & 0 deletions
11
...grations/20231105155458_add_one_gym_location_to_many_exercises_relationship/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,11 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `gymId` to the `Exercise` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Exercise" ADD COLUMN "gymId" UUID NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Exercise" ADD CONSTRAINT "Exercise_gymId_fkey" FOREIGN KEY ("gymId") REFERENCES "GymLocation"("gymId") ON DELETE CASCADE ON UPDATE CASCADE; |
43 changes: 43 additions & 0 deletions
43
prisma/migrations/20231105165000_adds_curr_active_sesh/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,43 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `exerciseOrder` on the `Session` table. All the data in the column will be lost. | ||
- You are about to drop the column `duration` on the `WorkoutPlan` table. All the data in the column will be lost. | ||
- You are about to drop the column `lastWorkout` on the `WorkoutPlan` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[exerciseId]` on the table `Target` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Session" DROP COLUMN "exerciseOrder"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "WorkoutPlan" DROP COLUMN "duration", | ||
DROP COLUMN "lastWorkout"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "CurrActiveSesh" ( | ||
"actSeshId" UUID NOT NULL, | ||
"duration" INTEGER NOT NULL, | ||
"sessionId" UUID NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "CurrActiveSesh_pkey" PRIMARY KEY ("actSeshId") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "CurrActiveSesh_actSeshId_key" ON "CurrActiveSesh"("actSeshId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "CurrActiveSesh_sessionId_key" ON "CurrActiveSesh"("sessionId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "CurrActiveSesh_userId_key" ON "CurrActiveSesh"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Target_exerciseId_key" ON "Target"("exerciseId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "CurrActiveSesh" ADD CONSTRAINT "CurrActiveSesh_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "Session"("sessionId") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "CurrActiveSesh" ADD CONSTRAINT "CurrActiveSesh_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("userId") ON DELETE RESTRICT ON UPDATE CASCADE; |
14 changes: 14 additions & 0 deletions
14
prisma/migrations/20231105165811_adds_updated_at_and_createda_t/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 column `duration` on the `CurrActiveSesh` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "CurrActiveSesh" DROP COLUMN "duration", | ||
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP; | ||
|
||
-- AlterTable | ||
ALTER TABLE "GymLocation" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP; |
10 changes: 10 additions & 0 deletions
10
prisma/migrations/20231105170418_adds_2_columns_to_workout_plan/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,10 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `exerciseOrder` on the `WorkoutPlan` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "WorkoutPlan" DROP COLUMN "exerciseOrder", | ||
ADD COLUMN "duration" INTEGER, | ||
ADD COLUMN "lastWorkout" TIMESTAMP(3); |
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20231105171520_re_add_exercise_order_mistake/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,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "WorkoutPlan" ADD COLUMN "exerciseOrder" TEXT[]; |
24 changes: 24 additions & 0 deletions
24
prisma/migrations/20231108124226_remove_target_table/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 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `Target` table. If the table is not empty, all the data it contains will be lost. | ||
- Added the required column `targetReps` to the `Exercise` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `targetSets` to the `Exercise` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `weightUnit` to the `Set` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Target" DROP CONSTRAINT "Target_exerciseId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Target" DROP CONSTRAINT "Target_planId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Exercise" ADD COLUMN "targetReps" INTEGER NOT NULL, | ||
ADD COLUMN "targetSets" INTEGER NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Set" ADD COLUMN "weightUnit" TEXT NOT NULL; | ||
|
||
-- DropTable | ||
DROP TABLE "Target"; |
3 changes: 3 additions & 0 deletions
3
...ma/migrations/20231108124816_targetreps_and_sets_optional_in_exercise_table/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 "Exercise" ALTER COLUMN "targetReps" DROP NOT NULL, | ||
ALTER COLUMN "targetSets" DROP NOT NULL; |
12 changes: 12 additions & 0 deletions
12
prisma/migrations/20231108135957_update_table_durations/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,12 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `duration` on the `Session` table. All the data in the column will be lost. | ||
- Added the required column `endDuration` to the `Session` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `startDuration` to the `Session` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Session" DROP COLUMN "duration", | ||
ADD COLUMN "endDuration" TIMESTAMP(3) NOT NULL, | ||
ADD COLUMN "startDuration" TIMESTAMP(3) NOT NULL; |
Oops, something went wrong.