Skip to main content

How to change the database structure

    Zonal

  • OCR
    DataAccess
    uses
  • a
      file-based
    • SQL
      ZonalOcrDb.edmx.sqlCE -database updatestored initialon creationthe queries
      user's
    • computer
    • to
      ZonalOcrDb.edmx
      persist
    • templates,
        fields,
      • etc.
        <edmx:StorageModels>If ->you <EntityType>
        need
      • to
      • make
        <edmx:ConceptualModels>a ->change <EntityType>
        to
      • the
      • structure
        <EntitySetMapping>
        of
      • the
      database
    • (tables,
      columns, or whatever) follow these instructions.

      Update modelsthe inUpdateDbTool /EntityModel/
  • UpdateDbTool
  • project
    • UpdateDbManager.cs
      • create an alter statement
      • create a query that determines if the database is at the new version
      • create a function that calls your alter statement(s)
      • add a version that that calls your previous function
    • This tool will update the user's database when they install the new version of Zonal. To test your changes, set UpdateDbTool as the startup project in Visual Studio and run it. Probably need to be in admin mode
    Apply migration to the empty database
    • Update copy of ZonalOcrDb.sdf
    Update the ZonalOCR project
    • DataAccess
      • ZonalOcrDb.edmx.sql - update initial creation queries
      • ZonalOcrDb.edmx
        • <edmx:StorageModels> -> <EntityType>
        • <edmx:ConceptualModels> -> <EntityType>
        • <EntitySetMapping>
      • Update models in /EntityModel/