it:ad:code_first:migrations:howto:common_procedures:deployment_beyond_dev

IT:AD:EF/CodeFirst/Migrations:HowTo:Common Procedures/Deployment beyond Dev

Migrations – whether Automatic Migrations/ or Coded Migrations/ – are great Dev solutions that allow for Agile updates to the Database. As for Releasing update:

At release time you have the choice between various strategies:

Generate (Manual Deployment) SQL Scripts

One approach is to dev using CodeFirst Migrations, and at release time, let the IT:AD:Continuous Integration environment generate scripts.

These scripts can be either complete drop/recreate scripts (fine for only a while), or incremental scripts.

See: Generate SQL Scripts

    • Advantages:
      • Classic approach, many tools.
    • Considerations:
      • An application's logic is the code – not the db.
        • Important: one has to actively ensure the Scripts remain generated output products of the Code – rather than Scripts become an entity in their own (eg, generate by another tool, with which the Code has to merge…not going to go well…think Localized Reference data which requires multiple table entries, and applications evolving, requiring new Reference data being added over development period).
        • Disadvantages:
        • See considerations, if the scripts become a secondary source of data (and not just an output).

Use CodeFirst Migrations that Are implemented when Running the Software

Migrations can be continued to be use when releasing beyond Dev as well.

CodeFirst Migrations and IT:AD:WebDeploy go well together (but so do SQL scripts for that matter).

    • Advantages:
    • Considerations:
      • it's a misunderstanding that one has to be “xtra careful”, as any Coded Migrations created are the basis of the SQL scripts generated and used later anyway.
      • Code Migrations can run sql – including running Batch imports, importing and running sql scripts, and other classical operations.
    • Disadvantages:
      • It's New – fewer people beyond devs themselves will understand the CodeFirst Migrations and will be mistrustful, and protective, shrieking at any failures, adding stress to an already stressful deployment scenario…
      • Requires that the Application's Identity has Create/Drop permissions (not just Read/Write permissions).
        • Note that that is less difficult to obtain, even in large enterprises, than 5 years ago.
          Questions:
  • How does one handle rollbacks?
    • Or is that just an additional Migration – just in the other direction?
  • /home/skysigal/public_html/data/pages/it/ad/code_first/migrations/howto/common_procedures/deployment_beyond_dev.txt
  • Last modified: 2023/11/04 02:45
  • by 127.0.0.1