+1-888-365-2779
Try Now
More in this section

Forums / Deployment / Deploying custom modules that use ORM

Deploying custom modules that use ORM

5 posts, 0 answered
  1. Michiel
    Michiel avatar
    37 posts
    Registered:
    14 Dec 2010
    23 Mar 2011
    Link to this post
    When developing a module that requires multiple tables for storing data (as I understand this right now, none of the data is 'extending' the Document class) can we completely generate these database tables using the ORM?

    In other words, does the ORM support migrations/schema changes?

    Thanks! 

    PS. I'm new to Sitefinity and still evaluating...
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Mar 2011
    Link to this post
    Hi Michiel,

    Please check the following articles

    • http://www.telerik.com/help/openaccess-orm/visual-designer-migration-consideration-update-db-schema.html
    • http://www.telerik.com/help/openaccess-orm/openaccess-tasks-howto-change-schema-while-preserving-the-data.html

    All the best,
    Ivan Dimitrov
    the Telerik team
  3. Michiel
    Michiel avatar
    37 posts
    Registered:
    14 Dec 2010
    24 Mar 2011
    Link to this post
    Hi!

    Thanks for the reply, from what I read the schema changes are not applied automatically when deploying a newer version of a custom Sitefinity module.

     you only need to execute it against the database and your migration will be done.

    Does that mean that after deploying an updated Sitefinity module we also need to run queries against the database? 
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    29 Mar 2011
    Link to this post
    Hello Michiel,

    If you have changes to the database you should run scripts to update the schema. Each module has a method Upgrade

    public override void Upgrade(SiteInitializer initializer, Version upgradeFrom)
            {
            }

    where you can place a custom logic that checks for a module version and performs necessary updates to the database.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
  5. Michiel
    Michiel avatar
    37 posts
    Registered:
    14 Dec 2010
    29 Mar 2011
    Link to this post
    Ok, I will have alook at that, thanks!
5 posts, 0 answered