How to work with different database versions

Posts   
 
    
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 05-Apr-2006 07:25:09   

Hi,

I was wondering what the best way is with different database versions. With this, I don't mean for example SQL Server 7 and SQL Server 2000, but I mean different application versions of the database.

In version 1.1 I can have a project table with 10 columns. In version 1.2 I add a column to this table, TYPE, which is mandatory in this version.

Now I can generate my entites and stored procedures, so I have two different versions with entities.

In my main program I have references to this database layer and use the entities in the program. The problem here now is that I want only ONE version of the program using different database layer versions.

I can use conditional compilation constants to define for which version I am programming I believe. But then I still have to change the references to this new version all the time. Is there an easy why to maintain two different versions, or should I just have to versions of the main program also? Problem is that when we make changes we suddenly have to change 3 or 4 versions of the main program, while nothing is changed in the db layer.

Does anyone have any experience with this problem, and how did you solve this?

Best regards,

G.I.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Apr-2006 08:14:43   

AS for the generated code, you should use different LLBLGen projects for each DAL version, and you can set your versionning info in those built dlls of the DAL.

As for your program code, you may use conditional compilation constants as you suggested.

That's how I always do it.

G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 05-Apr-2006 10:31:28   

Walaa,

thanks for the info. I have now two version of the DAL and set references from my application to both. I have changed the namespace to one including the version number.

Now with conditional compilations constants I can easily change the namespace I use, and thereby the version. Also new version specific functionality can be switched.

This is exactly what I need.

Best regards,

G.I.