schemachange
schemachange copied to clipboard
Flag for error on ignored versioned migration
This is a resurrection of PR 222 and 275:
- Add two CLI arguments:
-
raise-exception-on-ignored-version-script: At my shop, we're using epoch time as our version number. If you create a script with an epoch time and your colleague merges their changes in before you get a chance to, the
max_published_version
will causeschemachange
will skip your script without complaint. To address this, I handle versioned scripts almost identically to repeatable scripts. I store the metadata on the script's execution in a dictionary and compare that to the scripts in the script directory. If a script is "stale", hasn't been applied, and the flag is true: I raise an exception. -
version-number-validation-regex: Again, we're using epoch time as the version number in my shop. If someone deploys a script prefixed with
Vspam__
, future scripts versioned with the current epoch time will be skipped. Themax_published_version
is nowspam
and cannot be trumped by a number. To address this, I've added aversion_number_validation_regex
CLI argument that will rejectspam
as a version number if I've specificed\d{10}
-
raise-exception-on-ignored-version-script: At my shop, we're using epoch time as our version number. If you create a script with an epoch time and your colleague merges their changes in before you get a chance to, the