We are developing a .NET Webforms application using SQL Server. To version the project, we use Mercurial, Kiln and SourceTree. There are several branches, two branches stand out of those, namely live and dev. All the other branches are either hotfix or feature branches. We use RoundHouse to run our scripts upon deploy on the live database.
However, we, developers play with a daily copy of that database. Whenever a deploy is issued, database scripts in a specific folder's subfolders are executed on the live database, if and only if they were not deployed yet. So far so good. However, whenever we start a new day, everyone has to execute his/her undeployed scripts. I would like to make that automatic. For this purpose I intend to write a small code/shell which will run the undeployed scripts in the specific folder and subfolders in the order they were created (the files have a utc date in their names, but they have a create date as files as well). And then the event which creates the daily copy will be enhanced with this.
The problem is that I do not know how could I gather the undeployed file paths in all branches. If this is impossible, then the second-best solution would be to run only those scripts which were not merged into the live branch. This is second-best, due to the fact that this implies a policy change along with something new to watch out for.