-
Notifications
You must be signed in to change notification settings - Fork 517
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
Go Migrations don't work #582
Comments
There's a check to make sure registered Go migrations exist on the filesystem (os or embedded). I realize the example doesn't highlight the important part, which is:
If you point me at a repo or an example, I could help you debug it. But, I think it's probably best I sat down and provided a blog/sample repo for how to do this step-by-step. |
hi @mfridman ! We're also running into this issue when we upgraded to 3.15. Things worked fine before.
Since we have no
|
Ran into the same issue. For us, we are including all of our SQL files in an // Needed to add *.go below
//go:embed *.sql *.go
var schemaFS embed.FS
// ...
goose.SetBaseFS(schemaFS) |
Indeed, there was an assumption the .go files would live alongside the .sql files and could be read from either the os filesystem or an embedded filesystem. But, that appears to be a wrong assumption. Sorry about that, I need to think about how to resolve this so it doesn't break folks from #553. Two immediate solutions come to mind
|
@edulop91 @paulrozhkin is it safe to assume you're also embedding migrations similar to @tom5760 ? |
@mfridman Now I made downgrade to previous version 3.13.4. |
Alright, I think there's a path forward here.
Now, there's one property I'd like to maintain, if .go files (that have a version number) exist in the filesystem that have not been registered raise an error.
|
Put up a PR to resolve this issue. #588 If anyone would like to provide early feedback (or even better, take this branch for a spin) that'd be great. TL;DR #588 should bring back the original behaviour, while also providing a way to filter migrations if they exist in the filesystem. EDIT: also added a bunch of tests to capture all 3 scenarios mentioned in #582 (comment) |
Goose v3.14.0
I have one .go migration file that I register with via
AddMigrationContext
. After registering and trying to migrate, I get anErrNoMigrationFiles
error.I think the error is in
collectMigrationsFS
on line 297. Maybe there should be a!ok
check here?The text was updated successfully, but these errors were encountered: