title: MVC5 EF6 CodeFirst use two database for debug and release
body: <p>I have a project of intern website for my company.
  I use MVC5 with Entity Framework 6 on a Code First project.</p>
  
  <p>It's an Intranet for my company so I want two database.
  1 in production (release).
  1 in dev (Debug).</p>
  
  <p>I've edited the Web.config, Web.Debug.config and Web.Release.config files like that :</p>
  
  <p>Web.Config</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="Connexion" connectionString="Data Source=[MYSQLSERVER];Initial Catalog=Intranet;Persist Security Info=True;User ID=[MYUSER];Password=[MYPASS]" providerName="System.Data.SqlClient"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Web.Debug.Config</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="Connexion" connectionString="Data Source=[MYSQLSERVER];Initial Catalog=Intranet;Persist Security Info=True;User ID=[MYUSER];Password=[MYPASS]" providerName="System.Data.SqlClient"
       xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Web.Release.config</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="Connexion" connectionString="Data Source=[MYSQLSERVER];Initial Catalog=IntranetRelease;Persist Security Info=True;User ID=[MYUSER];Password=[MYPASS]" providerName="System.Data.SqlClient"
       xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>When I deploy my project using Web Deploy in release mod, all the job is done and the final Web.Config have good value <code>IntranetRelease</code> for the catalog.</p>
  
  <p>My problem is that my site don't work cause the database <code>IntranetRelease</code> isn't updated from <code>Intranet</code> database.</p>
  
  <p>I have made a perfect copy of <code>Intranet</code> and create manually <code>IntranetRelease</code>. It work but I can't do that when peoples will use the website cause all the data will be on <code>IntranetRelease</code> database.</p>
  
  <p>I've tried in my project to do an <code>Add-Migration xxx</code> in release mode but it doesn't change anything.</p>
  
  <p>The goal is this :</p>
  
  <p>When the release intranet is in work, I work on the dev database. When all my changes are good for make a release, I want to deploy a new version with Web Deploy and <code>do something</code> to update the <code>IntranetRelease</code> database with my changes without lost any data on it.</p>
  
  <p>Thanks for help and sorry for my poor english.</p>