fix: Remove required Close from database.Migrate (#25)

* fix: Remove required Close from database.Migrate

* Remove dbName from Migrate function arguments

* Fix func call
This commit is contained in:
Kyle Carberry
2022-01-14 10:30:26 -06:00
committed by GitHub
parent a461bc1454
commit 5c49f1f15f
5 changed files with 13 additions and 16 deletions

View File

@ -7,10 +7,11 @@ import (
"database/sql"
"testing"
"github.com/coder/coder/database"
"github.com/coder/coder/database/postgres"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
"github.com/coder/coder/database"
"github.com/coder/coder/database/postgres"
)
func TestMain(m *testing.M) {
@ -25,6 +26,7 @@ func TestMigrate(t *testing.T) {
defer closeFn()
db, err := sql.Open("postgres", connection)
require.NoError(t, err)
err = database.Migrate(context.Background(), "postgres", db)
defer db.Close()
err = database.Migrate(context.Background(), db)
require.NoError(t, err)
}