diff --git a/orm/cmd_utils.go b/orm/cmd_utils.go index 8e1d3fdb..ffb354e0 100644 --- a/orm/cmd_utils.go +++ b/orm/cmd_utils.go @@ -148,9 +148,9 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex column += " " + "NOT NULL" } - if fi.initial.String() != "" { - column += " DEFAULT " + fi.initial.String() - } + //if fi.initial.String() != "" { + // column += " DEFAULT " + fi.initial.String() + //} if fi.unique { column += " " + "UNIQUE" diff --git a/orm/models_test.go b/orm/models_test.go index bd0f0ebb..2b42fd52 100644 --- a/orm/models_test.go +++ b/orm/models_test.go @@ -205,7 +205,7 @@ type User struct { Password string `orm:"size(100)"` Status int16 `orm:"column(Status)"` IsStaff bool - IsActive bool `orm:"default(TRUE)"` + IsActive bool `orm:"default(1)"` Created time.Time `orm:"auto_now_add;type(date)"` Updated time.Time `orm:"auto_now"` Profile *Profile `orm:"null;rel(one);on_delete(set_null)"`