grant: Handle update constraints better

This commit is contained in:
Tom Wiesing 2023-01-05 13:16:13 +01:00
parent 8b55fd74f9
commit f3939c5016
No known key found for this signature in database
2 changed files with 11 additions and 8 deletions

View file

@ -7,9 +7,9 @@ const GrantTable = "grant"
type Grant struct {
Pk uint `gorm:"column:pk;primaryKey"`
User string `gorm:"column:user;not null;uniqueIndex:user_slug"` // (distillery) username
Slug string `gorm:"column:slug;not null;uniqueIndex:user_slug"` // (distillery) instance slug
User string `gorm:"column:user;not null;index:user_slug,unique"` // (distillery) username
Slug string `gorm:"column:slug;not null;index:user_slug;index:drupal_slug"` // (distillery) instance slug
DrupalUsername string `gorm:"column:drupal_user;not null"` // drupal username
DrupalAdminRole bool `gorm:"column:admin;not null"` // drupal admin rights
DrupalUsername string `gorm:"column:drupal_user;not null;index:drupal_slug,unique"` // drupal username
DrupalAdminRole bool `gorm:"column:admin;not null"` // drupal admin rights
}