Commit 5a1e821a authored by astaxie's avatar astaxie

Merge pull request #1434 from WnP/pg-fix

fix postgres syntax error during migration
parents 821b2f83 29ac961c
...@@ -104,7 +104,7 @@ func (m *Migration) addOrUpdateRecord(name, status string) error { ...@@ -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 { ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment