1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: migrate to latest gorm version

refactor: language mappings implementation
This commit is contained in:
Ferdinand Mütsch
2020-11-01 20:14:10 +01:00
parent 755cabb5f4
commit 8efc3854ab
36 changed files with 549 additions and 545 deletions

View File

@ -0,0 +1,17 @@
package models
type LanguageMapping struct {
ID uint `json:"id" gorm:"primary_key"`
User *User `json:"-" gorm:"not null"`
UserID string `json:"-" gorm:"not null; index:idx_language_mapping_user; uniqueIndex:idx_language_mapping_composite"`
Extension string `json:"extension" gorm:"uniqueIndex:idx_language_mapping_composite"`
Language string `json:"language"`
}
func validateLanguage(language string) bool {
return len(language) >= 1
}
func validateExtension(extension string) bool {
return len(extension) >= 1
}