forked from yunpeng1234/jc-app
-
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 #221 from Project-Juniors-Club/fix-bug
fix: fix cart bug
- Loading branch information
Showing
4 changed files
with
39 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `userId` on the `courses` table. All the data in the column will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "courses" DROP CONSTRAINT "courses_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "courses" DROP COLUMN "userId"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "_CoursesInCart" ( | ||
"A" TEXT NOT NULL, | ||
"B" TEXT NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_CoursesInCart_AB_unique" ON "_CoursesInCart"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_CoursesInCart_B_index" ON "_CoursesInCart"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_CoursesInCart" ADD CONSTRAINT "_CoursesInCart_A_fkey" FOREIGN KEY ("A") REFERENCES "courses"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_CoursesInCart" ADD CONSTRAINT "_CoursesInCart_B_fkey" FOREIGN KEY ("B") REFERENCES "users"("id") ON DELETE CASCADE 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