Skip to content
Snippets Groups Projects
Verified Commit 5acb90f0 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: remove unused code for MySQL

parent cabbe88a
No related branches found
No related tags found
No related merge requests found
......@@ -364,10 +364,6 @@ func (st *Store) initDBModel(cfg DBConfig) (err error) {
opts.TableName = migrationsTn
opts.IDColumnSize = 64
opts.UseTransaction = true
if cfg.Type == "mysql" {
// mySQl does not support DDL commands inside transactions
opts.UseTransaction = false
}
m := gormigrate.New(st.db, opts, dbMigrations)
m.InitSchema(initialMigration)
......
......@@ -40,28 +40,6 @@ type Store struct {
// Initialization and Destruction
//
func mysqlConnectionString(cfg DBConfig) (conn string) {
// "tank:aura@tcp(127.0.0.1:3306)/tank?charset=utf8&parseTime=True&loc=Local"
conn = cfg.Username
if cfg.Password != "" {
conn += ":" + cfg.Password
}
if cfg.Port > 0 {
conn += fmt.Sprintf("@tcp(%s:%d)", cfg.Host, cfg.Port)
} else {
conn += "@tcp(" + cfg.Host + ")"
}
conn += "/" + cfg.DB + "?parseTime=True&loc=Local"
if cfg.TLS != "" {
conn += "&tls=" + cfg.TLS
}
if cfg.Charset != "" {
conn += "&charset=" + cfg.Charset
}
return
}
func postgresConnectionString(cfg DBConfig) (conn string) {
// "host=127.0.0.1 port=5432 user=tank password=aura dbname=tank sslmode=disable"
conn = "host=" + cfg.Host
......
......@@ -54,16 +54,11 @@ var (
func testDBConfig() (cfg DBConfig) {
cfg.Type = os.Getenv("AURA_TANK_TEST_DB_TYPE")
if cfg.Type == "" {
cfg.Type = "mysql"
}
cfg.Host = os.Getenv("AURA_TANK_TEST_DB_HOST")
if cfg.Host == "" {
cfg.Host = "127.0.0.1"
}
switch cfg.Type {
case "mysql":
cfg.TLS = "false"
case "postgres":
cfg.TLS = "disable"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment