Compare commits

..

No commits in common. 'master' and 'v1.0.0' have entirely different histories.

@ -18,7 +18,7 @@ type Column struct {
// Create @Title 创建model
func Create(db *gorm.DB, table string, path ...string) error {
var columns []Column
sql := fmt.Sprintf("select * from information_schema.COLUMNS where table_name ='%s' order by ordinal_position", db.NamingStrategy.TableName(table))
sql := fmt.Sprintf("select * from information_schema.COLUMNS where table_name ='%s'", db.NamingStrategy.TableName(table))
db.Raw(sql).Scan(&columns)
tableName := camelString(table)
@ -45,7 +45,7 @@ func Create(db *gorm.DB, table string, path ...string) error {
}
pri := ""
if column.ColumnKey == "PRI" {
pri = "`gorm:\"primaryKey\"`"
pri = "`gorm:\"primarykey\"`"
}
comment := ""
if column.ColumnComment != "" {

Loading…
Cancel
Save