Index: golden/go/db/db.go |
diff --git a/golden/go/db/db.go b/golden/go/db/db.go |
index 99277cc245e92a5fde5d4d82a83aca8224495493..ca0b0454353b6bf9ec53e79d453ddfd2a61c1571 100644 |
--- a/golden/go/db/db.go |
+++ b/golden/go/db/db.go |
@@ -30,9 +30,9 @@ func MigrationSteps() []database.MigrationStep { |
// GetConfig returns a DatabaseConfig instance for running in production if a |
// metadata server is available. If 'local' is true it will always |
-// set the MySQL connection string to "" and thus use a local SQLite database |
-// when used with database.NewVersionedDB. |
-func GetConfig(mySQLConnStr string, sqlitePath string, local bool) *database.DatabaseConfig { |
+// set the MySQL connection string to "" and thus use a local MySQL test |
+// database when used with database.NewVersionedDB. |
+func GetConfig(mySQLConnStr string, local bool) *database.DatabaseConfig { |
useMySQLConnStr := mySQLConnStr |
// We are in the production environment, so we look up the password. |
@@ -47,15 +47,18 @@ func GetConfig(mySQLConnStr string, sqlitePath string, local bool) *database.Dat |
} |
// If there is still a placeholder in the connection string, we |
- // set it to empty, so that the the local SQLite database kicks in. |
+ // set it to empty, so that the the local MySQL test database kicks in. |
if strings.Contains(useMySQLConnStr, "%s") { |
useMySQLConnStr = "" |
} |
- return &database.DatabaseConfig{ |
- MySQLString: useMySQLConnStr, |
- SQLiteFilePath: sqlitePath, |
- MigrationSteps: migrationSteps, |
+ if useMySQLConnStr != "" { |
+ return &database.DatabaseConfig{ |
+ MySQLString: useMySQLConnStr, |
+ MigrationSteps: migrationSteps, |
+ } |
+ } else { |
+ return database.LocalTestDatabaseConfig(migrationSteps) |
} |
} |
@@ -97,17 +100,6 @@ var migrationSteps = []database.MigrationStep{ |
MySQLDown: []string{ |
`DROP TABLE expectations`, |
}, |
- SQLiteUp: []string{ |
- `CREATE TABLE expectations ( |
- id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, |
- userid TEXT NOT NULL, |
- ts BIGINT NOT NULL, |
- expectations MEDIUXMTEXT NOT NULL |
- )`, |
- }, |
- SQLiteDown: []string{ |
- `DROP TABLE expectations`, |
- }, |
}, |
// Use this is a template for more migration steps. |
@@ -115,7 +107,5 @@ var migrationSteps = []database.MigrationStep{ |
// { |
// MySQLUp: , |
// MySQLDown: , |
- // SQLiteUp: , |
- // SQLiteDown: , |
// }, |
} |