Are we restricted to only using alpha characters when using semantic version migration grouping?

I am attempting to use semantic version ordering for migration grouping.  I want to add the name of our release, "2018_Aurora", to the version # 1.0.0 to make a final folder name of "1.0.0-2018_Aurora", but I then get an error when i try to add a migration script.

"The selected folder '1.0.0-2018_Aurora' is not a valid container for migration scripts..." 

It DOES work if I just use '1.0.0-Aurora'.
It also WONT work when I use '1.0.0-R2018_Aurora'
It seems we can't use any additional numerics in the folder name after the actual semantic version.  Is this by design?
Tagged:

Best Answer

  • MikielAgutuMikielAgutu Posts: 29 Silver 1
    Accepted Answer
    Hello Peter

    Semantic versioning works with the following format:

    Major.Minor.Patch-PreRelease+Build

    Note that PreRelease and Build are optional.

    There are two problems with your naming of the folder. The first is to do with the hyphen in your folder name. The hyphen in the Patch part of the Semantic Version number indicates a pre-release package. So for 1.0.0-2018_Aurora, SQL Change Automation is interpreting the '-2018_Aurora' to be the pre-release part.

    The second problem is that underscores are not supported in Semantic Version folder names. The supported characters for each part of a Semantic Version folder can be found on the documentation page - which I have just updated for you since it wasn't clear :)

    If you don't want to indicate a pre-release folder, use something like: '1.0.0+2018-Aurora':
    Major: 1
    Minor: 0
    Patch: 0
    Build: 2018-Aurora

    If you want the pre-release part, use something like 1.0.0-2018+Aurora':
    Major: 1
    Minor: 0
    Patch: 0
    PreRelease: 2018
    Build: Aurora

    Alternatively, you might just want to use file path based ordering instead, which is explained on the same documentation page. It's simpler, and might be appropriate for your use case if you just need arbitrary folder names.

    Thanks
    Mikiel Agutu | Software Engineer | Redgate Software

Answers

  • Excellent! And thanks for updating the online docs.  I'm really enjoying how responsive the RG team has been.  I think your'e right - File Path ordering might be appropriate for this situation.  As a supporting "Dev DBA", I don't want to impact the dev team's traditional sprint/release naming convention (much) at this point.
Sign In or Register to comment.