From 17a9c3c3a9ea5246173d7f8a7415cc268404ba0a Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 1 Jul 2014 09:30:08 +0800 Subject: [PATCH] =?UTF-8?q?ORM=EF=BC=9Arevert=20default=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orm/cmd_utils.go | 6 +++--- orm/models_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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)"`