-
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
4 changed files
with
66 additions
and
49 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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Task" ( | ||
"id" SERIAL NOT NULL, | ||
"description" TEXT NOT NULL, | ||
"isDone" BOOLEAN NOT NULL DEFAULT false, | ||
"userId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Task_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Auth" ( | ||
"id" TEXT NOT NULL, | ||
"userId" INTEGER, | ||
|
||
CONSTRAINT "Auth_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "AuthIdentity" ( | ||
"providerName" TEXT NOT NULL, | ||
"providerUserId" TEXT NOT NULL, | ||
"providerData" TEXT NOT NULL DEFAULT '{}', | ||
"authId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "AuthIdentity_pkey" PRIMARY KEY ("providerName","providerUserId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Session" ( | ||
"id" TEXT NOT NULL, | ||
"expiresAt" TIMESTAMP(3) NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Session_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Auth_userId_key" ON "Auth"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Session_id_key" ON "Session"("id"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "Session_userId_idx" ON "Session"("userId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Task" ADD CONSTRAINT "Task_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Auth" ADD CONSTRAINT "Auth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "AuthIdentity" ADD CONSTRAINT "AuthIdentity_authId_fkey" FOREIGN KEY ("authId") REFERENCES "Auth"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Auth"("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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "sqlite" | ||
provider = "postgresql" |