-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmigration.sql
More file actions
30 lines (24 loc) · 789 Bytes
/
Copy pathmigration.sql
File metadata and controls
30 lines (24 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- CreateEnum
CREATE TYPE "InventoryItemType" AS ENUM ('WEAPON', 'ARMOR', 'POTION', 'MISC');
-- CreateTable
CREATE TABLE "users" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"otp" TEXT,
"otp_expires" TIMESTAMPTZ,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "inventory_items" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT,
"quantity" INTEGER NOT NULL DEFAULT 0,
"type" "InventoryItemType",
"created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMPTZ NOT NULL,
CONSTRAINT "inventory_items_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");