Skip to content

Commit

Permalink
refactor: rename sqlite migrator struct
Browse files Browse the repository at this point in the history
  • Loading branch information
flohansen committed Aug 4, 2024
1 parent 50b1622 commit aece567
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions internal/repository/sqlite_migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit aece567

Please sign in to comment.