-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_PdfDatei" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "pfad" TEXT NOT NULL,
    "anmeldungId" INTEGER NOT NULL,
    CONSTRAINT "PdfDatei_anmeldungId_fkey" FOREIGN KEY ("anmeldungId") REFERENCES "anmeldungen" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
INSERT INTO "new_PdfDatei" ("anmeldungId", "id", "pfad") SELECT "anmeldungId", "id", "pfad" FROM "PdfDatei";
DROP TABLE "PdfDatei";
ALTER TABLE "new_PdfDatei" RENAME TO "PdfDatei";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
