Datenbank Popup

This commit is contained in:
Moritz Utcke
2025-04-06 18:54:46 -04:00
parent 3acf581775
commit b7f9649036
25 changed files with 691 additions and 426 deletions

View File

@@ -0,0 +1,106 @@
/*
Warnings:
- The primary key for the `Anteilshaber` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `ApiRequests` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Aufnahme` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `BedarfsausweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `BedarfsausweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Bild` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Event` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `GEGEinpreisung` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `GEGNachweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `GEGNachweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Objekt` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Rechnung` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Tickets` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `Unterlage` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `VerbrauchsausweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `VerbrauchsausweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The primary key for the `benutzer` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- AlterTable
ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Anteilshaber_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "ApiRequests" DROP CONSTRAINT "ApiRequests_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "ApiRequests_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Aufnahme_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "BedarfsausweisGewerbe_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "BedarfsausweisWohnen_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Bild" DROP CONSTRAINT "Bild_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Bild_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Event" DROP CONSTRAINT "Event_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Event_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "GEGEinpreisung" DROP CONSTRAINT "GEGEinpreisung_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "GEGEinpreisung_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "GEGNachweisGewerbe_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "GEGNachweisWohnen_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Objekt" DROP CONSTRAINT "Objekt_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Objekt_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Rechnung" DROP CONSTRAINT "Rechnung_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Rechnung_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Tickets_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "Unterlage" DROP CONSTRAINT "Unterlage_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "Unterlage_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "VerbrauchsausweisGewerbe_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "VerbrauchsausweisWohnen_pkey" PRIMARY KEY ("id");
-- AlterTable
ALTER TABLE "benutzer" DROP CONSTRAINT "benutzer_pkey",
ALTER COLUMN "id" SET DATA TYPE VARCHAR(10),
ADD CONSTRAINT "benutzer_pkey" PRIMARY KEY ("id");

View File

@@ -1,5 +1,5 @@
model Anteilshaber {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
rolle String? @db.VarChar
privilegien BigInt?

View File

@@ -1,6 +1,6 @@
model ApiRequests {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
date DateTime @default(now()) @db.Timestamp(6)
ip String @db.VarChar(50)
method String @db.VarChar(10)

View File

@@ -13,7 +13,7 @@ enum Lueftungskonzept {
}
model Aufnahme {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
/// @zod.describe("Art des Gebäudes und seiner primären Nutzungsart")

View File

@@ -1,5 +1,5 @@
model BedarfsausweisGewerbe {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?

View File

@@ -1,6 +1,6 @@
model BedarfsausweisWohnen {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
benutzer_id String?
ausstellgrund Ausstellgrund?
registriernummer String? @db.VarChar

View File

@@ -5,7 +5,7 @@ enum BenutzerRolle {
}
model Benutzer {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
name String? @db.VarChar(50)
vorname String? @db.VarChar(50)
email String @unique(map: "benutzer_email_idx") @db.VarChar(255)

View File

@@ -8,7 +8,7 @@ enum BilderKategorie {
}
model Bild {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
kategorie BilderKategorie
name String

View File

@@ -3,7 +3,7 @@
// Hier werden beispielsweise Events wie "Nachricht Verschickt" gespeichert.
// Diese Events werden dann in der Admin-Oberfläche angezeigt.
model Event {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
date DateTime @default(now()) @db.Timestamp(6)
title String @db.VarChar(255)

View File

@@ -6,7 +6,7 @@ enum Einpreisungsstatus {
}
model GEGEinpreisung {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
empfaenger String? @db.VarChar
strasse String? @db.VarChar

View File

@@ -1,5 +1,5 @@
model GEGNachweisGewerbe {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?

View File

@@ -1,5 +1,5 @@
model GEGNachweisWohnen {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?

View File

@@ -1,5 +1,5 @@
model Objekt {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
latitude Float?
longitude Float?

View File

@@ -24,7 +24,7 @@ enum AusweisTyp {
}
model Rechnung {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
empfaenger String? @db.VarChar
strasse String? @db.VarChar

View File

@@ -8,7 +8,7 @@ enum TicketStatus {
}
model Tickets {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
created_at DateTime @default(now())
updated_at DateTime? @updatedAt
deleted_at DateTime?

View File

@@ -5,7 +5,7 @@ enum UnterlagenKategorie {
}
model Unterlage {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
name String?
kategorie String?
mime String

View File

@@ -1,6 +1,6 @@
model VerbrauchsausweisGewerbe {
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
ausstellgrund Ausstellgrund?
registriernummer String? @db.VarChar
zusaetzliche_heizquelle Boolean?

View File

@@ -1,7 +1,7 @@
model VerbrauchsausweisWohnen {
/// @zod.describe("ID des Ausweises")
id String @id @unique @db.VarChar(8)
id String @id @unique @db.VarChar(10)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?
/// @zod.describe("Die Registriernummer des Ausweises")