title: Why does Entity Framework's EF Migrations Add-Migration step require a database connection string?
body: <p>I am trying to use and understand EF Migrations (using EF 4.3.1, Code First).  In order to scaffold a new change, I have to use a command like this:</p>
  
  <pre><code>Add-Migration MyMigration
     -ConnectionString "Data Source=.;Initial Catalog=mydb;" 
     -ConnectionProviderName "System.Data.SqlClient"
     -StartUpProjectName MyWebsite 
     -ProjectName MyEF.Migrations
  </code></pre>
  
  <p>Why does Add-Migration require connection string data?  <code>Update-Database</code> needs one, that makes sense.  But doesn't Add-Migration have everything it needs from the DbContext and the Configuration?</p>
  
  <p>It's not simply idle wonder, it's very confusing to give it a database, because we have a "multi-tenancy" thing where the desired database is flexible and may change from request to request, let alone at static compile time.  So if <code>Add-Migration</code> is actually USING that database for anything, we have a problem.</p>
  
  <p>UPDATE: We gave up on EF Migrations and are using <a href="https://github.com/schambers/fluentmigrator/" rel="noreferrer">Fluent Migrator</a> instead, and are happy.  It's much, much faster, even counting the fact that we have to write some things twice (once for the EF object and once for the Migration), and it doesn't have the problems discussed in this question.</p>