From 43baf09a91c444711a3320922f23e3e04178e3c0 Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Sat, 24 Aug 2019 15:05:04 +0200 Subject: [PATCH] Add Name method to translators This will be required by pop with the new migrations generator. --- go.mod | 10 +++++----- go.sum | 15 ++++++++++----- translators/cockroach.go | 4 ++++ translators/mariadb.go | 4 ++++ translators/mssqlserver.go | 4 ++++ translators/mysql.go | 4 ++++ translators/postgres.go | 4 ++++ translators/sqlite.go | 4 ++++ version.go | 2 +- 9 files changed, 40 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index afc207f6..72b1cebb 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 077af94d..b4f00cc4 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= @@ -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= diff --git a/translators/cockroach.go b/translators/cockroach.go index f29c7208..0421adbc 100644 --- a/translators/cockroach.go +++ b/translators/cockroach.go @@ -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{} diff --git a/translators/mariadb.go b/translators/mariadb.go index 7e9109ff..cf459be9 100644 --- a/translators/mariadb.go +++ b/translators/mariadb.go @@ -13,3 +13,7 @@ func NewMariaDB(url, name string) *MariaDB { MySQL: md, } } + +func (MariaDB) Name() string { + return "mariadb" +} diff --git a/translators/mssqlserver.go b/translators/mssqlserver.go index a2ba011d..6fd27e46 100644 --- a/translators/mssqlserver.go +++ b/translators/mssqlserver.go @@ -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{} diff --git a/translators/mysql.go b/translators/mysql.go index aa595698..1ce51c26 100644 --- a/translators/mysql.go +++ b/translators/mysql.go @@ -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{} diff --git a/translators/postgres.go b/translators/postgres.go index d8fe3c40..60d5152f 100644 --- a/translators/postgres.go +++ b/translators/postgres.go @@ -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{} diff --git a/translators/sqlite.go b/translators/sqlite.go index cbad20ff..fbb71a29 100644 --- a/translators/sqlite.go +++ b/translators/sqlite.go @@ -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) diff --git a/version.go b/version.go index 297e2e71..2c14a1ec 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package fizz // Version gives the current fizz version. -const Version = "v1.9.2" +const Version = "v1.9.3"