mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user