From d2186ed58d907a81648aa62ffa17ec20fb2d213e Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 18 Aug 2024 14:51:00 -0400 Subject: GH-4: Add configurable migrations table name (#6) * Add configurable migrations table name * Update codecov to be informational * Add mockdb and couple of extra tests * remove extra files * Add list query error test * Add readme update for custom migration table --- internal/commands/down.go | 2 +- internal/commands/status.go | 2 +- internal/commands/up.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/commands') diff --git a/internal/commands/down.go b/internal/commands/down.go index f991c69..b537b17 100644 --- a/internal/commands/down.go +++ b/internal/commands/down.go @@ -61,7 +61,7 @@ func (cmd *DownCmd) Execute( } defer db.Close() - migrationDBRepo, err := repositories.NewMigrationDBRepo(db) + migrationDBRepo, err := repositories.NewMigrationDBRepo(cfg.Connection.MigrationsTable, db) if err != nil { consoleOutputter.Error(err) return subcommands.ExitFailure diff --git a/internal/commands/status.go b/internal/commands/status.go index 1e176b9..6c305fe 100644 --- a/internal/commands/status.go +++ b/internal/commands/status.go @@ -51,7 +51,7 @@ func (m *StatusCmd) Execute( } defer db.Close() - migrationDBRepo, err := repositories.NewMigrationDBRepo(db) + migrationDBRepo, err := repositories.NewMigrationDBRepo(cfg.Connection.MigrationsTable, db) if err != nil { consoleOutputter.Error(err) return subcommands.ExitFailure diff --git a/internal/commands/up.go b/internal/commands/up.go index 77e0b8d..c2cd3ef 100644 --- a/internal/commands/up.go +++ b/internal/commands/up.go @@ -61,7 +61,7 @@ func (cmd *UpCmd) Execute( } defer db.Close() - migrationDBRepo, err := repositories.NewMigrationDBRepo(db) + migrationDBRepo, err := repositories.NewMigrationDBRepo(cfg.Connection.MigrationsTable, db) if err != nil { consoleOutputter.Error(err) return subcommands.ExitFailure -- cgit v1.2.3