Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(migrators/goose): read from filesytem if no FS #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dmksnnk
Copy link

@dmksnnk dmksnnk commented Jan 3, 2025

This CR should allow to read migrations folder from parent directory like ../migrations.

I have a migrations directory in the root of the project, so to make migrations work, I need to provide FS with root directory:

root, err := filepath.Abs("../../../..")
if err != nil {
  t.Fatal("get abs path", err)
}

migrator := goosemigrator.New("migrations", goosemigrator.WithFS(os.DirFS(root)))

This CR should allow to do just:

migrator := goosemigrator.New("../../../../migrations")

Also, golangmigrator does not have fs.FS by default too.

This should allow to read migrations folder from parent directory like
"../migrations".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant