1
Fork 0

Further gorm attributes cleanup

This commit is contained in:
viktorstrate 2021-01-19 18:35:19 +01:00
parent fc515aa375
commit 2c230d917a
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ type Media struct {
SideCarHash *string `gorm:"unique"`
// Only used internally
CounterpartPath *string `gorm:-`
CounterpartPath *string `gorm:"-"`
}
func (Media) TableName() string {

View File

@ -15,7 +15,7 @@ import (
type User struct {
Model
Username string `gorm:"unique;size:128"`
Password *string `gorm:"size:256`
Password *string `gorm:"size:256"`
// RootPath string `gorm:"size:512`
Albums []Album `gorm:"many2many:user_albums"`
Admin bool `gorm:"default:false"`
@ -32,7 +32,7 @@ type AccessToken struct {
Model
UserID int `gorm:"not null;index"`
User User `gorm:"constraint:OnDelete:CASCADE;"`
Value string `gorm:"not null, size:24`
Value string `gorm:"not null;size:24;index"`
Expire time.Time `gorm:"not null;index"`
}