monsterdon-bingo/server/prisma/migrations/20230814062803_init/migration.sql
ansible user/allowed to read system logs c7e8eccb57 initial work on logging in with masto
2023-08-13 23:57:52 -07:00

26 lines
846 B
SQL

-- CreateTable
CREATE TABLE "Term" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"text" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
CONSTRAINT "Term_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"instanceId" INTEGER NOT NULL,
"displayName" TEXT NOT NULL,
"handle" TEXT NOT NULL,
CONSTRAINT "User_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "Instance" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"appName" TEXT,
"appClientId" TEXT,
"appClientSecret" TEXT
);