Datenbank und Checkliste

This commit is contained in:
Moritz Utcke
2025-04-06 23:21:55 -04:00
parent b7f9649036
commit f1bb2fc55c
43 changed files with 928 additions and 2480 deletions

View File

@@ -1,47 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,47 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,48 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ADD COLUMN "verified" BOOLEAN NOT NULL DEFAULT false,
ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,48 +0,0 @@
-- 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" 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 'gnw-' || 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" 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 "warmwasser_anteil_bekannt" BOOLEAN,
ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,49 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,48 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid(),
ALTER COLUMN "updated_at" DROP DEFAULT;
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,49 +0,0 @@
-- 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" 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 'gnw-' || 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" 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 "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,48 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid(),
ALTER COLUMN "updated_at" DROP DEFAULT;
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,47 +0,0 @@
-- 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" 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,47 +0,0 @@
-- 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" 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 'gnw-' || 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,66 +0,0 @@
-- AlterEnum
ALTER TYPE "BilderKategorie" ADD VALUE 'AnlagenTechnik';
-- 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" ADD COLUMN "abluftanlage" BOOLEAN DEFAULT false,
ADD COLUMN "ausstellgrund" "Ausstellgrund",
ADD COLUMN "bauteilaktivierung" BOOLEAN DEFAULT false,
ADD COLUMN "bestellt" BOOLEAN DEFAULT false,
ADD COLUMN "direktheizung" BOOLEAN DEFAULT false,
ADD COLUMN "dunkelstrahler" BOOLEAN DEFAULT false,
ADD COLUMN "fussbodenheizung" BOOLEAN DEFAULT false,
ADD COLUMN "hallenheizung" BOOLEAN DEFAULT false,
ADD COLUMN "infrarotstrahler" BOOLEAN DEFAULT false,
ADD COLUMN "keller_beheizt" BOOLEAN,
ADD COLUMN "klimatisierung" BOOLEAN DEFAULT false,
ADD COLUMN "konditionierung_der_zuluft" BOOLEAN DEFAULT false,
ADD COLUMN "luftheizung" BOOLEAN DEFAULT false,
ADD COLUMN "storniert" BOOLEAN DEFAULT false,
ADD COLUMN "zu_abluftanlage" BOOLEAN DEFAULT false,
ADD COLUMN "zurueckgestellt" BOOLEAN DEFAULT false,
ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,62 +0,0 @@
/*
Warnings:
- The values [GEGNachweisBedarfsausweis] on the enum `Ausweisart` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "Ausweisart_new" AS ENUM ('VerbrauchsausweisWohnen', 'VerbrauchsausweisGewerbe', 'BedarfsausweisWohnen', 'BedarfsausweisGewerbe', 'GEGNachweisWohnen', 'GEGNachweisGewerbe');
ALTER TABLE "Aufnahme" ALTER COLUMN "ausweisart" TYPE "Ausweisart_new" USING ("ausweisart"::text::"Ausweisart_new");
ALTER TYPE "Ausweisart" RENAME TO "Ausweisart_old";
ALTER TYPE "Ausweisart_new" RENAME TO "Ausweisart";
DROP TYPE "Ausweisart_old";
COMMIT;
-- 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" 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,54 +0,0 @@
/*
Warnings:
- Added the required column `name` to the `Bild` table without a default value. This is not possible if the table is not empty.
*/
-- 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" ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Bild" ADD COLUMN "name" TEXT NOT NULL,
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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,47 +0,0 @@
-- 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" 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,50 +0,0 @@
-- 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 "alte_ausweis_id" INTEGER,
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" 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 "alte_ausweis_id" INTEGER,
ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ADD COLUMN "alte_ausweis_id" INTEGER,
ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,47 +0,0 @@
-- 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" 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,55 +0,0 @@
/*
Warnings:
- Added the required column `updated_at` to the `BedarfsausweisWohnen` table without a default value. This is not possible if the table is not empty.
*/
-- 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 "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL,
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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,47 +0,0 @@
-- 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" 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" 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" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -1,57 +0,0 @@
/*
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

@@ -1,573 +0,0 @@
/*
Warnings:
- The primary key for the `Anteilshaber` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Anteilshaber` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Anteilshaber` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `ApiRequests` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to alter the column `id` on the `ApiRequests` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Aufnahme` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Aufnahme` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `BedarfsausweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `BedarfsausweisGewerbe` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `BedarfsausweisGewerbe` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `BedarfsausweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `BedarfsausweisWohnen` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `BedarfsausweisWohnen` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Bild` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to alter the column `id` on the `Bild` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Event` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Event` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Event` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `GEGEinpreisung` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `GEGEinpreisung` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `GEGEinpreisung` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `GEGNachweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `GEGNachweisGewerbe` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `GEGNachweisGewerbe` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `GEGNachweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `GEGNachweisWohnen` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `GEGNachweisWohnen` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Objekt` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Objekt` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Objekt` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Rechnung` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Rechnung` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Rechnung` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Tickets` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Tickets` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Tickets` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `Unterlage` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `Unterlage` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `Unterlage` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `VerbrauchsausweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `VerbrauchsausweisGewerbe` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `VerbrauchsausweisGewerbe` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `VerbrauchsausweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `VerbrauchsausweisWohnen` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `VerbrauchsausweisWohnen` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- The primary key for the `benutzer` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `uid` on the `benutzer` table. All the data in the column will be lost.
- You are about to alter the column `id` on the `benutzer` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
- A unique constraint covering the columns `[id]` on the table `Anteilshaber` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `ApiRequests` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Aufnahme` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `BedarfsausweisGewerbe` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `BedarfsausweisWohnen` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Bild` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Event` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `GEGEinpreisung` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `GEGNachweisGewerbe` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `GEGNachweisWohnen` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Objekt` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Rechnung` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Tickets` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `Unterlage` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `VerbrauchsausweisGewerbe` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `VerbrauchsausweisWohnen` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[id]` on the table `benutzer` will be added. If there are existing duplicate values, this will fail.
*/
-- DropForeignKey
ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_objekt_id_fkey";
-- DropForeignKey
ALTER TABLE "ApiRequests" DROP CONSTRAINT "ApiRequests_user_id_fkey";
-- DropForeignKey
ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_objekt_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_geg_einpreisung_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_rechnung_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_rechnung_id_fkey";
-- DropForeignKey
ALTER TABLE "Bild" DROP CONSTRAINT "Bild_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "Event" DROP CONSTRAINT "Event_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "Event" DROP CONSTRAINT "Event_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGEinpreisung" DROP CONSTRAINT "GEGEinpreisung_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_geg_einpreisung_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_rechnung_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_geg_einpreisung_id_fkey";
-- DropForeignKey
ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_rechnung_id_fkey";
-- DropForeignKey
ALTER TABLE "Objekt" DROP CONSTRAINT "Objekt_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "Rechnung" DROP CONSTRAINT "Rechnung_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "RefreshTokens" DROP CONSTRAINT "RefreshTokens_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_bearbeiter_id_fkey";
-- DropForeignKey
ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "Unterlage" DROP CONSTRAINT "Unterlage_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_rechnung_id_fkey";
-- DropForeignKey
ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_aufnahme_id_fkey";
-- DropForeignKey
ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_benutzer_id_fkey";
-- DropForeignKey
ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_rechnung_id_fkey";
-- DropForeignKey
ALTER TABLE "documenttemplates" DROP CONSTRAINT "benutzer_fk";
-- DropForeignKey
ALTER TABLE "tokens" DROP CONSTRAINT "fk_benutzer_tokens_user_id";
-- DropIndex
DROP INDEX "Anteilshaber_uid_key";
-- DropIndex
DROP INDEX "Aufnahme_uid_key";
-- DropIndex
DROP INDEX "BedarfsausweisGewerbe_uid_key";
-- DropIndex
DROP INDEX "BedarfsausweisWohnen_uid_key";
-- DropIndex
DROP INDEX "Event_uid_key";
-- DropIndex
DROP INDEX "GEGEinpreisung_uid_key";
-- DropIndex
DROP INDEX "GEGNachweisGewerbe_uid_key";
-- DropIndex
DROP INDEX "GEGNachweisWohnen_uid_key";
-- DropIndex
DROP INDEX "Objekt_uid_key";
-- DropIndex
DROP INDEX "Rechnung_uid_key";
-- DropIndex
DROP INDEX "Tickets_uid_key";
-- DropIndex
DROP INDEX "Unterlage_uid_key";
-- DropIndex
DROP INDEX "VerbrauchsausweisGewerbe_uid_key";
-- DropIndex
DROP INDEX "VerbrauchsausweisWohnen_uid_key";
-- DropIndex
DROP INDEX "benutzer_uid_key";
-- AlterTable
ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "objekt_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Anteilshaber_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Anteilshaber_id_seq";
-- AlterTable
ALTER TABLE "ApiRequests" DROP CONSTRAINT "ApiRequests_pkey",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "user_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "ApiRequests_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "ApiRequests_id_seq";
-- AlterTable
ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "objekt_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Aufnahme_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Aufnahme_id_seq";
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
ALTER COLUMN "geg_einpreisung_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "BedarfsausweisGewerbe_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "BedarfsausweisGewerbe_id_seq";
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "BedarfsausweisWohnen_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "BedarfsausweisWohnen_id_seq";
-- AlterTable
ALTER TABLE "Bild" DROP CONSTRAINT "Bild_pkey",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid(),
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Bild_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Bild_id_seq";
-- AlterTable
ALTER TABLE "Event" DROP CONSTRAINT "Event_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Event_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Event_id_seq";
-- AlterTable
ALTER TABLE "GEGEinpreisung" DROP CONSTRAINT "GEGEinpreisung_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "GEGEinpreisung_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "GEGEinpreisung_id_seq";
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
ALTER COLUMN "geg_einpreisung_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "GEGNachweisGewerbe_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "GEGNachweisGewerbe_id_seq";
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
ALTER COLUMN "geg_einpreisung_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "GEGNachweisWohnen_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "GEGNachweisWohnen_id_seq";
-- AlterTable
ALTER TABLE "Objekt" DROP CONSTRAINT "Objekt_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Objekt_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Objekt_id_seq";
-- AlterTable
ALTER TABLE "Rechnung" DROP CONSTRAINT "Rechnung_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Rechnung_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Rechnung_id_seq";
-- AlterTable
ALTER TABLE "RefreshTokens" ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT;
-- AlterTable
ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "bearbeiter_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Tickets_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Tickets_id_seq";
-- AlterTable
ALTER TABLE "Unterlage" DROP CONSTRAINT "Unterlage_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "Unterlage_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "Unterlage_id_seq";
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "VerbrauchsausweisGewerbe_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "VerbrauchsausweisGewerbe_id_seq";
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
ADD CONSTRAINT "VerbrauchsausweisWohnen_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "VerbrauchsausweisWohnen_id_seq";
-- AlterTable
ALTER TABLE "benutzer" DROP CONSTRAINT "benutzer_pkey",
DROP COLUMN "uid",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
ADD CONSTRAINT "benutzer_pkey" PRIMARY KEY ("id");
DROP SEQUENCE "benutzer_id_seq";
-- AlterTable
ALTER TABLE "documenttemplates" ALTER COLUMN "user_id" SET DATA TYPE TEXT;
-- AlterTable
ALTER TABLE "tokens" ALTER COLUMN "user_id" SET DATA TYPE TEXT;
-- CreateIndex
CREATE UNIQUE INDEX "Anteilshaber_id_key" ON "Anteilshaber"("id");
-- CreateIndex
CREATE UNIQUE INDEX "ApiRequests_id_key" ON "ApiRequests"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Aufnahme_id_key" ON "Aufnahme"("id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisGewerbe_id_key" ON "BedarfsausweisGewerbe"("id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisWohnen_id_key" ON "BedarfsausweisWohnen"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Bild_id_key" ON "Bild"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Event_id_key" ON "Event"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGEinpreisung_id_key" ON "GEGEinpreisung"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGNachweisGewerbe_id_key" ON "GEGNachweisGewerbe"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGNachweisWohnen_id_key" ON "GEGNachweisWohnen"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Objekt_id_key" ON "Objekt"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Rechnung_id_key" ON "Rechnung"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Tickets_id_key" ON "Tickets"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Unterlage_id_key" ON "Unterlage"("id");
-- CreateIndex
CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_id_key" ON "VerbrauchsausweisGewerbe"("id");
-- CreateIndex
CREATE UNIQUE INDEX "VerbrauchsausweisWohnen_id_key" ON "VerbrauchsausweisWohnen"("id");
-- CreateIndex
CREATE UNIQUE INDEX "benutzer_id_key" ON "benutzer"("id");
-- AddForeignKey
ALTER TABLE "Anteilshaber" ADD CONSTRAINT "Anteilshaber_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Anteilshaber" ADD CONSTRAINT "Anteilshaber_objekt_id_fkey" FOREIGN KEY ("objekt_id") REFERENCES "Objekt"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "ApiRequests" ADD CONSTRAINT "ApiRequests_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Aufnahme" ADD CONSTRAINT "Aufnahme_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Aufnahme" ADD CONSTRAINT "Aufnahme_objekt_id_fkey" FOREIGN KEY ("objekt_id") REFERENCES "Objekt"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_geg_einpreisung_id_fkey" FOREIGN KEY ("geg_einpreisung_id") REFERENCES "GEGEinpreisung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisWohnen" ADD CONSTRAINT "BedarfsausweisWohnen_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisWohnen" ADD CONSTRAINT "BedarfsausweisWohnen_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "BedarfsausweisWohnen" ADD CONSTRAINT "BedarfsausweisWohnen_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Bild" ADD CONSTRAINT "Bild_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Event" ADD CONSTRAINT "Event_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Event" ADD CONSTRAINT "Event_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGEinpreisung" ADD CONSTRAINT "GEGEinpreisung_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_geg_einpreisung_id_fkey" FOREIGN KEY ("geg_einpreisung_id") REFERENCES "GEGEinpreisung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_geg_einpreisung_id_fkey" FOREIGN KEY ("geg_einpreisung_id") REFERENCES "GEGEinpreisung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "Objekt" ADD CONSTRAINT "Objekt_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Rechnung" ADD CONSTRAINT "Rechnung_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "RefreshTokens" ADD CONSTRAINT "RefreshTokens_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Tickets" ADD CONSTRAINT "Tickets_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Tickets" ADD CONSTRAINT "Tickets_bearbeiter_id_fkey" FOREIGN KEY ("bearbeiter_id") REFERENCES "benutzer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Unterlage" ADD CONSTRAINT "Unterlage_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "VerbrauchsausweisGewerbe" ADD CONSTRAINT "VerbrauchsausweisGewerbe_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "VerbrauchsausweisGewerbe" ADD CONSTRAINT "VerbrauchsausweisGewerbe_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "VerbrauchsausweisGewerbe" ADD CONSTRAINT "VerbrauchsausweisGewerbe_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "VerbrauchsausweisWohnen" ADD CONSTRAINT "VerbrauchsausweisWohnen_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "VerbrauchsausweisWohnen" ADD CONSTRAINT "VerbrauchsausweisWohnen_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "VerbrauchsausweisWohnen" ADD CONSTRAINT "VerbrauchsausweisWohnen_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "documenttemplates" ADD CONSTRAINT "benutzer_fk" FOREIGN KEY ("user_id") REFERENCES "benutzer"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "tokens" ADD CONSTRAINT "fk_benutzer_tokens_user_id" FOREIGN KEY ("user_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

