Mapping and migration

4 posts, 0 answers
  1. Martin
    Martin avatar
    3 posts
    Member since:
    Sep 2008

    Posted 05 Dec 2008 Link to this post

    Hello,

    the automatic mapping of OpenAccess is quite comfortable in most situations, but in  a migration scenario it is important to know what member is mapped to what column.
    Say in Version 1    3 members (m1, m2, m3) are references that are mapped to columns named id2, id3, id4. How can we be sure that those members are mapped to the same columns  in a Version 2 ? Vschema will check the schema changes. But what happens if a database created with Version 1 is accessed by a Version 2 application ? The columns would be the same, but the mapping may not!
    How can we get knowledge of the member-mapping and how can this process be controlled by us ?


    Thanks, Martin
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 08 Dec 2008 Link to this post

    Hello Martin,
    The VSchema tool can create ddl scripts for you. This can be done without applying those directly to the database. You should always have a version 1 database somewhere and, maybe your integration run, should generate such a script automatically that shows the mapping/schema migration from version 1 to version 2.

    Kind regards,
    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Martin
    Martin avatar
    3 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    Hi Jan,

    the point is not to get information about schema changes. The point is to control the mapping.
    If in Version 1 the mapping is:

    ref1 -> col1
    ref2 -> col2
    ref3 -> col3

    We had to realize that OpenAccess may decide to map it in an other way in version 2:

    ref1->col2
    ref2->col1
    ref3->col3

    There will be no schema changes in this case because the datatypes of both mappings are the same!
    But the application won't work any more.

    We figured out that a field entry in the class description of the app.config fixes this problem, but that means to manually set all the column names, which is a a considerable amount of work in a huge data model. It would be a great help if these entries could be generated by OA.

    Thanks, Martin







  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 08 Dec 2008 Link to this post

    Hello Martin,
    there is an API to traverse the complete mapping. It is in the OpenAccess.Runtime libary in the Debug namespace. With the help of that API you can proint out and diff the complete mapping.

    Just call the static method: Telerik.OpenAccess.Debug.ModelHelper.GetModelFor(scope) to get the information.

    Best wishes,
    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top