mojolicious / mojo-pg

Mojolicious :heart: PostgreSQL
https://metacpan.org/release/Mojo-Pg
Artistic License 2.0
101 stars 46 forks source link

stricter checking of migration target #43

Closed niczero closed 7 years ago

niczero commented 7 years ago

Summary

It will disallow ->migrate($n) if $n is greater than the known levels.

Motivation

Currently 'migrate' will disallow a change if $latest is greater than the known levels ($latest). This change should mean the user doesn't get into that situation erroneously.

Slightly related, 'migrate' allows a change to levels for which there are no steps. That makes sense if the $target is within the range of known steps. (eg migrating 3-->2 even tho there's no 'down' step from 3 to 2)

(I suppose the biggest gain is for authors of other backends since it clarifies the semantics.)

References

https://irclog.perlgeek.de/mojo/2017-06-25#i_14784815

niczero commented 7 years ago

Apologies. The scenario is already adequately handled.