Anmeldung noch Fehlerhaft

This commit is contained in:
titver968
2025-06-04 16:32:38 +02:00
parent 177eb03179
commit 355dbf8bf6
13 changed files with 17187 additions and 65 deletions

View File

@@ -0,0 +1,46 @@
/*
Warnings:
- You are about to drop the column `zeitraum` on the `Anmeldung` table. All the data in the column will be lost.
- Added the required column `noteDeutsch` to the `Anmeldung` table without a default value. This is not possible if the table is not empty.
- Added the required column `noteMathe` to the `Anmeldung` table without a default value. This is not possible if the table is not empty.
- Added the required column `sozialverhalten` to the `Anmeldung` table without a default value. This is not possible if the table is not empty.
- Made the column `praktikumId` on table `Anmeldung` required. This step will fail if there are existing NULL values in that column.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Anmeldung" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"anrede" TEXT NOT NULL,
"vorname" TEXT NOT NULL,
"nachname" TEXT NOT NULL,
"geburtsdatum" TEXT NOT NULL,
"strasse" TEXT NOT NULL,
"hausnummer" TEXT NOT NULL,
"ort" TEXT NOT NULL,
"plz" TEXT NOT NULL,
"telefon" TEXT NOT NULL,
"email" TEXT NOT NULL,
"noteDeutsch" INTEGER NOT NULL,
"noteMathe" INTEGER NOT NULL,
"sozialverhalten" TEXT NOT NULL,
"schulart" TEXT NOT NULL,
"motivation" TEXT NOT NULL,
"praktikumId" INTEGER NOT NULL,
"wunsch1Id" INTEGER NOT NULL,
"wunsch2Id" INTEGER NOT NULL,
"wunsch3Id" INTEGER NOT NULL,
"timestamp" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Anmeldung_praktikumId_fkey" FOREIGN KEY ("praktikumId") REFERENCES "Praktikumszeitraum" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Anmeldung_wunsch1Id_fkey" FOREIGN KEY ("wunsch1Id") REFERENCES "Dienststelle" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Anmeldung_wunsch2Id_fkey" FOREIGN KEY ("wunsch2Id") REFERENCES "Dienststelle" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Anmeldung_wunsch3Id_fkey" FOREIGN KEY ("wunsch3Id") REFERENCES "Dienststelle" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Anmeldung" ("anrede", "email", "geburtsdatum", "hausnummer", "id", "motivation", "nachname", "ort", "plz", "praktikumId", "schulart", "strasse", "telefon", "timestamp", "vorname", "wunsch1Id", "wunsch2Id", "wunsch3Id") SELECT "anrede", "email", "geburtsdatum", "hausnummer", "id", "motivation", "nachname", "ort", "plz", "praktikumId", "schulart", "strasse", "telefon", "timestamp", "vorname", "wunsch1Id", "wunsch2Id", "wunsch3Id" FROM "Anmeldung";
DROP TABLE "Anmeldung";
ALTER TABLE "new_Anmeldung" RENAME TO "Anmeldung";
CREATE UNIQUE INDEX "Anmeldung_email_key" ON "Anmeldung"("email");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -0,0 +1,35 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Anmeldung" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"anrede" TEXT NOT NULL,
"vorname" TEXT NOT NULL,
"nachname" TEXT NOT NULL,
"geburtsdatum" TEXT NOT NULL,
"strasse" TEXT NOT NULL,
"hausnummer" TEXT NOT NULL,
"ort" TEXT NOT NULL,
"plz" TEXT NOT NULL,
"telefon" TEXT NOT NULL,
"email" TEXT NOT NULL,
"noteDeutsch" INTEGER NOT NULL,
"noteMathe" INTEGER NOT NULL,
"sozialverhalten" TEXT NOT NULL,
"schulart" TEXT NOT NULL,
"motivation" TEXT NOT NULL,
"praktikumId" INTEGER NOT NULL,
"wunsch1Id" INTEGER NOT NULL,
"wunsch2Id" INTEGER NOT NULL,
"wunsch3Id" INTEGER NOT NULL,
"timestamp" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Anmeldung_wunsch1Id_fkey" FOREIGN KEY ("wunsch1Id") REFERENCES "Dienststelle" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Anmeldung_wunsch2Id_fkey" FOREIGN KEY ("wunsch2Id") REFERENCES "Dienststelle" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Anmeldung_wunsch3Id_fkey" FOREIGN KEY ("wunsch3Id") REFERENCES "Dienststelle" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Anmeldung" ("anrede", "email", "geburtsdatum", "hausnummer", "id", "motivation", "nachname", "noteDeutsch", "noteMathe", "ort", "plz", "praktikumId", "schulart", "sozialverhalten", "strasse", "telefon", "timestamp", "vorname", "wunsch1Id", "wunsch2Id", "wunsch3Id") SELECT "anrede", "email", "geburtsdatum", "hausnummer", "id", "motivation", "nachname", "noteDeutsch", "noteMathe", "ort", "plz", "praktikumId", "schulart", "sozialverhalten", "strasse", "telefon", "timestamp", "vorname", "wunsch1Id", "wunsch2Id", "wunsch3Id" FROM "Anmeldung";
DROP TABLE "Anmeldung";
ALTER TABLE "new_Anmeldung" RENAME TO "Anmeldung";
CREATE UNIQUE INDEX "Anmeldung_email_key" ON "Anmeldung"("email");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

BIN
prisma/praktika.db-journal Normal file

Binary file not shown.

View File

@@ -28,37 +28,37 @@ model Praktikumszeitraum {
bezeichnung String @unique // z.B. "Frühjahr 2025"
startDatum DateTime
endDatum DateTime
anmeldungen Anmeldung[]
}
model Anmeldung {
id Int @id @default(autoincrement())
anrede String
vorname String
nachname String
geburtsdatum String
strasse String
hausnummer String
ort String
plz String
telefon String
email String @unique
schulart String
motivation String
id Int @id @default(autoincrement())
anrede String
vorname String
nachname String
geburtsdatum String
strasse String
hausnummer String
ort String
plz String
telefon String
email String @unique
noteDeutsch Int
noteMathe Int
sozialverhalten String
schulart String
motivation String
praktikumId Int
praktikum Praktikumszeitraum @relation(fields: [praktikumId], references: [id])
praktikumId Int
wunsch1Id Int
wunsch2Id Int
wunsch3Id Int
wunsch1Id Int
wunsch2Id Int
wunsch3Id Int
wunsch1 Dienststelle @relation("Wunsch1", fields: [wunsch1Id], references: [id])
wunsch2 Dienststelle @relation("Wunsch2", fields: [wunsch2Id], references: [id])
wunsch3 Dienststelle @relation("Wunsch3", fields: [wunsch3Id], references: [id])
wunsch1 Dienststelle @relation("Wunsch1", fields: [wunsch1Id], references: [id])
wunsch2 Dienststelle @relation("Wunsch2", fields: [wunsch2Id], references: [id])
wunsch3 Dienststelle @relation("Wunsch3", fields: [wunsch3Id], references: [id])
timestamp DateTime @default(now())
timestamp DateTime @default(now())
pdfs PdfDatei[] @relation("AnmeldungPdfs")
}