From aece567ee1b8ce268c3fcbf49a97c77bb290b48e Mon Sep 17 00:00:00 2001 From: Florian Hansen Date: Mon, 5 Aug 2024 00:44:35 +0200 Subject: [PATCH] refactor: rename sqlite migrator struct --- cmd/server/main.go | 2 +- internal/repository/sqlite_migrator.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index fb462f3..02a6536 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -31,7 +31,7 @@ func run() error { grpcServer := grpc.NewServer() store := repository.NewFeatureSQLite(db) notifier := feature.NewService(grpcServer, store) - migrator := repository.NewSQLMigrator(db) + migrator := repository.NewSQLiteMigrator(db) routes := routes.New(store, notifier) return api.New( diff --git a/internal/repository/sqlite_migrator.go b/internal/repository/sqlite_migrator.go index 1548fec..cf79b33 100644 --- a/internal/repository/sqlite_migrator.go +++ b/internal/repository/sqlite_migrator.go @@ -10,15 +10,15 @@ import ( _ "github.com/golang-migrate/migrate/v4/source/file" ) -type SQLMigrator struct { +type SQLiteMigrator struct { db *sql.DB } -func NewSQLMigrator(db *sql.DB) *SQLMigrator { - return &SQLMigrator{db} +func NewSQLiteMigrator(db *sql.DB) *SQLiteMigrator { + return &SQLiteMigrator{db} } -func (mig *SQLMigrator) Migrate() error { +func (mig *SQLiteMigrator) Migrate() error { driver, err := sqlite3.WithInstance(mig.db, &sqlite3.Config{}) if err != nil { return errors.Wrap(err, "migrate sqlite3 driver")