View File

@@ -1,44 +0,0 @@
/*
Warnings:
- You are about to drop the column `ausstellungsdatum` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to drop the column `ausweisart` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to drop the column `boxpruefung` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to drop the column `brennstoff_1` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to drop the column `brennstoff_2` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to drop the column `energieeffizienzklasse` on the `Aufnahme` table. All the data in the column will be lost.
- You are about to drop the column `uid` on the `Bild` table. All the data in the column will be lost.
- You are about to drop the column `keller_beheizt` on the `VerbrauchsausweisWohnen` table. All the data in the column will be lost.
*/
-- DropIndex
DROP INDEX "Bild_uid_key";
-- AlterTable
ALTER TABLE "Aufnahme" DROP COLUMN "ausstellungsdatum",
DROP COLUMN "ausweisart",
DROP COLUMN "boxpruefung",
DROP COLUMN "brennstoff_1",
DROP COLUMN "brennstoff_2",
DROP COLUMN "energieeffizienzklasse";
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" ADD COLUMN "ausstellungsdatum" TIMESTAMP(3),
ADD COLUMN "boxpruefung" BOOLEAN DEFAULT false,
ADD COLUMN "energieeffizienzklasse" VARCHAR(5);
-- AlterTable
ALTER TABLE "Bild" DROP COLUMN "uid";
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" ADD COLUMN "ausstellungsdatum" TIMESTAMP(3),
ADD COLUMN "boxpruefung" BOOLEAN DEFAULT false,
ADD COLUMN "energieeffizienzklasse" VARCHAR(5);
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" DROP COLUMN "keller_beheizt",
ADD COLUMN "ausstellungsdatum" TIMESTAMP(3),
ADD COLUMN "boxpruefung" BOOLEAN DEFAULT false,
ADD COLUMN "brennstoff_1" VARCHAR(50),
ADD COLUMN "brennstoff_2" VARCHAR(50),
ADD COLUMN "energieeffizienzklasse" VARCHAR(5);

