transcode pref: use uniq user & client, not client & profile

closes #48
This commit is contained in:
sentriz
2020-03-24 14:48:30 +00:00
parent 52d2dbcce9
commit be3cf9a04e
3 changed files with 45 additions and 3 deletions

View File

@@ -203,7 +203,7 @@ func (p *PlayQueue) SetItems(items []int) {
type TranscodePreference struct {
User *User
UserID int `sql:"default: null; type:int REFERENCES users(id) ON DELETE CASCADE"`
Client string `gorm:"not null; unique_index:idx_client_profile" sql:"default: null"`
Profile string `gorm:"not null; unique_index:idx_client_profile" sql:"default: null"`
UserID int `gorm:"not null; unique_index:idx_user_id_client" sql:"default: null; type:int REFERENCES users(id) ON DELETE CASCADE"`
Client string `gorm:"not null; unique_index:idx_user_id_client" sql:"default: null"`
Profile string `gorm:"not null" sql:"default: null"`
}