Skip to content

Commit

Permalink
remove dups
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Funkhouser <[email protected]>
  • Loading branch information
golanglemonade committed Sep 25, 2024
1 parent ca510d2 commit 8d7f680
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 173 deletions.
26 changes: 0 additions & 26 deletions internal/river/migrate.go

This file was deleted.

4 changes: 3 additions & 1 deletion internal/river/river.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/riverqueue/river"
"github.com/riverqueue/river/riverdriver/riverpgxv5"
"github.com/rs/zerolog/log"

"github.com/theopenlane/riverboat/pkg/riverqueue"
)

const (
Expand All @@ -28,7 +30,7 @@ func Start(ctx context.Context, c Config) error {
}

// Run migrations on startup
if err := runMigrations(ctx, dbPool); err != nil {
if err := riverqueue.RunMigrations(ctx, dbPool); err != nil {
log.Fatal().Err(err).Msg("failed to run migrations")
}

Expand Down
112 changes: 0 additions & 112 deletions pkg/client/client.go

This file was deleted.

1 change: 0 additions & 1 deletion pkg/client/doc.go

This file was deleted.

30 changes: 0 additions & 30 deletions pkg/client/options.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/riverqueue/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func New(ctx context.Context, opts ...Option) (c *Client, err error) {

// run migrations if the flag is set
if c.config.RunMigrations {
if err := runMigrations(ctx, c.pool); err != nil {
if err := RunMigrations(ctx, c.pool); err != nil {
log.Error().Err(err).Msg("error running migrations")
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/riverqueue/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/riverqueue/river/rivermigrate"
)

// runMigrations runs the migrations for the river server
// RunMigrations runs the migrations for the river server
// see https://riverqueue.com/docs/migrations for more information
func runMigrations(ctx context.Context, dbPool *pgxpool.Pool) error {
func RunMigrations(ctx context.Context, dbPool *pgxpool.Pool) error {
// run migrations here
migrator, err := rivermigrate.New(riverpgxv5.New(dbPool), nil)
if err != nil {
Expand Down

0 comments on commit 8d7f680

Please sign in to comment.