add configuration module

This commit is contained in:
Gsk54
2023-01-25 15:16:13 +01:00
parent 9997b7b6a1
commit 4c8084e37a
59 changed files with 3138 additions and 123 deletions

View File

@@ -0,0 +1,17 @@
-- CreateEnum
CREATE TYPE "Domain" AS ENUM ('USER');
-- CreateTable
CREATE TABLE "configuration" (
"uuid" UUID NOT NULL,
"domain" "Domain" NOT NULL,
"key" TEXT NOT NULL,
"value" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "configuration_pkey" PRIMARY KEY ("uuid")
);
-- CreateIndex
CREATE UNIQUE INDEX "configuration_domain_key_key" ON "configuration"("domain", "key");

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"

27
prisma/schema.prisma Normal file
View File

@@ -0,0 +1,27 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Configuration {
uuid String @id @default(uuid()) @db.Uuid
domain Domain
key String
value String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([domain, key])
@@map("configuration")
}
enum Domain {
USER
}