Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow for testing migration down functions #1584
Comments
This comment has been minimized.
moore3071
commented
Mar 30, 2018
|
Instead of using two databases and dumping database info, it would make a lot more sense to use Diesel's ability to print the schema. This only gives table structure, but would be much easier to implement. An obviously needed feature in a binary implementing this would be the ability to exclude the testing of specified migrations. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moore3071 commentedMar 3, 2018
It's currently very easy to run into a poorly written migration where the down function doesn't correctly undo the migration. Diesel's documentation suggests the use of redo for testing this, but unless a project is testing this via CI, it's likely that faulty down functions will only be noticed when they're run. Even worse, it may be difficult to track down which migration was faulty. It would be cool if Diesel could include a command that starts with two blank databases, runs through the migrations step by step while redoing the migrations on the first database and checking that it is equivalent to the second database. A naive bit of pseudocode: