Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates authored Jun 16, 2018
1 parent 5d13e5e commit 786534c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fizz/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Column struct {
Name string
ColType string
Primary bool
Options map[string]interface{}
Options Options
}

func (f fizzer) ChangeColumn() interface{} {
Expand Down
2 changes: 1 addition & 1 deletion fizz/fizz.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
)

type Options map[string]interface{}
type Options map[interface{}]interface{}

type fizzer struct {
Bubbler *Bubbler
Expand Down
4 changes: 2 additions & 2 deletions fizz/foreign_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (f fizzer) DropForeignKey() interface{} {
}

func parseForeignKeyRef(refs interface{}) (fkr ForeignKeyRef) {
refMap, ok := refs.(map[string]interface{})
refMap, ok := refs.(map[interface{}]interface{})
if !ok {
fmt.Printf(`invalid references format %s\nmust be "{"table": ["colum1", "column2"]}"`, refs)
return
Expand All @@ -63,7 +63,7 @@ func parseForeignKeyRef(refs interface{}) (fkr ForeignKeyRef) {
return
}
for table, columns := range refMap {
fkr.Table = table
fkr.Table = fmt.Sprint(table)
for _, c := range columns.([]interface{}) {
fkr.Columns = append(fkr.Columns, fmt.Sprintf("%s", c))
}
Expand Down
2 changes: 1 addition & 1 deletion fizz/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (t *Table) DisableTimestamps() {
t.Options["timestamps"] = false
}

func (t *Table) Column(name string, colType string, options map[string]interface{}) {
func (t *Table) Column(name string, colType string, options Options) {
var primary bool
if _, ok := options["primary"]; ok {
primary = true
Expand Down
2 changes: 1 addition & 1 deletion fizz/translators/mysql_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (ti mysqlTableInfo) ToColumn() fizz.Column {
Name: ti.Field,
ColType: ti.Type,
Primary: ti.Key == "PRI",
Options: map[string]interface{}{},
Options: fizz.Options{},
}
if strings.ToLower(ti.Null) == "yes" {
c.Options["null"] = true
Expand Down

0 comments on commit 786534c

Please sign in to comment.