Creating a new baseline

EricLamontagneEricLamontagne Posts: 46 Bronze 3
edited December 15, 2020 6:47PM in SQL Change Automation
Hi,

I'm not certain how to name it, but what I want to do is create a new "version" of my database schema.
We started at version 7.0 by creating a baseline.
We then created a migration that we call 7.1. This version is going to be released soon.
We will then start working on the 7.5 release of our application/database.

Is there something I need to do with my SCA project?
Do I need to create a new "baseline"?
I'm not sure where I should go, what needs to be done.

Note, we are using Git, they main development is done in master and we will create a Releases/7.1 branch with our existing code.

I'd like to have some pointers on what I should do next!

Regards,

Eric Lamontagne

Best Answer

  • Ivo_MillerIvo_Miller Posts: 31 Silver 3
    Hi,

    In terms of how to handle versions in your development/trunk branch, we might recommend organising migrations into directories e.g.
    Migrations
        7.0-Baseline
            001-BaselineMigration.sql
        7.1
            001-SomeMigration.sql
            002-SomeOtherMigration.sql
        7.5
            001-NewMigration.sql

    In any case, there is no need to create a new baseline, as migrations scripts will not be rerun against a database where they have already been run (there is a __MigrationLog table which tracks this).

    It is possible to "rebaseline" if desired, incorporating the previous version into the baseline, though currently it isn't a very simple process unless you are using SQLClone.

    In terms of maintaining multiple branches (it sounds like you have some form of development/trunk branch alongside release branches), it would be recommended to have a separate development database per branch (though you can always spin up a development database for a release branch using the tool or SQLClone as needed so no need to do this up front necessarily). See https://documentation.red-gate.com/sca/developing-databases/concepts/version-control/switching-branches for more information.
    Ivo Miller
    RedGate Software Developer
Sign In or Register to comment.