gluestick/prisma/migrations/20230425043204_init/migration.sql
2023-04-24 22:13:35 -07:00

19 lines
615 B
SQL

-- CreateTable
CREATE TABLE "AuthTicket" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"username" TEXT,
"ticket" TEXT NOT NULL
);
-- CreateTable
CREATE TABLE "DiscordAuth" (
"id" TEXT NOT NULL PRIMARY KEY,
"authTicketId" INTEGER NOT NULL,
"accessToken" TEXT NOT NULL,
"refreshToken" TEXT NOT NULL,
"refreshAt" DATETIME NOT NULL,
CONSTRAINT "DiscordAuth_authTicketId_fkey" FOREIGN KEY ("authTicketId") REFERENCES "AuthTicket" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "DiscordAuth_authTicketId_key" ON "DiscordAuth"("authTicketId");