opengisch / pum

Postgres Upgrades Manager
GNU General Public License v2.0
30 stars 7 forks source link

Add multi delta dirs support #28

Closed elemoine closed 6 years ago

elemoine commented 6 years ago

This PR adds support for multiple delta directories. This is for example useful for handling database extensions with separate delta directories.

So with the proposed changes in this PR one can do:

$ pum upgrade -p my_service -t public.pum_upgrades -d /path/to/deltas1 /path/to/deltas2

The changes are backward-compatible, meaning that existing scripts that use Pum won't need to be updated.

Other things to note:

For backward-compatibility reasons I decided to keep the DeltaPy:delta_dir property. It refers to the first delta directory provided on the command line. And I introduced DeltaPy:delta_dirs to get the list of delta directories.

Deltas are applied in directory order. For example if you use -d deltas1 deltas2 on the command line Pum guarantees that the deltas in deltas1 will be applied before the deltas in deltas2. And within directories deltas are ordered as before, that is using (version, type, name) as the sort key.

I updated the docs (README) and the unit tests.

I also tested this in QWAT. For that I changed QWAT's Travis script to pass an extra delta directory to the pum test-and-upgrade command. I will propose this in a QWAT PR when this Pum PR is merged and a new Pum version is released on pypi.

Please review.

marioba commented 6 years ago

Great. All seems good to me. I will tag and deploy a new version (0.5.11)

marioba commented 6 years ago

0.5.11 released on pypi

elemoine commented 6 years ago

Thanks for the review and 0.5.11 release Mario!