mirror of https://github.com/go-gorm/gorm.git
Update README
This commit is contained in:
parent
c842d46b66
commit
6d7d892af7
|
@ -600,6 +600,14 @@ type Cart struct {
|
||||||
func (c Cart) TableName() string {
|
func (c Cart) TableName() string {
|
||||||
return "shopping_cart"
|
return "shopping_cart"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u User) TableName() string {
|
||||||
|
if u.Role == "admin" {
|
||||||
|
return "admin_users"
|
||||||
|
} else {
|
||||||
|
return "users"
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run Raw SQl
|
## Run Raw SQl
|
||||||
|
|
Loading…
Reference in New Issue