Results 1 to 3 of 3

Thread: Deploying strucutre change without overriding data

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214

    Deploying strucutre change without overriding data

    Hi,

    Not sure how to do this.
    For example, I have an app with a table that has 3 columns. lets say I deploy the table to production along with the app and then add a hundred rows.

    Then I need to add an additional column in the application. When I redeploy the table, my live data is lost.

    Typically, I will be using SQL Server as my backend, so it wouldn't matter, but in this case its a local table.
    What's the best way to handle this?

    Thanks.

    Herb

  2. #2
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,949
    Hi Herb,

    what I do in the current product (in VFP hitting SQL) is run a modify routine that alters the SQL Server data to match the EXE running. There's quite a bit to it, but once done, it gets used forever, as it were.

    I'm in the process of moving that capability to Lianja. Lianja's additional commands actually makes it easier than it was in VFP.

    Barry has mentioned doing something about data structure updates, but I don't see anything in the roadmap.

    Anyway, that's my #1 side project at the moment. I'm working from xCase, but the data update routine will pretty much standalone. When completed, you would deploy the structure of your tables in xml along with this routine, and have it check in the App INIT (quick CRC32 table checks) whether a particular table needs to be updated. It would then go ahead and do the update, converting the data type if needed, etc., and then your app is good to go.

    In the meantime, you can manually do the same thing: have a routine that uses columnexists() to know whether to add the field to the table, in the INIT, before anything else runs (as you will need to use the table exclusive). You can at the same time take care of any index that needs to be supplied, etc.

    hth,

    Hank

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214
    Interesting Idea Hank.

    Thanks.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us