View definition

(*DB).AddForeignKey

Defined in github.com/jinzhu/gorm/main.go

Description

AddForeignKey Add foreign key to the given scope, e.g:

db.Model(&User{}).AddForeignKey("city_id", "cities(id)", "RESTRICT", "RESTRICT")