Ausweistyp

This commit is contained in:
Moritz Utcke
2025-03-24 16:39:39 -03:00
parent a9c2b5c173
commit 84a3a2dd39
20 changed files with 122 additions and 64 deletions

View File

@@ -0,0 +1,57 @@
/*
Warnings:
- You are about to drop the column `ausweistyp` on the `Rechnung` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Anteilshaber" ALTER COLUMN "uid" SET DEFAULT 'ant-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Aufnahme" ALTER COLUMN "uid" SET DEFAULT 'auf-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" ADD COLUMN "ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Bild" ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Event" ALTER COLUMN "uid" SET DEFAULT 'evt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGEinpreisung" ALTER COLUMN "uid" SET DEFAULT 'gge-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'gng-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Objekt" ALTER COLUMN "uid" SET DEFAULT 'obj-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Rechnung" DROP COLUMN "ausweistyp",
ALTER COLUMN "uid" SET DEFAULT 'inv-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Tickets" ALTER COLUMN "uid" SET DEFAULT 'tkt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Unterlage" ALTER COLUMN "uid" SET DEFAULT 'pln-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" ADD COLUMN "ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ADD COLUMN "ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -79,6 +79,7 @@ model BedarfsausweisWohnen {
created_at DateTime @default(now())
updated_at DateTime @updatedAt
ausweistyp AusweisTyp @default(Standard)
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)

View File

@@ -46,7 +46,6 @@ model Rechnung {
bezahlmethode Bezahlmethoden
status Rechnungsstatus
services Service[]
ausweistyp AusweisTyp @default(Standard)
betrag Float
erstellt_am DateTime @default(now())
bezahlt_am DateTime?

View File

@@ -66,6 +66,7 @@ model VerbrauchsausweisGewerbe {
created_at DateTime @default(now())
updated_at DateTime @updatedAt
ausweistyp AusweisTyp @default(Standard)
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)

View File

@@ -67,6 +67,8 @@ model VerbrauchsausweisWohnen {
/// @zod.describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde")
kontrolldatei_angefragt Boolean? @default(false)
ausweistyp AusweisTyp @default(Standard)
created_at DateTime @default(now())
updated_at DateTime @updatedAt