-
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.
- Loading branch information
Showing
15 changed files
with
350 additions
and
64 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
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20231025033018_update_next_auth_tables/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,11 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `userId` on the `Account` table. All the data in the column will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Account" DROP CONSTRAINT "Account_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Account" DROP COLUMN "userId"; |
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,17 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `avatar` on the `User` table. All the data in the column will be lost. | ||
- Added the required column `userId` to the `Account` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Account" ADD COLUMN "userId" TEXT NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" DROP COLUMN "avatar", | ||
ADD COLUMN "image" TEXT, | ||
ADD COLUMN "name" TEXT; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `accountProvider` on the `User` table. All the data in the column will be lost. | ||
- You are about to drop the column `createdAt` on the `User` table. All the data in the column will be lost. | ||
- You are about to drop the column `firstName` on the `User` table. All the data in the column will be lost. | ||
- You are about to drop the column `lastName` on the `User` table. All the data in the column will be lost. | ||
- You are about to drop the column `password` on the `User` table. All the data in the column will be lost. | ||
- You are about to drop the column `updatedAt` on the `User` table. All the data in the column will be lost. | ||
- You are about to drop the column `username` on the `User` table. All the data in the column will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Dream" DROP CONSTRAINT "Dream_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "DreamCharacter" DROP CONSTRAINT "DreamCharacter_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "DreamTag" DROP CONSTRAINT "DreamTag_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "FriendRequest" DROP CONSTRAINT "FriendRequest_reveiverId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "FriendRequest" DROP CONSTRAINT "FriendRequest_senderId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "UserProfile" DROP CONSTRAINT "UserProfile_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "_UserFriends" DROP CONSTRAINT "_UserFriends_A_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "_UserFriends" DROP CONSTRAINT "_UserFriends_B_fkey"; | ||
|
||
-- DropIndex | ||
DROP INDEX "User_username_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" DROP COLUMN "accountProvider", | ||
DROP COLUMN "createdAt", | ||
DROP COLUMN "firstName", | ||
DROP COLUMN "lastName", | ||
DROP COLUMN "password", | ||
DROP COLUMN "updatedAt", | ||
DROP COLUMN "username"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Member" ( | ||
"id" TEXT NOT NULL, | ||
"name" TEXT, | ||
"email" TEXT NOT NULL, | ||
"password" TEXT, | ||
"image" TEXT, | ||
"accountProvider" "AccountProvider", | ||
"username" TEXT NOT NULL, | ||
"firstName" TEXT NOT NULL, | ||
"lastName" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Member_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Member_email_key" ON "Member"("email"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Member_username_key" ON "Member"("username"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "FriendRequest" ADD CONSTRAINT "FriendRequest_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "Member"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "FriendRequest" ADD CONSTRAINT "FriendRequest_reveiverId_fkey" FOREIGN KEY ("reveiverId") REFERENCES "Member"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserProfile" ADD CONSTRAINT "UserProfile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Member"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Dream" ADD CONSTRAINT "Dream_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "DreamTag" ADD CONSTRAINT "DreamTag_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "DreamCharacter" ADD CONSTRAINT "DreamCharacter_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_UserFriends" ADD CONSTRAINT "_UserFriends_A_fkey" FOREIGN KEY ("A") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_UserFriends" ADD CONSTRAINT "_UserFriends_B_fkey" FOREIGN KEY ("B") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20231025035206_next_auth_update/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,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "role" TEXT; |
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.