Aufspaltung auf 3 Dateien, aber man muss noch weiter arbeiten (Task: Von better-sqlite3 --> ORM)
45 lines
909 B
Plaintext
45 lines
909 B
Plaintext
|
|
|
|
generator client {
|
|
provider = "prisma-client"
|
|
output = "../lib/generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
username String @unique
|
|
password String
|
|
role String @default("user")
|
|
name String?
|
|
}
|
|
|
|
model Song {
|
|
id Int @id @default(autoincrement())
|
|
title String @unique
|
|
|
|
songBooks SongBookSongs[]
|
|
}
|
|
|
|
model SongBook {
|
|
id Int @id @default(autoincrement())
|
|
title String @unique
|
|
language String
|
|
|
|
songs SongBookSongs[]
|
|
}
|
|
|
|
model SongBookSongs {
|
|
songBookId Int
|
|
songId Int
|
|
songNumber Int
|
|
|
|
song Song @relation(fields: [songId], references: [id], onDelete: Cascade)
|
|
book SongBook @relation(fields: [songBookId], references: [id], onDelete: Cascade)
|
|
|
|
@@id([songBookId, songId])
|
|
}
|