fix generate migration for postgressql

This commit is contained in:
Sergey Lanzman
2016-07-23 02:14:33 +03:00
parent b022ab3277
commit 1308ebd940
2 changed files with 6 additions and 0 deletions

View File

@ -30,6 +30,9 @@ func generateScaffold(sname, fields, crupath, driver, conn string) {
if fields != "" {
upsql = `m.SQL("CREATE TABLE ` + sname + "(" + generateSQLFromFields(fields) + `)");`
downsql = `m.SQL("DROP TABLE ` + "`" + sname + "`" + `")`
if driver == "" {
downsql = strings.Replace(downsql, "`", "", -1)
}
}
generateMigration(sname, upsql, downsql, crupath)
}