Added note about foreign keys, gorm and sqlite.

This commit is contained in:
A. Svensson 2015-11-03 22:22:37 +01:00
parent 046b1834a4
commit 43c7271a76

View File

@ -79,3 +79,7 @@ type ServerPopulation struct {
ServerID int `sql:"index;type:integer REFERENCES servers(id) ON DELETE CASCADE ON UPDATE CASCADE"` ServerID int `sql:"index;type:integer REFERENCES servers(id) ON DELETE CASCADE ON UPDATE CASCADE"`
Server Server Server Server
} }
// See https://github.com/jinzhu/gorm/issues/635 for why we have to manually add
// in a raw REFERENCES statement here.
// Hint: Foreign key creation is bugged when using gorm with sqlite.