I'm working on an Update-Tool for a program my company developed. To update the programm I need to execute some SQL-Scripts. These scripts must have the right order (of course). I have a List. The SqlScriptModel has a 'Name' Property, I used to sort the list. The SQL-Scripts-Name start with the Programm-Version (example: 5.8.1.0). At the moment my 'sorted' list looks like this:
5.8.0.1 - Update Script
5.8.0.10 - Update Script
5.8.0.11 - Update Script
5.8.0.2 - Update Script
Of course the 5.8.0.10
script needs to be executed after the 5.8.0.2
script.
My code looks like this:
SqlScriptList.Sort((x, y) => string.Compare(x.Name, y.Name));
Has somebody already had the same problem? Or has a link to a valid solution? I would be very thankful!