Update on Songbooksongs number

Number of Song in a Songbook is not number anymore but string
so "3a" would work.
This commit is contained in:
Rudi committed 2026-08-27 15:00:04 +02:00
1 parent b060ab29cf
commit 496a70ffed
2 files changed
+18 -1

No files matched your search

@@ -0,0 +1,17 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_SongBookSongs" (
"songBookId" INTEGER NOT NULL,
"songId" INTEGER NOT NULL,
"songNumber" TEXT 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" ("songBookId", "songId", "songNumber") SELECT "songBookId", "songId", "songNumber" FROM "SongBookSongs";
DROP TABLE "SongBookSongs";
ALTER TABLE "new_SongBookSongs" RENAME TO "SongBookSongs";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
+1 -1
View File
@@ -35,7 +35,7 @@ model SongBook {
model SongBookSongs {
songBookId Int
songId Int
songNumber Int
songNumber String
song Song @relation(fields: [songId], references: [id], onDelete: Cascade)
book SongBook @relation(fields: [songBookId], references: [id], onDelete: Cascade)