aboutsummaryrefslogtreecommitdiffstats
path: root/internal/commands
diff options
context:
space:
mode:
Diffstat (limited to 'internal/commands')
-rw-r--r--internal/commands/down.go4
-rw-r--r--internal/commands/status.go4
-rw-r--r--internal/commands/up.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/internal/commands/down.go b/internal/commands/down.go
index 0ba3abb..f991c69 100644
--- a/internal/commands/down.go
+++ b/internal/commands/down.go
@@ -54,12 +54,12 @@ func (cmd *DownCmd) Execute(
return subcommands.ExitFailure
}
- db, err := storage.DBConnect(cfg.Connection)
+ db, err := storage.NewDB(cfg.Connection)
if err != nil {
consoleOutputter.Error(fmt.Errorf("unable to connect to database: %w", err))
return subcommands.ExitFailure
}
- defer db.Session.Close()
+ defer db.Close()
migrationDBRepo, err := repositories.NewMigrationDBRepo(db)
if err != nil {
diff --git a/internal/commands/status.go b/internal/commands/status.go
index d44a132..1e176b9 100644
--- a/internal/commands/status.go
+++ b/internal/commands/status.go
@@ -44,12 +44,12 @@ func (m *StatusCmd) Execute(
return subcommands.ExitFailure
}
- db, err := storage.DBConnect(cfg.Connection)
+ db, err := storage.NewDB(cfg.Connection)
if err != nil {
consoleOutputter.Error(fmt.Errorf("unable to connect to database: %w", err))
return subcommands.ExitFailure
}
- defer db.Session.Close()
+ defer db.Close()
migrationDBRepo, err := repositories.NewMigrationDBRepo(db)
if err != nil {
diff --git a/internal/commands/up.go b/internal/commands/up.go
index a203d2e..77e0b8d 100644
--- a/internal/commands/up.go
+++ b/internal/commands/up.go
@@ -54,12 +54,12 @@ func (cmd *UpCmd) Execute(
return subcommands.ExitFailure
}
- db, err := storage.DBConnect(cfg.Connection)
+ db, err := storage.NewDB(cfg.Connection)
if err != nil {
consoleOutputter.Error(fmt.Errorf("unable to connect to database: %w", err))
return subcommands.ExitFailure
}
- defer db.Session.Close()
+ defer db.Close()
migrationDBRepo, err := repositories.NewMigrationDBRepo(db)
if err != nil {