mirror of
https://gitlab.com/mobicoop/v3/service/configuration.git
synced 2026-01-09 07:42:40 +00:00
add configuration module
This commit is contained in:
17
prisma/migrations/20230125112738_init/migration.sql
Normal file
17
prisma/migrations/20230125112738_init/migration.sql
Normal 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");
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal 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
27
prisma/schema.prisma
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user