Some changes in manage.ts --> 3 user.ts, song.ts, songbook.ts

Aufspaltung auf 3 Dateien, aber man muss noch weiter arbeiten

(Task: Von better-sqlite3 --> ORM)
This commit is contained in:
rudi committed 2026-07-30 14:13:02 +02:00
1 parent d395308c6d
commit d03ff9d26d
7 files changed
+242 -50

No files matched your search

@@ -0,0 +1,27 @@
/*
Warnings:
- The primary key for the `SongBookSongs` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `SongBookId` on the `SongBookSongs` table. All the data in the column will be lost.
- You are about to drop the column `SongId` on the `SongBookSongs` table. All the data in the column will be lost.
- Added the required column `songBookId` to the `SongBookSongs` table without a default value. This is not possible if the table is not empty.
- Added the required column `songId` to the `SongBookSongs` 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_SongBookSongs" (
"songBookId" INTEGER NOT NULL,
"songId" INTEGER NOT NULL,
"songNumber" INTEGER NOT NULL,
PRIMARY KEY ("songBookId", "songId"),
CONSTRAINT "SongBookSongs_songId_fkey" FOREIGN KEY ("songId") REFERENCES "Song" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "SongBookSongs_songBookId_fkey" FOREIGN KEY ("songBookId") REFERENCES "SongBook" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
INSERT INTO "new_SongBookSongs" ("songNumber") SELECT "songNumber" FROM "SongBookSongs";
DROP TABLE "SongBookSongs";
ALTER TABLE "new_SongBookSongs" RENAME TO "SongBookSongs";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;