Automatic Versioning

Automated database upgrades

Tracking design changes

One of the core features of ODS is its ability to track design changes. ODS automatically generates methods in the DAL source code that are able to create and upgrade the databases. This can save a huge amount of time and effort compared to manually scripting techniques.

ODS automatically creates the SQL, working out the various dependencies, and embeds it within the generated source code. The upgrade source code incorporates a system of iterative upgrades by version that allows databases to be upgraded to the latest schema no matter what version of the DAL they were originally created by. All your application has to do is call the upgrade method.

The benefits of automated upgrades

Automated upgrades save a lot of time and effort when releasing new versions of your application. But the benefits can also be seen during the development phase too. When you have several developers working on the same project there is often a dilemma. Do all developers work off the same central development database and risk clashing or run their own separate databases and risk getting out of sync? ODS makes it a lot easier for developers to use their own local development databases. Simply add a couple of lines your application start up that DAL upgrade method, bringing you local database schema back into sync.

How iterative upgrades work

Iterative upgrades rely on a system of build numbers. Each time a new set of DAL source code is generated, it is allocated a new build number. When a new database is created using this DAL it gets tagged with the build number. So in future we will know exactly which DAL build created the database, versioning both the DAL and database.

The upgrade method in the DAL knows how to upgrade from every build number to the next (from build 0 to build 1, from build 1 to build 2 etc...). So when the DALs upgrade method is run against a database it can simply check the databases build and run through the necessary upgrades to bring it up to the latest build.