Adding fields in an existing database

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Thu Sep 22 12:36:30 CDT 2011


On 9/21/11 8:23 PM, "jda" <jda at his.com> wrote:

Hi Jon,

And also it is good idea to increment
    db.SchemaVersion

And do such change in function as

UpgradeSchema_3_4()


> I know you warned us in the past about mixing the class-way and sql ,
> but I think that was for older versions of Valentina. I want to check
> if this is OK to do (4.9.1):
> 
> 1. I used a class-way to create a db schema.

> 2. When I open the db (made with older versions of my app, or
> Valentina), check to see if field "aaa" exists.

And even better just

    if db.SchemaVersion == 3
            UpgradeSchema_3_4()
   
   

> 3. If "aaa" does not exists, add it with SQLExecute.

Yes its fine, beause you apply that SqlExecute to
    Vdatabase object inside of UpgradeSchema_3_4()

Then you close db

And create new db object of MyDbClass
 
> I've been doing this with an unreleased update of my app and it seems
> to work just fine in my testing. Am I going to run into problems with
> this approach?



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list