schemachange icon indicating copy to clipboard operation
schemachange copied to clipboard

Flag for error on ignored versioned migration

Open zanebclark opened this issue 4 months ago • 2 comments

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 cause schemachange 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. The max_published_version is now spam and cannot be trumped by a number. To address this, I've added a version_number_validation_regex CLI argument that will reject spam as a version number if I've specificed \d{10}

zanebclark avatar Oct 08 '24 14:10 zanebclark