1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 22:51:29 +00:00

fix postgres syntax error during migration

This commit is contained in:
Steeve Chailloux 2015-11-09 19:39:47 -06:00
parent 821b2f832e
commit 29ac961c10

View File

@ -104,7 +104,7 @@ func (m *Migration) addOrUpdateRecord(name, status string) error {
o := orm.NewOrm() o := orm.NewOrm()
if status == "down" { if status == "down" {
status = "rollback" status = "rollback"
p, err := o.Raw("update migrations set `status` = ?, `rollback_statements` = ?, `created_at` = ? where name = ?").Prepare() p, err := o.Raw("update migrations set status = ?, rollback_statements = ?, created_at = ? where name = ?").Prepare()
if err != nil { if err != nil {
return nil return nil
} }
@ -112,7 +112,7 @@ func (m *Migration) addOrUpdateRecord(name, status string) error {
return err return err
} }
status = "update" status = "update"
p, err := o.Raw("insert into migrations(`name`, `created_at`, `statements`, `status`) values(?,?,?,?)").Prepare() p, err := o.Raw("insert into migrations(name, created_at, statements, status) values(?,?,?,?)").Prepare()
if err != nil { if err != nil {
return err return err
} }