Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Version command should list all scripts not applied to database #14

Open
jpoehls opened this issue Aug 21, 2010 · 1 comment
Open

Version command should list all scripts not applied to database #14

jpoehls opened this issue Aug 21, 2010 · 1 comment
Labels

Comments

@jpoehls
Copy link
Owner

jpoehls commented Aug 21, 2010

Currently the version command simply lists the latest migration script version # and the current schema version #. This was useful back when the version numbers were sequential, however now that the version numbers are UTC time stamps it isn't very useful to know the specific version of schema vs database. All that tells you is that the versions are different, it doesn't tell you whether just 1 migration is missing, or whether 100 are missing.

Proposed changes:

  • If the schema is up-to-date it should say so, and perhaps give just the latest version # that it is up-to-date to.
  • If not all migration scripts have been applied to the schema, then it should list the ones that are missing. If > 20? are missing, it should list the 20 newest that are missing and say "plus 100 more" to indicate more are missing as well. You should be able to run the command again with a switch to output all of them.
  • If there are migration scripts that have been applied to the database that aren't in your migrations folder, then the command should warn you that you seem to be missing migrations scripts and should list the ones that are missing with the same truncation rules as above.
  • If both conditions are true, i.e. you are missing migration scripts that have been applied AND you have scripts that haven't been applied to the database, then you should see both warning outputs.
@kieranbenton
Copy link
Contributor

+1 this would be very useful and I could potentially lend a hand with this.

One thing that isnt necessarily clear is also whether to include migrations that havent been applied but are BEHIND where the current schema version # says a DB is (e.g. after integrating a feature branch).

Any thoughts on how that should be handled?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants