Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Script naming conventions and local development

Mick Letofsky Nov 07, 2013 09:10AM AEDT

Hi Daniel,

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?

Thanks!
Mick

Up -1 rated Down
Daniel Nolan Nov 07, 2013 02:06PM AEDT ReadyRoll Agent

Hi Mick,

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.

Best Regards,

Daniel

This question has received the maximum number of answers.

readyroll.support@red-gate.com
http://assets2.desk.com/
false
readyrollsql
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete