Feature/adc/#50 users settings route (#89)
* #50 - migration 20221023123919_ + route settings * #50 - migration 20221023123919_ + route settings * #50 - settings creation at user creation + update migration * changed settings acces from by id to userId * deleting the user results in deleting it's associated userSettings row * pr fixes + robot tests + other minor fixes * removed useless comments * added settings endpoint to /auth/me and automated creation to /register * clean code before merge
This commit is contained in:
@@ -10,15 +10,30 @@ datasource db {
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
password String
|
||||
email String
|
||||
isGuest Boolean @default(false)
|
||||
partyPlayed Int @default(0)
|
||||
LessonHistory LessonHistory[]
|
||||
SongHistory SongHistory[]
|
||||
searchHistory SearchHistory[]
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
password String
|
||||
email String
|
||||
isGuest Boolean @default(false)
|
||||
partyPlayed Int @default(0)
|
||||
LessonHistory LessonHistory[]
|
||||
SongHistory SongHistory[]
|
||||
searchHistory SearchHistory[]
|
||||
settings UserSettings?
|
||||
}
|
||||
|
||||
model UserSettings {
|
||||
id Int @id @default(autoincrement())
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
userId Int @unique
|
||||
pushNotification Boolean @default(true)
|
||||
emailNotification Boolean @default(true)
|
||||
trainingNotification Boolean @default(true)
|
||||
newSongNotification Boolean @default(true)
|
||||
recommendations Boolean @default(true)
|
||||
weeklyReport Boolean @default(true)
|
||||
leaderBoard Boolean @default(true)
|
||||
showActivity Boolean @default(true)
|
||||
}
|
||||
|
||||
model SearchHistory {
|
||||
|
||||
Reference in New Issue
Block a user