-
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.
Database name changes for the note invites
- Loading branch information
1 parent
0037ef2
commit 27a8b0e
Showing
2 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
prisma/migrations/20231230121138_note_access_changes/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,49 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `NoteAccess` table. If the table is not empty, all the data it contains will be lost. | ||
- You are about to drop the `NoteAccessInvite` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "NoteAccess" DROP CONSTRAINT "NoteAccess_noteId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "NoteAccessInvite" DROP CONSTRAINT "NoteAccessInvite_noteId_fkey"; | ||
|
||
-- DropTable | ||
DROP TABLE "NoteAccess"; | ||
|
||
-- DropTable | ||
DROP TABLE "NoteAccessInvite"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "NoteCollaborator" ( | ||
"id" TEXT NOT NULL, | ||
"noteId" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMPTZ(6) NOT NULL, | ||
|
||
CONSTRAINT "NoteCollaborator_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "NoteInvite" ( | ||
"id" TEXT NOT NULL, | ||
"noteId" TEXT NOT NULL, | ||
"email" TEXT NOT NULL, | ||
"createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMPTZ(6) NOT NULL, | ||
|
||
CONSTRAINT "NoteInvite_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "NoteCollaborator" ADD CONSTRAINT "NoteCollaborator_noteId_fkey" FOREIGN KEY ("noteId") REFERENCES "Note"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "NoteCollaborator" ADD CONSTRAINT "NoteCollaborator_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "NoteInvite" ADD CONSTRAINT "NoteInvite_noteId_fkey" FOREIGN KEY ("noteId") REFERENCES "Note"("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