1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 19:10:54 +00:00

ORM:revert default value

This commit is contained in:
astaxie 2014-07-01 09:30:08 +08:00
parent 8946f816f9
commit 17a9c3c3a9
2 changed files with 4 additions and 4 deletions

View File

@ -148,9 +148,9 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex
column += " " + "NOT NULL" column += " " + "NOT NULL"
} }
if fi.initial.String() != "" { //if fi.initial.String() != "" {
column += " DEFAULT " + fi.initial.String() // column += " DEFAULT " + fi.initial.String()
} //}
if fi.unique { if fi.unique {
column += " " + "UNIQUE" column += " " + "UNIQUE"

View File

@ -205,7 +205,7 @@ type User struct {
Password string `orm:"size(100)"` Password string `orm:"size(100)"`
Status int16 `orm:"column(Status)"` Status int16 `orm:"column(Status)"`
IsStaff bool IsStaff bool
IsActive bool `orm:"default(TRUE)"` IsActive bool `orm:"default(1)"`
Created time.Time `orm:"auto_now_add;type(date)"` Created time.Time `orm:"auto_now_add;type(date)"`
Updated time.Time `orm:"auto_now"` Updated time.Time `orm:"auto_now"`
Profile *Profile `orm:"null;rel(one);on_delete(set_null)"` Profile *Profile `orm:"null;rel(one);on_delete(set_null)"`