Skip to content

feat: Add a ListDBMigrations function in provider#905

Open
the-glu wants to merge 1 commit intopressly:mainfrom
Orbitalize:listdbmigrations
Open

feat: Add a ListDBMigrations function in provider#905
the-glu wants to merge 1 commit intopressly:mainfrom
Orbitalize:listdbmigrations

Conversation

@the-glu
Copy link

@the-glu the-glu commented Feb 5, 2025

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.

@mfridman
Copy link
Collaborator

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?

@the-glu
Copy link
Author

the-glu commented Feb 13, 2025

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 :)

@the-glu
Copy link
Author

the-glu commented Jun 17, 2025

Hello,

Just a gentle reminder about this PR, do you have time for a quick check ? There is also #906 waiting :)

Thanks in advance,

@mfridman
Copy link
Collaborator

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.

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.

2 participants