-
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 gsainfoteam/2-hhj
여러 명의 교수가 하나의 과목 강의 경우를 위한 일대다 관계
- Loading branch information
Showing
20 changed files
with
274 additions
and
200 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
1 change: 0 additions & 1 deletion
1
prisma/migrations/20240628120236_rename_lecture_name_to_name/migration.sql
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
prisma/migrations/20240711075735_add_record_like/migration.sql
This file was deleted.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
prisma/migrations/20240711082736_lecture_section/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,80 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `lecture_name` on the `lecture` table. All the data in the column will be lost. | ||
- You are about to drop the column `lecture_id` on the `record` table. All the data in the column will be lost. | ||
- You are about to drop the column `professor_id` on the `record` table. All the data in the column will be lost. | ||
- You are about to drop the `lecture_professor` table. If the table is not empty, all the data it contains will be lost. | ||
- Added the required column `name` to the `lecture` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `section_id` to the `record` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "lecture_professor" DROP CONSTRAINT "lecture_professor_lecture_id_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "lecture_professor" DROP CONSTRAINT "lecture_professor_professor_id_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "record" DROP CONSTRAINT "record_lecture_id_professor_id_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "lecture" DROP COLUMN "lecture_name", | ||
ADD COLUMN "name" TEXT NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "record" DROP COLUMN "lecture_id", | ||
DROP COLUMN "professor_id", | ||
ADD COLUMN "section_id" INTEGER NOT NULL; | ||
|
||
-- DropTable | ||
DROP TABLE "lecture_professor"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "lecture_section" ( | ||
"id" SERIAL NOT NULL, | ||
"lecture_id" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "lecture_section_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "record_like" ( | ||
"id" SERIAL NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"deleted_at" TIMESTAMP(3), | ||
"user_uuid" UUID NOT NULL, | ||
"record_id" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "record_like_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_LectureSectionToProfessor" ( | ||
"A" INTEGER NOT NULL, | ||
"B" INTEGER NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_LectureSectionToProfessor_AB_unique" ON "_LectureSectionToProfessor"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_LectureSectionToProfessor_B_index" ON "_LectureSectionToProfessor"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "lecture_section" ADD CONSTRAINT "lecture_section_lecture_id_fkey" FOREIGN KEY ("lecture_id") REFERENCES "lecture"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "record" ADD CONSTRAINT "record_section_id_fkey" FOREIGN KEY ("section_id") REFERENCES "lecture_section"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "record_like" ADD CONSTRAINT "record_like_user_uuid_fkey" FOREIGN KEY ("user_uuid") REFERENCES "user"("uuid") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "record_like" ADD CONSTRAINT "record_like_record_id_fkey" FOREIGN KEY ("record_id") REFERENCES "record"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_LectureSectionToProfessor" ADD CONSTRAINT "_LectureSectionToProfessor_A_fkey" FOREIGN KEY ("A") REFERENCES "lecture_section"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_LectureSectionToProfessor" ADD CONSTRAINT "_LectureSectionToProfessor_B_fkey" FOREIGN KEY ("B") REFERENCES "professor"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
Oops, something went wrong.