mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:50:56 +00:00
Update: fixing a SQL generation code
Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@gmail.com>
This commit is contained in:
parent
d453242e48
commit
cb38ab4f85
@ -151,7 +151,7 @@ func (c *Column) SetAuto(inc bool) *Column {
|
|||||||
//SetNullable sets the column to be null
|
//SetNullable sets the column to be null
|
||||||
func (c *Column) SetNullable(null bool) *Column {
|
func (c *Column) SetNullable(null bool) *Column {
|
||||||
if null {
|
if null {
|
||||||
c.Null = "DEFAULT NULL"
|
c.Null = ""
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
c.Null = "NOT NULL"
|
c.Null = "NOT NULL"
|
||||||
@ -182,7 +182,7 @@ func (c *Column) SetDataType(dataType string) *Column {
|
|||||||
//SetOldNullable allows reverting to previous nullable on reverse ms
|
//SetOldNullable allows reverting to previous nullable on reverse ms
|
||||||
func (c *RenameColumn) SetOldNullable(null bool) *RenameColumn {
|
func (c *RenameColumn) SetOldNullable(null bool) *RenameColumn {
|
||||||
if null {
|
if null {
|
||||||
c.OldNull = "DEFAULT NULL"
|
c.OldNull = ""
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
c.OldNull = "NOT NULL"
|
c.OldNull = "NOT NULL"
|
||||||
|
Loading…
Reference in New Issue
Block a user