1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 07:10:49 +00:00

Merge pull request #1434 from WnP/pg-fix

fix postgres syntax error during migration
This commit is contained in:
astaxie 2015-11-19 12:25:21 +08:00
commit 5a1e821a42

View File

@ -104,7 +104,7 @@ func (m *Migration) addOrUpdateRecord(name, status string) error {
o := orm.NewOrm()
if status == "down" {
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 {
return nil
}
@ -112,7 +112,7 @@ func (m *Migration) addOrUpdateRecord(name, status string) error {
return err
}
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 {
return err
}