Merge e475d7c52b42e823ae8af9335ec02b028b74f104 into b46ca62c1895f8ea8911d148809899e918ad6d96

This commit is contained in:
msmarino 2015-09-10 22:55:07 +00:00
commit 161772076f

View File

@ -1180,6 +1180,16 @@ type Animal struct {
} }
``` ```
Associations on non-standard column names must be defined using `foreignkey` on the associated field:
```go
AnimalId int64 `gorm:"column:beast_id;primary_key"`
Birthday time.Time `gorm:"column:day_of_the_beast"`
Age int64 `gorm:"column:age_of_the_beast"`
OwnerID int64 `gorm:"column:owner"`
Owner Owner `gorm:"foreignkey:OwnerID"`
```
## Composite Primary Key ## Composite Primary Key
```go ```go