-
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.
DB:Allow scrapper to add all atributes
- Loading branch information
1 parent
54cc6c1
commit de85238
Showing
7 changed files
with
208 additions
and
40 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 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
29 changes: 29 additions & 0 deletions
29
prisma/migrations/20241108165116_section_attribute_change/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,29 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `courseId` on the `sectionAttribute` table. All the data in the column will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "sectionAttribute" DROP CONSTRAINT "sectionAttribute_courseId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "sectionAttribute" DROP COLUMN "courseId"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "_CourseTosectionAttribute" ( | ||
"A" INTEGER NOT NULL, | ||
"B" INTEGER NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_CourseTosectionAttribute_AB_unique" ON "_CourseTosectionAttribute"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_CourseTosectionAttribute_B_index" ON "_CourseTosectionAttribute"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_CourseTosectionAttribute" ADD CONSTRAINT "_CourseTosectionAttribute_A_fkey" FOREIGN KEY ("A") REFERENCES "Course"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_CourseTosectionAttribute" ADD CONSTRAINT "_CourseTosectionAttribute_B_fkey" FOREIGN KEY ("B") REFERENCES "sectionAttribute"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
20 changes: 20 additions & 0 deletions
20
prisma/migrations/20241108165432_section_attribute_change1/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: | ||
- You are about to drop the `_CourseTosectionAttribute` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "_CourseTosectionAttribute" DROP CONSTRAINT "_CourseTosectionAttribute_A_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "_CourseTosectionAttribute" DROP CONSTRAINT "_CourseTosectionAttribute_B_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "sectionAttribute" ADD COLUMN "courseId" INTEGER; | ||
|
||
-- DropTable | ||
DROP TABLE "_CourseTosectionAttribute"; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "sectionAttribute" ADD CONSTRAINT "sectionAttribute_courseId_fkey" FOREIGN KEY ("courseId") REFERENCES "Course"("id") ON DELETE SET NULL ON UPDATE CASCADE; |
14 changes: 14 additions & 0 deletions
14
prisma/migrations/20241108170518_section_attribute_change1/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: | ||
- Made the column `courseId` on table `sectionAttribute` required. This step will fail if there are existing NULL values in that column. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "sectionAttribute" DROP CONSTRAINT "sectionAttribute_courseId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "sectionAttribute" ALTER COLUMN "courseId" SET NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "sectionAttribute" ADD CONSTRAINT "sectionAttribute_courseId_fkey" FOREIGN KEY ("courseId") REFERENCES "Course"("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