-
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 #32 from gsainfoteam/revert-31-revert-30-12-hhj
Revert "Revert "feat: lectureSection의 lectureId와 id 복합키""
- Loading branch information
Showing
17 changed files
with
384 additions
and
119 deletions.
There are no files selected for viewing
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
44 changes: 44 additions & 0 deletions
44
prisma/migrations/20240725104627_lecture_section_professor/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,44 @@ | ||
/* | ||
Warnings: | ||
- The primary key for the `lecture_section` table will be changed. If it partially fails, the table could be left without primary key constraint. | ||
- You are about to drop the `_LectureSectionToProfessor` table. If the table is not empty, all the data it contains will be lost. | ||
- Added the required column `lecture_id` to the `record` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "_LectureSectionToProfessor" DROP CONSTRAINT "_LectureSectionToProfessor_A_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "_LectureSectionToProfessor" DROP CONSTRAINT "_LectureSectionToProfessor_B_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "record" DROP CONSTRAINT "record_section_id_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "lecture_section" DROP CONSTRAINT "lecture_section_pkey", | ||
ADD CONSTRAINT "lecture_section_pkey" PRIMARY KEY ("id", "lecture_id"); | ||
|
||
-- AlterTable | ||
ALTER TABLE "record" ADD COLUMN "lecture_id" INTEGER NOT NULL; | ||
|
||
-- DropTable | ||
DROP TABLE "_LectureSectionToProfessor"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "lecture_section_professor" ( | ||
"section_id" INTEGER NOT NULL, | ||
"lecture_id" INTEGER NOT NULL, | ||
"professor_id" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "lecture_section_professor_pkey" PRIMARY KEY ("section_id","lecture_id","professor_id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "lecture_section_professor" ADD CONSTRAINT "lecture_section_professor_section_id_lecture_id_fkey" FOREIGN KEY ("section_id", "lecture_id") REFERENCES "lecture_section"("id", "lecture_id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "lecture_section_professor" ADD CONSTRAINT "lecture_section_professor_professor_id_fkey" FOREIGN KEY ("professor_id") REFERENCES "professor"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "record" ADD CONSTRAINT "record_lecture_id_section_id_fkey" FOREIGN KEY ("lecture_id", "section_id") REFERENCES "lecture_section"("lecture_id", "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
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.