Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase Change Management - Setup for Initial Create Scripts, Subsequent Migration Scripts
    text
    copied!<p>I've got a database change management workflow in place. It's based on SQL scripts (so, it's not a managed code-based solution).</p> <p>The basic setup looks like this: </p> <pre><code>Initial/ Generate Initial Schema.sql Generate Initial Required Data.sql Generate Initial Test Data.sql Migration 0001_MigrationScriptForChangeOne.sql 0002_MigrationScriptForChangeTwo.sql ... </code></pre> <p>The process to spin up a database is to then run all the Initlal scripts, and then run the sequential Migration scripts. A tool takes case of the versioning requirements, etc. </p> <p>My question is, in this kind of setup, is it useful to also maintain this:</p> <pre><code>Current/ Stored Procedures/ dbo.MyStoredProcedureCreateScript.sql ... Tables/ dbo.MyTableCreateScript.sql ... ... </code></pre> <p>By "this" I mean a directory of scripts (separated by object type) that represents the create scripts for spinning up the <em>current/latest</em> version of the database.</p> <p>For some reason, I really like the idea, but I can't concretely justify it's need. Am I missing something?</p> <p>The advantages would be:</p> <ul> <li>For dev and source control, we would have the same object-per-file setup that we're used to</li> <li>For deployment, we can spin up a new DB instance to the latest version either by running the Initial+Migrate, or by running the scripts from Current/</li> <li>For dev, we do not need a DB instance running in order to do development. We can do "offline" development on the Current/ folder.</li> </ul> <p>The disadvantages would be:</p> <ul> <li>For each change, we need to update the scripts in the Current/ folder, as well as create a Migration script (in the Migration/ folder)</li> </ul> <p>Thanks in advance for any input!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload