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:
Amaury
2023-04-12 05:32:41 +03:00
committed by GitHub
parent e43a8fd111
commit a26efefd01
15 changed files with 278 additions and 16 deletions
+24 -9
View File
@@ -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 {