View File

@@ -1,22 +0,0 @@
/*
Warnings:
- Added the required column `updated_at` to the `BedarfsausweisGewerbe` table without a default value. This is not possible if the table is not empty.
- Added the required column `updated_at` to the `GEGNachweisGewerbe` table without a default value. This is not possible if the table is not empty.
- Added the required column `updated_at` to the `GEGNachweisWohnen` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "nachweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL;
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "nachweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL;
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "nachweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL;

View File

@@ -1,20 +0,0 @@
/*
Warnings:
- You are about to drop the column `alte_ausweis_id` on the `BedarfsausweisWohnen` table. All the data in the column will be lost.
- You are about to drop the column `alte_ausweis_id` on the `VerbrauchsausweisGewerbe` table. All the data in the column will be lost.
- You are about to drop the column `alte_ausweis_id` on the `VerbrauchsausweisWohnen` table. All the data in the column will be lost.
- Made the column `mime` on table `Unterlage` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" DROP COLUMN "alte_ausweis_id";
-- AlterTable
ALTER TABLE "Unterlage" ALTER COLUMN "mime" SET NOT NULL;
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" DROP COLUMN "alte_ausweis_id";
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" DROP COLUMN "alte_ausweis_id";

View File

@@ -1,106 +0,0 @@
/*
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

@@ -8,7 +8,7 @@ CREATE TYPE "Lueftungskonzept" AS ENUM ('Fensterlueftung', 'Schachtlueftung', 'L
CREATE TYPE "BenutzerRolle" AS ENUM ('USER', 'ADMIN');
-- CreateEnum
CREATE TYPE "BilderKategorie" AS ENUM ('Heizung', 'Fenster', 'Gebaeude', 'Daemmung');
CREATE TYPE "BilderKategorie" AS ENUM ('Heizung', 'Fenster', 'Gebaeude', 'Daemmung', 'AnlagenTechnik');
-- CreateEnum
CREATE TYPE "Einpreisungsstatus" AS ENUM ('open', 'canceled', 'pending', 'expired');
@@ -32,26 +32,25 @@ CREATE TYPE "UnterlagenKategorie" AS ENUM ('Grundriss', 'Sonstiges');
CREATE TYPE "Ausstellgrund" AS ENUM ('Neubau', 'Vermietung', 'Verkauf', 'Modernisierung', 'Sonstiges');
-- CreateEnum
CREATE TYPE "Ausweisart" AS ENUM ('VerbrauchsausweisWohnen', 'VerbrauchsausweisGewerbe', 'BedarfsausweisWohnen', 'BedarfsausweisGewerbe', 'GEGNachweisWohnen', 'GEGNachweisBedarfsausweis', 'GEGNachweisGewerbe');
CREATE TYPE "Ausweisart" AS ENUM ('VerbrauchsausweisWohnen', 'VerbrauchsausweisGewerbe', 'BedarfsausweisWohnen', 'BedarfsausweisGewerbe', 'GEGNachweisWohnen', 'GEGNachweisGewerbe');
-- CreateEnum
CREATE TYPE "Service" AS ENUM ('Telefonberatung', 'Aushang', 'Qualitaetsdruck', 'SameDay');
-- CreateTable
CREATE TABLE "Anteilshaber" (
"id" SERIAL NOT NULL,
"benutzer_id" INTEGER NOT NULL,
"id" VARCHAR(10) NOT NULL,
"rolle" VARCHAR,
"privilegien" BIGINT,
"uid" TEXT NOT NULL DEFAULT 'ant-' || gen_random_uuid(),
"objekt_id" INTEGER NOT NULL,
"benutzer_id" TEXT NOT NULL,
"objekt_id" TEXT NOT NULL,
CONSTRAINT "Anteilshaber_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "ApiRequests" (
"id" SERIAL NOT NULL,
"id" VARCHAR(10) NOT NULL,
"date" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ip" VARCHAR(50) NOT NULL,
"method" VARCHAR(10) NOT NULL,
@@ -60,17 +59,15 @@ CREATE TABLE "ApiRequests" (
"responseTime" DOUBLE PRECISION NOT NULL,
"responseSize" INTEGER NOT NULL,
"userAgent" VARCHAR(500) NOT NULL,
"user_id" INTEGER,
"user_id" TEXT,
CONSTRAINT "ApiRequests_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Aufnahme" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'auf-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"ausweisart" "Ausweisart",
"id" VARCHAR(10) NOT NULL,
"benutzer_id" TEXT,
"gebaeudetyp" VARCHAR,
"gebaeudeteil" VARCHAR,
"baujahr_gebaeude" INTEGER[],
@@ -89,12 +86,7 @@ CREATE TABLE "Aufnahme" (
"alternative_warmwasser" BOOLEAN,
"alternative_lueftung" BOOLEAN,
"alternative_kuehlung" BOOLEAN,
"brennstoff_1" VARCHAR(50),
"brennstoff_2" VARCHAR(50),
"boxpruefung" BOOLEAN DEFAULT false,
"energieeffizienzklasse" VARCHAR(5),
"erstellungsdatum" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
"ausstellungsdatum" TIMESTAMP(3),
"zentralheizung" BOOLEAN,
"solarsystem_warmwasser" BOOLEAN,
"warmwasser_rohre_gedaemmt" BOOLEAN,
@@ -125,34 +117,54 @@ CREATE TABLE "Aufnahme" (
"aussenwand_min_12cm_gedaemmt" BOOLEAN,
"dachgeschoss_min_12cm_gedaemmt" BOOLEAN,
"oberste_geschossdecke_min_12cm_gedaemmt" BOOLEAN,
"objekt_id" INTEGER NOT NULL,
"objekt_id" TEXT NOT NULL,
CONSTRAINT "Aufnahme_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "BedarfsausweisGewerbe" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'bag-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"aufnahme_id" INTEGER NOT NULL,
"rechnung_id" INTEGER,
"geg_einpreisung_id" INTEGER,
"id" VARCHAR(10) NOT NULL,
"ausstellgrund" "Ausstellgrund",
"keller_beheizt" BOOLEAN,
"storniert" BOOLEAN DEFAULT false,
"bestellt" BOOLEAN DEFAULT false,
"zurueckgestellt" BOOLEAN DEFAULT false,
"abluftanlage" BOOLEAN DEFAULT false,
"zu_abluftanlage" BOOLEAN DEFAULT false,
"konditionierung_der_zuluft" BOOLEAN DEFAULT false,
"luftheizung" BOOLEAN DEFAULT false,
"hallenheizung" BOOLEAN DEFAULT false,
"dunkelstrahler" BOOLEAN DEFAULT false,
"direktheizung" BOOLEAN DEFAULT false,
"infrarotstrahler" BOOLEAN DEFAULT false,
"fussbodenheizung" BOOLEAN DEFAULT false,
"bauteilaktivierung" BOOLEAN DEFAULT false,
"klimatisierung" BOOLEAN DEFAULT false,
"nachweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"benutzer_id" TEXT,
"aufnahme_id" TEXT NOT NULL,
"rechnung_id" TEXT,
"geg_einpreisung_id" TEXT,
CONSTRAINT "BedarfsausweisGewerbe_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "BedarfsausweisWohnen" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'baw-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"id" VARCHAR(10) NOT NULL,
"benutzer_id" TEXT,
"ausstellgrund" "Ausstellgrund",
"registriernummer" VARCHAR,
"alternative_heizung" BOOLEAN,
"alternative_warmwasser" BOOLEAN,
"alternative_lueftung" BOOLEAN,
"alternative_kuehlung" BOOLEAN,
"energieeffizienzklasse" VARCHAR(5),
"ausstellungsdatum" TIMESTAMP(3),
"boxpruefung" BOOLEAN DEFAULT false,
"anzahl_vollgeschosse" INTEGER,
"geschosshoehe" DOUBLE PRECISION,
"anzahl_gauben" INTEGER,
@@ -208,16 +220,18 @@ CREATE TABLE "BedarfsausweisWohnen" (
"prueftext" VARCHAR(1000),
"beschreibung" TEXT,
"kontrolldatei_angefragt" BOOLEAN DEFAULT false,
"rechnung_id" INTEGER,
"aufnahme_id" INTEGER NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"rechnung_id" TEXT,
"aufnahme_id" TEXT NOT NULL,
CONSTRAINT "BedarfsausweisWohnen_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "benutzer" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'usr-' || gen_random_uuid(),
"id" VARCHAR(10) NOT NULL,
"name" VARCHAR(50),
"vorname" VARCHAR(50),
"email" VARCHAR(255) NOT NULL,
@@ -231,37 +245,36 @@ CREATE TABLE "benutzer" (
"rolle" "BenutzerRolle" NOT NULL DEFAULT 'USER',
"firma" TEXT,
"lex_office_id" TEXT,
"verified" BOOLEAN NOT NULL DEFAULT false,
CONSTRAINT "benutzer_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Bild" (
"id" SERIAL NOT NULL,
"id" VARCHAR(10) NOT NULL,
"kategorie" "BilderKategorie" NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'img-' || gen_random_uuid(),
"aufnahme_id" INTEGER,
"name" TEXT NOT NULL,
"aufnahme_id" TEXT,
CONSTRAINT "Bild_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Event" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'evt-' || gen_random_uuid(),
"id" VARCHAR(10) NOT NULL,
"date" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"title" VARCHAR(255) NOT NULL,
"description" TEXT,
"aufnahme_id" INTEGER NOT NULL,
"benutzer_id" INTEGER,
"aufnahme_id" TEXT NOT NULL,
"benutzer_id" TEXT,
CONSTRAINT "Event_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "GEGEinpreisung" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'gge-' || gen_random_uuid(),
"id" VARCHAR(10) NOT NULL,
"empfaenger" VARCHAR,
"strasse" VARCHAR,
"plz" VARCHAR,
@@ -276,43 +289,47 @@ CREATE TABLE "GEGEinpreisung" (
"versand_ort" VARCHAR,
"versand_zusatzzeile" VARCHAR,
"status" "Einpreisungsstatus" NOT NULL,
"benutzer_id" INTEGER,
"benutzer_id" TEXT,
CONSTRAINT "GEGEinpreisung_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "GEGNachweisGewerbe" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'gnw-' || gen_random_uuid(),
"id" VARCHAR(10) NOT NULL,
"ausstellgrund" "Ausstellgrund",
"keller_beheizt" BOOLEAN,
"storniert" BOOLEAN DEFAULT false,
"bestellt" BOOLEAN DEFAULT false,
"zurueckgestellt" BOOLEAN DEFAULT false,
"beschreibung" TEXT,
"benutzer_id" INTEGER,
"aufnahme_id" INTEGER NOT NULL,
"rechnung_id" INTEGER,
"geg_einpreisung_id" INTEGER,
"nachweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"benutzer_id" TEXT,
"aufnahme_id" TEXT NOT NULL,
"rechnung_id" TEXT,
"geg_einpreisung_id" TEXT,
CONSTRAINT "GEGNachweisGewerbe_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "GEGNachweisWohnen" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'gnw-' || gen_random_uuid(),
"id" VARCHAR(10) NOT NULL,
"ausstellgrund" "Ausstellgrund",
"keller_beheizt" BOOLEAN,
"storniert" BOOLEAN DEFAULT false,
"bestellt" BOOLEAN DEFAULT false,
"zurueckgestellt" BOOLEAN DEFAULT false,
"beschreibung" TEXT,
"benutzer_id" INTEGER,
"aufnahme_id" INTEGER NOT NULL,
"rechnung_id" INTEGER,
"geg_einpreisung_id" INTEGER,
"nachweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"benutzer_id" TEXT,
"aufnahme_id" TEXT NOT NULL,
"rechnung_id" TEXT,
"geg_einpreisung_id" TEXT,
CONSTRAINT "GEGNachweisWohnen_pkey" PRIMARY KEY ("id")
);
@@ -330,15 +347,14 @@ CREATE TABLE "Klimafaktoren" (
-- CreateTable
CREATE TABLE "Objekt" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'obj-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"id" VARCHAR(10) NOT NULL,
"latitude" DOUBLE PRECISION,
"longitude" DOUBLE PRECISION,
"plz" VARCHAR(5),
"ort" VARCHAR(50),
"adresse" VARCHAR(100),
"erstellungsdatum" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
"benutzer_id" TEXT,
CONSTRAINT "Objekt_pkey" PRIMARY KEY ("id")
);
@@ -358,9 +374,7 @@ CREATE TABLE "Postleitzahlen" (
-- CreateTable
CREATE TABLE "Rechnung" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'inv-' || gen_random_uuid(),
"benutzer_id" INTEGER NOT NULL,
"id" VARCHAR(10) NOT NULL,
"empfaenger" VARCHAR,
"strasse" VARCHAR,
"plz" VARCHAR,
@@ -377,12 +391,13 @@ CREATE TABLE "Rechnung" (
"bezahlmethode" "Bezahlmethoden" NOT NULL,
"status" "Rechnungsstatus" NOT NULL,
"services" "Service"[],
"ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"betrag" DOUBLE PRECISION NOT NULL,
"erstellt_am" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"bezahlt_am" TIMESTAMP(3),
"storniert_am" TIMESTAMP(3),
"transaktions_referenz" VARCHAR,
"partner_code" TEXT,
"benutzer_id" TEXT NOT NULL,
CONSTRAINT "Rechnung_pkey" PRIMARY KEY ("id")
);
@@ -390,19 +405,17 @@ CREATE TABLE "Rechnung" (
-- CreateTable
CREATE TABLE "RefreshTokens" (
"id" SERIAL NOT NULL,
"benutzer_id" INTEGER NOT NULL,
"token" TEXT NOT NULL,
"ip" TEXT NOT NULL,
"expiry" TIMESTAMP(3) NOT NULL,
"benutzer_id" TEXT NOT NULL,
CONSTRAINT "RefreshTokens_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Tickets" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'tkt-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"id" VARCHAR(10) NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3),
"deleted_at" TIMESTAMP(3),
@@ -411,35 +424,31 @@ CREATE TABLE "Tickets" (
"beschreibung" TEXT NOT NULL,
"metadata" JSONB,
"email" TEXT NOT NULL,
"bearbeiter_id" INTEGER,
"bearbeiter_id" TEXT,
"prioritaet" INTEGER DEFAULT 0,
"benutzer_id" TEXT,
CONSTRAINT "Tickets_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Unterlage" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'pln-' || gen_random_uuid(),
"id" VARCHAR(10) NOT NULL,
"name" TEXT,
"kategorie" TEXT,
"mime" TEXT,
"aufnahme_id" INTEGER,
"mime" TEXT NOT NULL,
"aufnahme_id" TEXT,
CONSTRAINT "Unterlage_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "VerbrauchsausweisGewerbe" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'vag-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"id" VARCHAR(10) NOT NULL,
"ausstellgrund" "Ausstellgrund",
"registriernummer" VARCHAR,
"zusaetzliche_heizquelle" BOOLEAN,
"brennstoff_1" VARCHAR(50),
"einheit_1" VARCHAR(50),
"brennstoff_2" VARCHAR(50),
"einheit_2" VARCHAR(50),
"startdatum" TIMESTAMP(6),
"verbrauch_1" INTEGER,
@@ -448,6 +457,11 @@ CREATE TABLE "VerbrauchsausweisGewerbe" (
"verbrauch_4" INTEGER,
"verbrauch_5" INTEGER,
"verbrauch_6" INTEGER,
"brennstoff_1" VARCHAR(50),
"brennstoff_2" VARCHAR(50),
"energieeffizienzklasse" VARCHAR(5),
"ausstellungsdatum" TIMESTAMP(3),
"boxpruefung" BOOLEAN DEFAULT false,
"strom_1" INTEGER,
"strom_2" INTEGER,
"strom_3" INTEGER,
@@ -466,6 +480,7 @@ CREATE TABLE "VerbrauchsausweisGewerbe" (
"alternative_lueftung" BOOLEAN,
"alternative_kuehlung" BOOLEAN,
"warmwasser_enthalten" BOOLEAN,
"warmwasser_anteil_bekannt" BOOLEAN,
"anteil_warmwasser_1" DOUBLE PRECISION,
"anteil_warmwasser_2" DOUBLE PRECISION,
"ausgestellt" BOOLEAN DEFAULT false,
@@ -475,22 +490,29 @@ CREATE TABLE "VerbrauchsausweisGewerbe" (
"prueftext" VARCHAR(1000),
"beschreibung" TEXT,
"kontrolldatei_angefragt" BOOLEAN DEFAULT false,
"rechnung_id" INTEGER,
"aufnahme_id" INTEGER NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"benutzer_id" TEXT,
"rechnung_id" TEXT,
"aufnahme_id" TEXT NOT NULL,
CONSTRAINT "VerbrauchsausweisGewerbe_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "VerbrauchsausweisWohnen" (
"id" SERIAL NOT NULL,
"uid" TEXT NOT NULL DEFAULT 'vaw-' || gen_random_uuid(),
"benutzer_id" INTEGER,
"id" VARCHAR(10) NOT NULL,
"ausstellgrund" "Ausstellgrund",
"registriernummer" VARCHAR,
"zusaetzliche_heizquelle" BOOLEAN,
"einheit_1" VARCHAR(50),
"einheit_2" VARCHAR(50),
"brennstoff_1" VARCHAR(50),
"brennstoff_2" VARCHAR(50),
"energieeffizienzklasse" VARCHAR(5),
"ausstellungsdatum" TIMESTAMP(3),
"boxpruefung" BOOLEAN DEFAULT false,
"startdatum" TIMESTAMPTZ(6),
"verbrauch_1" INTEGER,
"verbrauch_2" INTEGER,
@@ -500,7 +522,6 @@ CREATE TABLE "VerbrauchsausweisWohnen" (
"verbrauch_6" INTEGER,
"warmwasser_enthalten" BOOLEAN,
"warmwasser_anteil_bekannt" BOOLEAN,
"keller_beheizt" BOOLEAN,
"faktorKeller" DOUBLE PRECISION,
"alternative_heizung" BOOLEAN,
"alternative_warmwasser" BOOLEAN,
@@ -515,8 +536,12 @@ CREATE TABLE "VerbrauchsausweisWohnen" (
"prueftext" VARCHAR(1000),
"beschreibung" TEXT,
"kontrolldatei_angefragt" BOOLEAN DEFAULT false,
"rechnung_id" INTEGER,
"aufnahme_id" INTEGER NOT NULL,
"ausweistyp" "AusweisTyp" NOT NULL DEFAULT 'Standard',
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"benutzer_id" TEXT,
"rechnung_id" TEXT,
"aufnahme_id" TEXT NOT NULL,
CONSTRAINT "VerbrauchsausweisWohnen_pkey" PRIMARY KEY ("id")
);
@@ -527,7 +552,7 @@ CREATE TABLE "documenttemplates" (
"name" VARCHAR(100) NOT NULL,
"shortdescription" VARCHAR(100) NOT NULL,
"longdescription" VARCHAR(5000) NOT NULL,
"user_id" INTEGER NOT NULL,
"user_id" TEXT NOT NULL,
"is_private" BOOLEAN NOT NULL DEFAULT true,
"documenttype" INTEGER NOT NULL,
"filename" VARCHAR(100) NOT NULL,
@@ -551,7 +576,7 @@ CREATE TABLE "documenttypes" (
CREATE TABLE "tokens" (
"id" SERIAL NOT NULL,
"token" VARCHAR(36) NOT NULL,
"user_id" INTEGER NOT NULL,
"user_id" TEXT NOT NULL,
"date_created" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"last_used" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"times_used" INTEGER NOT NULL DEFAULT 0,
@@ -561,13 +586,16 @@ CREATE TABLE "tokens" (
);
-- CreateIndex
CREATE UNIQUE INDEX "Anteilshaber_uid_key" ON "Anteilshaber"("uid");
CREATE UNIQUE INDEX "Anteilshaber_id_key" ON "Anteilshaber"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Aufnahme_uid_key" ON "Aufnahme"("uid");
CREATE UNIQUE INDEX "ApiRequests_id_key" ON "ApiRequests"("id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisGewerbe_uid_key" ON "BedarfsausweisGewerbe"("uid");
CREATE UNIQUE INDEX "Aufnahme_id_key" ON "Aufnahme"("id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisGewerbe_id_key" ON "BedarfsausweisGewerbe"("id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisGewerbe_aufnahme_id_key" ON "BedarfsausweisGewerbe"("aufnahme_id");
@@ -579,7 +607,7 @@ CREATE UNIQUE INDEX "BedarfsausweisGewerbe_rechnung_id_key" ON "BedarfsausweisGe
CREATE UNIQUE INDEX "BedarfsausweisGewerbe_geg_einpreisung_id_key" ON "BedarfsausweisGewerbe"("geg_einpreisung_id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisWohnen_uid_key" ON "BedarfsausweisWohnen"("uid");
CREATE UNIQUE INDEX "BedarfsausweisWohnen_id_key" ON "BedarfsausweisWohnen"("id");
-- CreateIndex
CREATE UNIQUE INDEX "BedarfsausweisWohnen_rechnung_id_key" ON "BedarfsausweisWohnen"("rechnung_id");
@@ -588,22 +616,22 @@ CREATE UNIQUE INDEX "BedarfsausweisWohnen_rechnung_id_key" ON "BedarfsausweisWoh
CREATE UNIQUE INDEX "BedarfsausweisWohnen_aufnahme_id_key" ON "BedarfsausweisWohnen"("aufnahme_id");
-- CreateIndex
CREATE UNIQUE INDEX "benutzer_uid_key" ON "benutzer"("uid");
CREATE UNIQUE INDEX "benutzer_id_key" ON "benutzer"("id");
-- CreateIndex
CREATE UNIQUE INDEX "benutzer_email_idx" ON "benutzer"("email");
-- CreateIndex
CREATE UNIQUE INDEX "Bild_uid_key" ON "Bild"("uid");
CREATE UNIQUE INDEX "Bild_id_key" ON "Bild"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Event_uid_key" ON "Event"("uid");
CREATE UNIQUE INDEX "Event_id_key" ON "Event"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGEinpreisung_uid_key" ON "GEGEinpreisung"("uid");
CREATE UNIQUE INDEX "GEGEinpreisung_id_key" ON "GEGEinpreisung"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGNachweisGewerbe_uid_key" ON "GEGNachweisGewerbe"("uid");
CREATE UNIQUE INDEX "GEGNachweisGewerbe_id_key" ON "GEGNachweisGewerbe"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGNachweisGewerbe_aufnahme_id_key" ON "GEGNachweisGewerbe"("aufnahme_id");
@@ -615,7 +643,7 @@ CREATE UNIQUE INDEX "GEGNachweisGewerbe_rechnung_id_key" ON "GEGNachweisGewerbe"
CREATE UNIQUE INDEX "GEGNachweisGewerbe_geg_einpreisung_id_key" ON "GEGNachweisGewerbe"("geg_einpreisung_id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGNachweisWohnen_uid_key" ON "GEGNachweisWohnen"("uid");
CREATE UNIQUE INDEX "GEGNachweisWohnen_id_key" ON "GEGNachweisWohnen"("id");
-- CreateIndex
CREATE UNIQUE INDEX "GEGNachweisWohnen_aufnahme_id_key" ON "GEGNachweisWohnen"("aufnahme_id");
@@ -630,10 +658,10 @@ CREATE UNIQUE INDEX "GEGNachweisWohnen_geg_einpreisung_id_key" ON "GEGNachweisWo
CREATE UNIQUE INDEX "Klimafaktoren_plz_month_year_key" ON "Klimafaktoren"("plz", "month", "year");
-- CreateIndex
CREATE UNIQUE INDEX "Objekt_uid_key" ON "Objekt"("uid");
CREATE UNIQUE INDEX "Objekt_id_key" ON "Objekt"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Rechnung_uid_key" ON "Rechnung"("uid");
CREATE UNIQUE INDEX "Rechnung_id_key" ON "Rechnung"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Rechnung_transaktions_referenz_key" ON "Rechnung"("transaktions_referenz");
@@ -642,13 +670,13 @@ CREATE UNIQUE INDEX "Rechnung_transaktions_referenz_key" ON "Rechnung"("transakt
CREATE UNIQUE INDEX "RefreshTokens_token_key" ON "RefreshTokens"("token");
-- CreateIndex
CREATE UNIQUE INDEX "Tickets_uid_key" ON "Tickets"("uid");
CREATE UNIQUE INDEX "Tickets_id_key" ON "Tickets"("id");
-- CreateIndex
CREATE UNIQUE INDEX "Unterlage_uid_key" ON "Unterlage"("uid");
CREATE UNIQUE INDEX "Unterlage_id_key" ON "Unterlage"("id");
-- CreateIndex
CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_uid_key" ON "VerbrauchsausweisGewerbe"("uid");
CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_id_key" ON "VerbrauchsausweisGewerbe"("id");
-- CreateIndex
CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_rechnung_id_key" ON "VerbrauchsausweisGewerbe"("rechnung_id");
@@ -657,7 +685,7 @@ CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_rechnung_id_key" ON "Verbrauchsaus
CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_aufnahme_id_key" ON "VerbrauchsausweisGewerbe"("aufnahme_id");
-- CreateIndex
CREATE UNIQUE INDEX "VerbrauchsausweisWohnen_uid_key" ON "VerbrauchsausweisWohnen"("uid");
CREATE UNIQUE INDEX "VerbrauchsausweisWohnen_id_key" ON "VerbrauchsausweisWohnen"("id");
-- CreateIndex
CREATE UNIQUE INDEX "VerbrauchsausweisWohnen_rechnung_id_key" ON "VerbrauchsausweisWohnen"("rechnung_id");

View File

@@ -49,6 +49,7 @@ model Rechnung {
bezahlt_am DateTime?
storniert_am DateTime?
transaktions_referenz String? @unique @db.VarChar
partner_code String?
benutzer_id String
benutzer Benutzer @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)