Progress on database schema migration for account -> org refactor

This commit is contained in:
Torkel Ödegaard
2015-02-24 11:46:34 +01:00
parent da41d99aa7
commit 02a89c752b
16 changed files with 595 additions and 193 deletions

View File

@ -1,6 +1,9 @@
package migrator
import "strconv"
import (
"fmt"
"strconv"
)
type Postgres struct {
BaseDialect
@ -84,3 +87,9 @@ func (db *Postgres) TableCheckSql(tableName string) (string, []interface{}) {
sql := "SELECT `TABLE_NAME` from `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`=? and `TABLE_NAME`=?"
return sql, args
}
func (db *Postgres) DropIndexSql(tableName string, index *Index) string {
quote := db.Quote
idxName := index.XName(tableName)
return fmt.Sprintf("DROP INDEX %v", quote(idxName))
}