Skip to content

Commit 33506a9

Browse files
committed
feat: add init migration
1 parent b08d467 commit 33506a9

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- CreateTable
2+
CREATE TABLE "User" (
3+
"id" SERIAL NOT NULL,
4+
"email" TEXT NOT NULL,
5+
"hash" TEXT NOT NULL,
6+
"created" TIMESTAMP(3) NOT NULL,
7+
"emailConfirmed" BOOLEAN NOT NULL,
8+
9+
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
10+
);
11+
12+
-- CreateTable
13+
CREATE TABLE "RefreshToken" (
14+
"id" SERIAL NOT NULL,
15+
"hash" TEXT NOT NULL,
16+
"userId" INTEGER NOT NULL,
17+
18+
CONSTRAINT "RefreshToken_pkey" PRIMARY KEY ("id")
19+
);
20+
21+
-- CreateTable
22+
CREATE TABLE "EmailConfirm" (
23+
"id" SERIAL NOT NULL,
24+
"confirmUuid" TEXT NOT NULL,
25+
"userId" INTEGER NOT NULL,
26+
27+
CONSTRAINT "EmailConfirm_pkey" PRIMARY KEY ("id")
28+
);
29+
30+
-- CreateIndex
31+
CREATE UNIQUE INDEX "RefreshToken_userId_key" ON "RefreshToken"("userId");
32+
33+
-- CreateIndex
34+
CREATE UNIQUE INDEX "EmailConfirm_userId_key" ON "EmailConfirm"("userId");
35+
36+
-- AddForeignKey
37+
ALTER TABLE "RefreshToken" ADD CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
38+
39+
-- AddForeignKey
40+
ALTER TABLE "EmailConfirm" ADD CONSTRAINT "EmailConfirm_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Please do not edit this file manually
2+
# It should be added in your version-control system (i.e. Git)
3+
provider = "postgresql"

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"postinstall": "yarn prisma:generate",
77
"test": "jest",
8-
"test:local": "bash run.local.sh --ganache docker",
8+
"test:local": "bash run.local.sh",
99
"prisma:prepare": "cp -rf $INIT_CWD/../schema.prisma $INIT_CWD/src/schema.prisma",
1010
"prisma:generate": "yarn prisma:prepare && npx prisma generate --schema=\"./src/schema.prisma\""
1111
},

0 commit comments

Comments
 (0)