title: How can I override SQL scripts generated by MigratorScriptingDecorator
body: <p><strong>Using Entity Framework 4.3.1 Code first, and Data Migrations.</strong></p>
  
  <p>I have written a utility to automatically generate the Migration scripts for a target database, using the MigratorScriptingDecorator.</p>
  
  <p>However, sometimes when re-generating the target database from scratch, the generated script is invalid, in that it declares a variable with the same name twice.</p>
  
  <p>The variable name is <strong>@var0</strong>.</p>
  
  <p>This appears to happen when there are multiple migrations being applied, and when at least two result in a default constraint being dropped.</p>
  
  <p>The problem occurs both when generating the script form code, and when using the Package Manager console command:</p>
  
  <pre><code>Update-Database -Script
  </code></pre>
  
  <p>Here are the offending snippets form the generated script:</p>
  
  <pre><code>DECLARE @var0 nvarchar(128)
  SELECT @var0 = name
  FROM sys.default_constraints
  WHERE parent_object_id = object_id(N'SomeTableName')
  </code></pre>
  
  <p>and</p>
  
  <pre><code>DECLARE @var0 nvarchar(128)
  SELECT @var0 = name
  FROM sys.default_constraints
  WHERE parent_object_id = object_id(N'SomeOtherTableName')
  </code></pre>
  
  <p>I would like to be able to override the point where it generates the SQL for each migration, and then add a "GO" statement so that each migration is in a separate batch, which would solve the problem.</p>
  
  <p>Anyone have any ideas how to do this, or if I'm barking up the wrong tree then maybe you could suggest a better approach?</p>