func init() { myconn, err := pop.Connect("mysql") if err != nil { panic(err.Error()) } deets := myconn.Dialect.Details() myt = translators.NewMySQL(myconn.URL(), deets.Database) }
package translators_test import ( "github.com/markbates/pop" "github.com/markbates/pop/fizz" "github.com/markbates/pop/fizz/translators" ) var _ fizz.Translator = (*translators.MySQL)(nil) var myt = translators.NewMySQL("", "") func init() { myconn, err := pop.Connect("mysql") if err != nil { panic(err.Error()) } deets := myconn.Dialect.Details() myt = translators.NewMySQL(myconn.URL(), deets.Database) } func (p *MySQLSuite) Test_MySQL_SchemaMigration() { r := p.Require() ddl := `CREATE TABLE schema_migrations ( version VARCHAR (255) NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX version_idx ON schema_migrations (version);` res, err := myt.CreateTable(fizz.Table{ Name: "schema_migrations", Columns: []fizz.Column{ {Name: "version", ColType: "string"},
func (m *mysql) FizzTranslator() fizz.Translator { t := translators.NewMySQL(m.URL(), m.Details().Database) return t }