Script naming conventions and local development

priyasinhapriyasinha Posts: 548 Silver 1
edited February 29, 2016 9:58AM in ReadyRoll
Note: This issues has been migrated from ReadyRoll support forum

We are off and running with ReadyRoll in our development process and we have noticed something unplanned. All developers are using local databases to develop against and then we build to "test" every night. We have seen several cases where the database scripts are numbered with the same numerical prefix (e.g. 0000025). How does the ReadyRoll build & deploy process handle these conflicts? Does it run the scripts numbered the same in an arbitrary order? Or does it then fall back on alphabetical?

Do you have any suggestions for keeping our scripts in numerical order in a better fashion?
Priya Sinha
Project Manager
Red Gate Software

Comments

  • ReadyRoll always uses the filename of the script (excluding the folder path) to determine the order of execution: the order you see in Visual Studio or Explorer is the same order that the scripts will be deployed.

    Whenever a script is generated (eg. by Importing changes from a local database) or added to the project, the files are auto-named using the following convention:

    number_[date]-[hhmm]_[username].sql,

    If we have two or more scripts pending deployment that are prefixed with the number 25, the date and time that follows act as a tie-breaker, eg.

    1. 0025_20131104-2053_noland.sql
    2. 0025_20131104-2054_letofskym.sql

    ReadyRoll doesn’t actually mind if there are two scripts with the same numeric prefix, in fact this is normal behaviour when developers are working with their own copy of the database code (even when developers work against the same database server).

    Now one important point here is that the numeric prefix (and subsequent underscore) is the only required part of the naming convention: the suffix of the filename can always be customised. You can also rename the file – renumerating the prefix if needed – to make the ordering more clear, without triggering re-deployment of the script.

    I hope this helps clarify the script naming behaviour with regard to execution order.
    Priya Sinha
    Project Manager
    Red Gate Software
Sign In or Register to comment.