forked from char-ptr/prisma-insensitive-test
-
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
1 parent
f67962a
commit 8a561a5
Showing
5 changed files
with
1,232 additions
and
904 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
-- CreateTable | ||
CREATE TABLE "Activity" ( | ||
"ID" TEXT NOT NULL, | ||
"UpdatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"CreatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"Name" TEXT NOT NULL, | ||
"UserId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Activity_pkey" PRIMARY KEY ("ID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Device" ( | ||
"ID" TEXT NOT NULL, | ||
"Name" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Device_pkey" PRIMARY KEY ("ID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "DeviceActivity" ( | ||
"ID" TEXT NOT NULL, | ||
"UpdatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"CreatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"ActivityId" TEXT, | ||
"DeviceId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "DeviceActivity_pkey" PRIMARY KEY ("ID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"ID" TEXT NOT NULL, | ||
"Name" TEXT NOT NULL, | ||
"ApiKey" TEXT NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("ID") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Activity_Name_key" ON "Activity"("Name"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Device_Name_key" ON "Device"("Name"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_Name_key" ON "User"("Name"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_ApiKey_key" ON "User"("ApiKey"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Activity" ADD CONSTRAINT "Activity_UserId_fkey" FOREIGN KEY ("UserId") REFERENCES "User"("ID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "DeviceActivity" ADD CONSTRAINT "DeviceActivity_ActivityId_fkey" FOREIGN KEY ("ActivityId") REFERENCES "Activity"("ID") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "DeviceActivity" ADD CONSTRAINT "DeviceActivity_DeviceId_fkey" FOREIGN KEY ("DeviceId") REFERENCES "Device"("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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
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.