More in this section
Forums / Developing with Sitefinity / Extend Data Model: Modifications to Existing Custom Type

Extend Data Model: Modifications to Existing Custom Type

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Brandon
    Brandon avatar
    0 posts
    28 Sep 2015
    17 Nov 2016
    Link to this post

    I have followed the directions for extending the data model by setting up a custom type:

    I was able to successfully setup my type... however, the documentation doesn't cover a few topics:

    1. How to remove a prior attempt at type setup and re-run the  DB changes?
    Based upon my research... drop the type's table and delete the provider from sf_schema_vrsns and sf_schema_vrsns_meta_types (not mentioned). Discovered this via:

    2. How to flag the schema as requiring an update?
    The documentation doesn't include this detail either. By decompiling the source... I found that Telerik.Sitefinity.Data.OA.OpenAccessConnection.MetadataUpgradeFacade's CheckForUpgrade method is reading the CurrentSchemaVersionNumber property.  By default... this looks at the Assembly Builder number of the project and by default that number is static. So changing your type and mappings is not triggering a schema update. To fix this... either have visual studio auto-increment the build number of the project or override CurrentSchemaVersionNumber in the provider and change it on every edit. To auto-increment the build number... open AssemblyInfo.cs and update the AssemblyVersion line to [assembly: AssemblyVersion("1.0.*")]. Details on this syntax at:

    Now the questions...

    3. How do you modify existing properties/columns? Basically... how do you write code migrations in this context? Examples might be property/column renames, extending a column's length, or changing requiredness.

    4. How do you delete an existing property/column?

    5. How do you add a new property/column?

    6. How do you migrate existing data during these changes?

    7. Can you setup a series of migration/deployment steps?

    Entity framework has migrations to accomplish this... but there's no mention in the Sitefinity documentation that I can find on a proper approach in the "Extend Data Model" context.

    Thanks for the help!

1 posts, 0 answered