Support querying unknown executed migrations #675
Unanswered
medranocalvo
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to check whether the database schema is up-to-date, the
umzug.pending()
method can be used.I'm trying to check whether the application is up-to-date to the schema; that is, whether the user is running an older version of an application which is no longer compatible to the already migrated schema.
Initially I though of using
umzug.executed()
and compare it withumzug.migrations()
. That does not work, because Umzug filters the return value of the former with the latter.I propose a new feature be added to Umzug that allows doing the above check. I thought of two possible implementations:
umzug.executed()
to accept a new optional parameterall
. When true, all executed migrations should be returned, no matter whether they exist or not.umzug.unknown()
which lists the unknown migrations. This has the disadvantage that we would not be able to distinguish in which order they were applied.Please find below a quick patch implementing option 1.
Beta Was this translation helpful? Give feedback.
All reactions