Plaetze in admin

This commit is contained in:
titver968
2025-05-09 09:54:20 +02:00
parent 83ce0c3def
commit 3dd73a98ca
7 changed files with 154 additions and 47 deletions

View File

@@ -0,0 +1,20 @@
/*
Warnings:
- Added the required column `plaetze` to the `Dienststelle` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Dienststelle" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"plaetze" INTEGER NOT NULL
);
INSERT INTO "new_Dienststelle" ("id", "name") SELECT "id", "name" FROM "Dienststelle";
DROP TABLE "Dienststelle";
ALTER TABLE "new_Dienststelle" RENAME TO "Dienststelle";
CREATE UNIQUE INDEX "Dienststelle_name_key" ON "Dienststelle"("name");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

Binary file not shown.

View File

@@ -17,6 +17,7 @@ model Admin {
model Dienststelle {
id Int @id @default(autoincrement())
name String @unique
plaetze Int
anmeldungenWunsch1 Anmeldung[] @relation("Wunsch1")
anmeldungenWunsch2 Anmeldung[] @relation("Wunsch2")
anmeldungenWunsch3 Anmeldung[] @relation("Wunsch3")
@@ -56,4 +57,4 @@ model PdfDatei {
pfad String
anmeldung Anmeldung @relation("AnmeldungPdfs", fields: [anmeldungId], references: [id])
anmeldungId Int
}
}