-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
58 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 |
---|---|---|
|
@@ -70,4 +70,4 @@ | |
"npx prisma format" | ||
] | ||
} | ||
} | ||
} |
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,34 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `numberOfStudents` on the `Absence` table. All the data in the column will be lost. | ||
- You are about to drop the column `subject` on the `Absence` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[authId]` on the table `User` will be added. If there are existing duplicate values, this will fail. | ||
- Added the required column `subjectId` to the `Absence` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Absence" DROP COLUMN "numberOfStudents", | ||
DROP COLUMN "subject", | ||
ADD COLUMN "subjectId" INTEGER NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "numOfAbsences" INTEGER NOT NULL DEFAULT 10; | ||
|
||
-- DropEnum | ||
DROP TYPE "Subject"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Subject" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"abbreviation" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Subject_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_authId_key" ON "User"("authId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Absence" ADD CONSTRAINT "Absence_subjectId_fkey" FOREIGN KEY ("subjectId") REFERENCES "Subject"("id") ON DELETE RESTRICT 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