feat: initial prisma migration

This commit is contained in:
Vyacheslav Matyukhin 2022-04-07 23:19:59 +03:00
parent 5e34ebf35e
commit 8b70568795
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,57 @@
-- CreateTable
CREATE TABLE "dashboards" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
"contents" JSONB NOT NULL,
"timestamp" TIMESTAMP(6) NOT NULL,
"creator" TEXT NOT NULL,
"extra" JSONB NOT NULL,
CONSTRAINT "dashboards_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "frontpage" (
"id" SERIAL NOT NULL,
"frontpage_full" JSONB NOT NULL,
"frontpage_sliced" JSONB NOT NULL,
CONSTRAINT "frontpage_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "history" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"url" TEXT NOT NULL,
"platform" TEXT NOT NULL,
"description" TEXT NOT NULL,
"options" JSONB NOT NULL,
"timestamp" TIMESTAMP(6) NOT NULL,
"stars" INTEGER NOT NULL,
"qualityindicators" JSONB NOT NULL,
"extra" JSONB NOT NULL,
"pk" SERIAL NOT NULL,
CONSTRAINT "history_pkey" PRIMARY KEY ("pk")
);
-- CreateTable
CREATE TABLE "questions" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"url" TEXT NOT NULL,
"platform" TEXT NOT NULL,
"description" TEXT NOT NULL,
"options" JSONB NOT NULL,
"timestamp" TIMESTAMP(6) NOT NULL,
"stars" INTEGER NOT NULL,
"qualityindicators" JSONB NOT NULL,
"extra" JSONB NOT NULL,
CONSTRAINT "questions_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "history_id_idx" ON "history"("id");

View File

@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"