diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-07-23 21:39:11 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-07-23 21:39:11 -0400 |
| commit | 5264264333f211c9d40108955e167d28fa73f77d (patch) | |
| tree | 6801a3d0460360bff5bc0b76ac482fa774e97043 /internal/repositories | |
| parent | Fix contributing link (diff) | |
| download | cli-5264264333f211c9d40108955e167d28fa73f77d.zip | |
Use DSN for handling connection parameters
Diffstat (limited to 'internal/repositories')
| -rw-r--r-- | internal/repositories/migration_db_repo_mssql_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/repositories/migration_db_repo_mssql_test.go b/internal/repositories/migration_db_repo_mssql_test.go index bbcb4cf..d1d03f4 100644 --- a/internal/repositories/migration_db_repo_mssql_test.go +++ b/internal/repositories/migration_db_repo_mssql_test.go @@ -16,13 +16,16 @@ func TestNewMigrationDBRepo_CreatesTableInSchema_MSSQL(t *testing.T) { tableName := schemaName + ".bolt_migrations" t.Cleanup(func() { - _, err := testdb.Exec("DROP TABLE IF EXISTS " + tableName) + _, err := testdb.Exec("IF OBJECT_ID('" + tableName + "', 'U') IS NOT NULL DROP TABLE " + tableName) assert.Nil(t, err) - _, err = testdb.Exec("DROP SCHEMA IF EXISTS " + schemaName) + _, err = testdb.Exec("IF SCHEMA_ID('" + schemaName + "') IS NOT NULL DROP SCHEMA " + schemaName) assert.Nil(t, err) }) - _, err := testdb.Exec("CREATE SCHEMA " + schemaName) + _, err := testdb.Exec("IF SCHEMA_ID('" + schemaName + "') IS NOT NULL DROP SCHEMA " + schemaName) + assert.Nil(t, err) + + _, err = testdb.Exec("CREATE SCHEMA " + schemaName) assert.Nil(t, err) exists, err := testdb.TableExists(tableName) |