Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2007
    Posts
    4

    Unanswered: keeping old and new tables

    Hi all,

    I've redesigned some tables (small in terms of data and number of rows) which some existing applications are still using and would like to know the best practice as keeping both the old and new tables. Basically, a new application will be developed to use the new tables while existing applications will continue to use the old ones. Eventually, the existing applications will be converted over to use the new tables. What is the best way to keep both old and new tables? i.e. create a new schema and add the new tables, use the existing schema and add the new tables (with different names), others?

    Thanks.

  2. #2
    Join Date
    Jun 2007
    Posts
    4
    Here is an example,

    Current Schema:
    table A
    table B
    table C

    Should I use:

    New Schema:
    table A
    table B
    table C

    and configure the new application to use New Schema to access the new tables or

    Current Schema:
    table A
    table B
    table C
    table A_new
    table B_new
    table C_new

    and configure the new application to use Current Schema to access the new tables by the new names.

    Thanks.

  3. #3
    Join Date
    Dec 2003
    Posts
    1,074
    You can use VIEWs to bridge the gap between old and new names.
    --=cf

  4. #4
    Join Date
    Jun 2007
    Posts
    4
    Hi Chuck,

    Can you give me more details on how to use VIEWs to bridge the gap? i.e. on the same schema?

    Thanks.

  5. #5
    Join Date
    Dec 2003
    Posts
    1,074
    Name the new tables by the new name of your choice, and when the time comes, rename the old tables to some bogus name (or drop them) and create a VIEW for each table, pointing to the new tables, which bear the same names as the old table names.

    ---=Chuck

  6. #6
    Join Date
    Jun 2007
    Posts
    4
    Hi Chuck,

    Here is an example,

    Current Schema:
    table A
    table B
    table C
    table A_new
    table B_new
    table C_new

    "when the time comes"

    drop tables A, B, C

    and create:

    View A to point to A_New
    View B to point to B_New
    View C to point to C_New

    Is this correct? The problem is the new tables are not backwards compatible so coming up with the views may be a problem.

    Thanks.

  7. #7
    Join Date
    Dec 2003
    Posts
    1,074
    I guess I was trying to focus on a "seam-less" transition for the old applications, when it came time to point them at the new tables.

    If you're going to have to do a re-design on the old applications anyway, then table placement (new schema / old schema) will have to do more with your shop standards than anything else. Probably wouldn't hurt to keep these tables in the same schema IF there are other tables that will not change during this transition. If all tables are going to change, then I'd go for a new schema.

    ---=cf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •