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

+7 -10
View File
@@ -1,7 +1,4 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Get a free hosted Postgres database in seconds: `npx create-db`
generator client {
provider = "prisma-client"
@@ -24,7 +21,7 @@ model Song {
id Int @id @default(autoincrement())
title String @unique
songBookSongs SongBookSongs[]
songBooks SongBookSongs[]
}
model SongBook {
@@ -32,16 +29,16 @@ model SongBook {
title String @unique
language String
songBookSongs SongBookSongs[]
songs SongBookSongs[]
}
model SongBookSongs {
SongBookId Int
SongId Int
songBookId Int
songId Int
songNumber Int
song Song @relation(fields: [SongId], references: [id], onDelete: Cascade)
book SongBook @relation(fields: [SongBookId], references: [id], onDelete: Cascade)
song Song @relation(fields: [songId], references: [id], onDelete: Cascade)
book SongBook @relation(fields: [songBookId], references: [id], onDelete: Cascade)
@@id([SongBookId, SongId])
@@id([songBookId, songId])
}