Skip to content

Commit

Permalink
Add Name method to translators
Browse files Browse the repository at this point in the history
This will be required by pop with the new migrations generator.
  • Loading branch information
stanislas-m committed Aug 24, 2019
1 parent 6f4ed41 commit 43baf09
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 11 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ require (
github.com/fatih/structs v1.1.0 // indirect
github.com/go-sql-driver/mysql v1.4.1
github.com/gobuffalo/helpers v0.2.4 // indirect
github.com/gobuffalo/packr/v2 v2.5.2
github.com/gobuffalo/plush v3.8.2+incompatible
github.com/gobuffalo/packr/v2 v2.5.3
github.com/gobuffalo/plush v3.8.3+incompatible
github.com/gobuffalo/uuid v2.0.5+incompatible // indirect
github.com/gobuffalo/validate v2.0.3+incompatible // indirect
github.com/gofrs/uuid v3.2.0+incompatible // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/onsi/ginkgo v1.8.0 // indirect
github.com/onsi/gomega v1.5.0 // indirect
github.com/onsi/ginkgo v1.9.0 // indirect
github.com/onsi/gomega v1.6.0 // indirect
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 // indirect
github.com/stretchr/testify v1.3.0
github.com/stretchr/testify v1.4.0
google.golang.org/appengine v1.6.1 // indirect
)
15 changes: 10 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ github.com/gobuffalo/packd v0.2.0/go.mod h1:k2CkHP3bjbqL2GwxwhxUy1DgnlbW644hkLC9
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q=
github.com/gobuffalo/packr/v2 v2.4.0/go.mod h1:ra341gygw9/61nSjAbfwcwh8IrYL4WmR4IsPkPBhQiY=
github.com/gobuffalo/packr/v2 v2.5.2 h1:4EvjeIpQLZuRIljwnidYgbRXbr1yIzVRrESiLjqKj6s=
github.com/gobuffalo/packr/v2 v2.5.2/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08=
github.com/gobuffalo/plush v3.8.2+incompatible h1:EXtDf5L7TTwX8tEddtdHT+PT2lFerIKQm8Ye/M7O+54=
github.com/gobuffalo/packr/v2 v2.5.3 h1:egbOzIWXdPnB0iPMQ5LKxPN/bXnZXQJOXfD8zB/l1Ko=
github.com/gobuffalo/packr/v2 v2.5.3/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08=
github.com/gobuffalo/plush v3.8.2+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI=
github.com/gobuffalo/plush v3.8.3+incompatible h1:kzvUTnFPhwyfPEsx7U7LI05/IIslZVGnAlMA1heWub8=
github.com/gobuffalo/plush v3.8.3+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI=
github.com/gobuffalo/plushgen v0.1.2/go.mod h1:3U71v6HWZpVER1nInTXeAwdoRNsRd4W8aeIa1Lyp+Bk=
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
github.com/gobuffalo/tags v2.1.0+incompatible h1:qQjj3n2RtHxfooqXQ4/A9SsEfZ7/7guv8cp/GdAPa+Y=
Expand Down Expand Up @@ -84,10 +86,12 @@ github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/le
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
github.com/onsi/ginkgo v1.9.0 h1:SZjF721BByVj8QH636/8S2DnX4n0Re3SteMmw3N+tzc=
github.com/onsi/ginkgo v1.9.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.6.0 h1:8XTW0fcJZEq9q+Upcyws4JSGua2MFysCL5xkaSgHc+M=
github.com/onsi/gomega v1.6.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
Expand Down Expand Up @@ -117,8 +121,9 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
Expand Down
4 changes: 4 additions & 0 deletions translators/cockroach.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func NewCockroach(url string, name string) *Cockroach {
return &Cockroach{Schema: schema}
}

func (Cockroach) Name() string {
return "cockroach"
}

func (p *Cockroach) CreateTable(t fizz.Table) (string, error) {
p.Schema.SetTable(&t)
sql := []string{}
Expand Down
4 changes: 4 additions & 0 deletions translators/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ func NewMariaDB(url, name string) *MariaDB {
MySQL: md,
}
}

func (MariaDB) Name() string {
return "mariadb"
}
4 changes: 4 additions & 0 deletions translators/mssqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ func NewMsSqlServer() *MsSqlServer {
return &MsSqlServer{}
}

func (MsSqlServer) Name() string {
return "mssqlserver"
}

func (p *MsSqlServer) CreateTable(t fizz.Table) (string, error) {
sql := []string{}
cols := []string{}
Expand Down
4 changes: 4 additions & 0 deletions translators/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func NewMySQL(url, name string) *MySQL {
}
}

func (MySQL) Name() string {
return "mysql"
}

// CreateTable translates a fizz Table to its MySQL SQL definition.
func (p *MySQL) CreateTable(t fizz.Table) (string, error) {
sql := []string{}
Expand Down
4 changes: 4 additions & 0 deletions translators/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ func NewPostgres() *Postgres {
return &Postgres{}
}

func (Postgres) Name() string {
return "postgres"
}

func (p *Postgres) CreateTable(t fizz.Table) (string, error) {
sql := []string{}
cols := []string{}
Expand Down
4 changes: 4 additions & 0 deletions translators/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func NewSQLite(url string) *SQLite {
}
}

func (SQLite) Name() string {
return "sqlite3"
}

func (p *SQLite) CreateTable(t fizz.Table) (string, error) {
p.Schema.SetTable(&t)

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fizz

// Version gives the current fizz version.
const Version = "v1.9.2"
const Version = "v1.9.3"

0 comments on commit 43baf09

Please sign in to comment.