Hi team, love sql-migrate but have found an issue working with it and using the https://github.com/markbates/pkger/ solution for embedding static files.
this iteration then calls out to migrationsFromFile (ref: https://github.com/rubenv/sql-migrate/blob/master/migrate.go#L277) which then also calls open on the filename of the file being iterated over. This is where the problem is surfacing. Because the filepath doesn't have the leading / in the string, it is failing to find the file.
Changing this to the following resolves this issue:
Hi team, love sql-migrate but have found an issue working with it and using the https://github.com/markbates/pkger/ solution for embedding static files.
Like https://github.com/rubenv/sql-migrate/issues/167 we are seeing issues related to file not found when traversing the files in the migration directory.
The steps used in sql-migrate are:
FindMigrations
is called on aHttpFileSystemMigrationSource
https://github.com/rubenv/sql-migrate/blob/master/migrate.go#L232findMigrations
(ref: https://github.com/rubenv/sql-migrate/blob/master/migrate.go#L247) and sets the directory to the base of the file system and then traverses its contents at that level (ref: https://github.com/rubenv/sql-migrate/blob/master/migrate.go#L260-L269)/
in the string, it is failing to find the file.Changing this to the following resolves this issue: