jinzhu/gorm — pull request #280 by ryanss (2014-11-16 04:36:34+00:00)
Title: Create tables with fields in same order as defined in struct

Because `scope.Fields()` returns a `map[string]*Field` the order of the fields as defined in the struct is lost which causes the order of the fields in the `CREATE TABLE` statement to come out seemingly randomly. It would be nice if the order of the columns in the table was the same as how they were defined in the struct. This patch outputs the fields in correct order while creating the table.