-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update migrations for hosted postgres db
- Loading branch information
1 parent
fd3caff
commit cd09b1c
Showing
3 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
14 changes: 10 additions & 4 deletions
14
...rations/20210901215656_init/migration.sql → ...rations/20210903232243_init/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 |
---|---|---|
@@ -1,20 +1,26 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"id" TEXT NOT NULL, | ||
"address" TEXT NOT NULL, | ||
"authDetailId" TEXT NOT NULL, | ||
FOREIGN KEY ("authDetailId") REFERENCES "AuthDetail" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
|
||
PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "AuthDetail" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"id" TEXT NOT NULL, | ||
"nonce" TEXT NOT NULL, | ||
"timestamp" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
"timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User.address_unique" ON "User"("address"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_authDetailId_unique" ON "User"("authDetailId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "User" ADD FOREIGN KEY ("authDetailId") REFERENCES "AuthDetail"("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" |
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