Files
psalmtafel-webservice/prisma/schema.prisma
T
rudi 4ccd860814 Database-Layout
Das Datanbankschema wurde an das alte angepasst.
!!Hinzugefügt wurde 'User'!!
2026-07-30 11:48:00 +02:00

48 lines
1.1 KiB
Plaintext

// 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"
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
songBookSongs SongBookSongs[]
}
model SongBook {
id Int @id @default(autoincrement())
title String @unique
language String
songBookSongs 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])
}