feat: Add a ListDBMigrations function in provider
Hello,
I'm developing a tool to manage our project's migration, and I would like to list the current migrations in the database to be able to enforce various checks (like "is there migrations in the database not present in the current migration set?").
Right now there seems to be no options to list those database migrations form the Provider API, this PR add a simple function that return those, allowing for flexibility on 'our side' without the needed of adding specific checks.
The provider currently has 2 methods:
Both of these aim to report whether there are new migrations and the versions (current and target). Are these methods insufficient for your needs?
No there aren't: HasPending is only telling me if there are unapplied migrations and GetVersion is only working with current migrations and checking the status in the database.
What I would like to detect, is if there is any 'unknown' = 'not registered' migration in the database.
Instead of adding a specific function to do this specific check, this PR add the method to return those DB migrations, to also allow potential others checks if needed when using goose as a library :)
Hello,
Just a gentle reminder about this PR, do you have time for a quick check ? There is also #906 waiting :)
Thanks in advance,
Sorry, been a bit swamped (but still maintained). I'll try to get to this shortly, will carve out some time over the weekend to properly review.