Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx&#160; The information in this post is out of date. Visit msdn.com/data/ef for the latest information on current and past releases of EF. For Code First Migrations see http://msdn.com/data/jj591621 &#160; At the end of September we released Alpha 3 ofen-USTelligent Evolution Platform Developer Build (Build: 5.6.50428.7875)re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10254796Tue, 10 Jan 2012 00:27:38 GMT91d46819-8472-40ad-a661-2c78acb4018c:10254796bricelam<p>Oops, I mean <a rel="nofollow" target="_new" href="http://forums.iis.net/1144.aspx">forums.iis.net/1144.aspx</a></p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10254796" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10254795Tue, 10 Jan 2012 00:25:10 GMT91d46819-8472-40ad-a661-2c78acb4018c:10254795bricelam<p>@Colin Bowern: We&#39;ve hit a few limitations while implementing our Web Deploy provider. We&#39;ve raised these to the Web Deploy team.</p>
<p>Having said that, a couple of ways to get .NET 4 code running from a provider are:</p>
<p>1. Configure Web Deploy to run as a .NET 4 process. This may not, however, be possible for all scenarios.</p>
<p>2. Launch a separate .NET 4 process from your provider.</p>
<p>For additional Web Deploy support, I&#39;d try &lt;a href=&quot;<a rel="nofollow" target="_new" href="http://forums.iis.net/1144.aspx&quot;&gt;their">forums.iis.net/1144.aspx&quot;&gt;their</a> forums&lt;/a&gt;.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10254795" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10254442Mon, 09 Jan 2012 04:02:55 GMT91d46819-8472-40ad-a661-2c78acb4018c:10254442Colin Bowern<p>Any chance you could share what you are doing to get the MSDeploy provider to work? &nbsp;I hit an issue working on a provider that required to be able to access CLR 4 assemblies.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10254442" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10252158Sat, 31 Dec 2011 01:54:29 GMT91d46819-8472-40ad-a661-2c78acb4018c:10252158mayojersey<p>The Atlanta Falcons have made franchise history by clinching asecond straight playoff berth, but if they don&#39;t make improvementson both sides of the ball, the team could be in line for anotherquick postseason exit.Atlanta tries to reach double-digit wins in a second consecutiveyear for the first time Sunday when it hosts a Tampa Bay Buccaneersteam looking to avoid closing the season on a 10-game losingstreak.With Chicago losing at Green Bay the previous night, the Falcons(9-6) clinched a wild-card spot before they took the field Mondayin New Orleans. &nbsp; &nbsp; <a rel="nofollow" target="_new" href="http://www.officialpatriotsonline.com/">www.officialpatriotsonline.com</a></p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10252158" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10251906Thu, 29 Dec 2011 22:47:16 GMT91d46819-8472-40ad-a661-2c78acb4018c:10251906Damien<p>Just wondering when or if a second level cache will be added to the Framework. It would be nice if his was shipped with EF</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10251906" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10251247Tue, 27 Dec 2011 16:55:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:10251247parajao<p>Hi, I&#39;m having problems with migrations since the Model value for the _MigrationHistory table is about 8800 chars.</p>
<p>Should I manually change the dimension of this field?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10251247" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10251104Tue, 27 Dec 2011 01:48:11 GMT91d46819-8472-40ad-a661-2c78acb4018c:10251104msbigot<p>Would it be possible to have CF Migrations read annotations in order to determine the [DiscriminatorColumn] in SINGLE_TABLE / Table per Hierarchy Inheritance? &nbsp;Then the public classes that extend the abstract super class could use a [DiscriminatorValue]. &nbsp;This is how a lot of legacy sql tables work in the real world</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10251104" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10249585Tue, 20 Dec 2011 13:29:14 GMT91d46819-8472-40ad-a661-2c78acb4018c:10249585Diego B Vega [MSFT]<p>@Capellio: you will need references to both EntityFramework.dll and System.Data.Entity.dll as some parts of the API, like the EntityState enum, are defined in the later. &nbsp;Hope this helps.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10249585" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10249570Tue, 20 Dec 2011 12:37:57 GMT91d46819-8472-40ad-a661-2c78acb4018c:10249570Capellio<p>First of all I think Migrations is one of the last functionalities I missed in the CTP, so great job done. However I have one tiny problem.</p>
<p>I switched over to Migrations and therefore had to include a reference to EntityFramework instead of the System.Data.Entity. </p>
<p>Now I&#39;m having problems with changing the state of a entity with the enumertor EntityState. It appears not to be included in EntityFramework and using Migrations I can not use the System.Data.EntityState anymore.</p>
<p>What is the replacement or workaround for this?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10249570" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10248777Sat, 17 Dec 2011 01:57:02 GMT91d46819-8472-40ad-a661-2c78acb4018c:10248777Pete Mack<p>I am having a problem with Model-first programing with many-to-many relations.</p>
<p>Entity framework keeps changing the names of the join fields back to RelationName_FieldName, even after I try to set the field name to just FieldName.</p>
<p>Bug report is here:</p>
<p><a rel="nofollow" target="_new" href="http://connect.microsoft.com/VisualStudio/feedback/details/542106/entity-framework-chaning-the-column-names-of-an-association-table">connect.microsoft.com/.../entity-framework-chaning-the-column-names-of-an-association-table</a></p>
<p>This is a real headache, because we want to do model-first programming, so that we can add custom attributes to our entities.</p>
<p>- pmcilroy@ms</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10248777" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10248200Thu, 15 Dec 2011 17:51:46 GMT91d46819-8472-40ad-a661-2c78acb4018c:10248200Andrew J Peters<p>@Kristoffer,</p>
<p>Yes, check out the DbMigrator class.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10248200" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10247990Thu, 15 Dec 2011 07:31:25 GMT91d46819-8472-40ad-a661-2c78acb4018c:10247990Kristoffer Jansson<p>Is it possible to trigger a database update programmatically from within the application at runtime? Otherwise I&#39;m not sure how to use this while automatically deploying/updating my application on hundreds of customers&#39; servers?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10247990" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10247972Thu, 15 Dec 2011 06:36:58 GMT91d46819-8472-40ad-a661-2c78acb4018c:10247972Konstantin Tarkus<p>Here is my alternative to EntityFramework.Migrations package; instead of maintaining model change history it physically compares database schema with EF Code-First model during database initialization or/and manually by request.</p>
<p>If you develop both model and db schema by hand, it allows to find quickly all the differences / incompatibilities between the db schema and the model.</p>
<p><a rel="nofollow" target="_new" href="https://github.com/kriasoft/data">github.com/.../data</a> - It&#39;s an alpha version. Feedback is always welcome!</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10247972" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10246940Mon, 12 Dec 2011 22:39:10 GMT91d46819-8472-40ad-a661-2c78acb4018c:10246940Jon Miller2<p>@zl1</p>
<p>Actually, I see a benefit to having the column name included in the name of the foreign key. For example, I have some tables where there are multiple foreign keys linking to the same table. SQL Management Studio just appends a digit to the end of the foreign keys. This makes it difficult to tell which foreign key corresponds to which navigation property if you do something like database first (using non-code first). So, it&#39;s useful to include the column name in an example like the following. A grant has a local investigator and a principal investigator. Both of these foreign keys map to the Person table. So, if it does include the column name like you say, I see that as a good thing and better than what SSMS does by default.</p>
<p>Grant</p>
<p>LocalInvestigatorId</p>
<p>PrincipalInvestigatorId</p>
<p>Person</p>
<p>Id</p>
<p>I.e. I would rather have</p>
<p>FK_Grant_Person_LocalInvestigatorId</p>
<p>FK_Grant_Person_PrincipalInvestigatorId</p>
<p>FK_Grant_Person</p>
<p>FK_Grant_Person1</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10246940" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10246846Mon, 12 Dec 2011 17:44:46 GMT91d46819-8472-40ad-a661-2c78acb4018c:10246846Fluent API<p>Is the fluent API still supported with Code First Migrations? &nbsp;I don&#39;t see my mapping classes being called when Update-Database is called. &nbsp;Also, do you have to shut down visual studio and reload in order for Update-Database to pick up any changes to your class model after having called it previously? &nbsp;That seems to be the behaviour.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10246846" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10246240Fri, 09 Dec 2011 22:18:55 GMT91d46819-8472-40ad-a661-2c78acb4018c:10246240Konstantin Tarkus<p>..for example one developer updated the model, created new migration file and checked in all changes including migration file under source control system. Then another developer pulled recent version into his branch, but he needs to merge it before continuing working on his own branch of the project.. won&#39;t there be problems during such merge operations?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10246240" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10246237Fri, 09 Dec 2011 22:14:41 GMT91d46819-8472-40ad-a661-2c78acb4018c:10246237Konstantin Tarkus<p>Can you please describe a workflow for working with EntityFramework.Migrations in a team and its project hosted under source control system?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10246237" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10246231Fri, 09 Dec 2011 22:07:57 GMT91d46819-8472-40ad-a661-2c78acb4018c:10246231Konstantin Tarkus<p>What if I want complete control over DB schema, willing to create it manually. But from time to time I need to check if database model is in sync with EF models. I would appreciate having a tool allowing me to run that type of comparison. I would use it instead of current version of &quot;EntityFramework.Migrations&quot;.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10246231" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10245513Thu, 08 Dec 2011 11:44:59 GMT91d46819-8472-40ad-a661-2c78acb4018c:10245513Remco Blok<p>I posted a question on <a rel="nofollow" target="_new" href="http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/c81dfd60-ede5-4873-9f4d-04e240c293c2">social.msdn.microsoft.com/.../c81dfd60-ede5-4873-9f4d-04e240c293c2</a>. I would like guidance on how you could handle different database providers (MSSQL, Oracle) and execute database provider specific sql.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10245513" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10243442Thu, 01 Dec 2011 18:19:14 GMT91d46819-8472-40ad-a661-2c78acb4018c:10243442Rowan Miller<p>@Felipe Fujiy – I’ve followed up on the forum thread you linked to</p>
<p>@ Lynn Eriksen – You will need to have SQL CE 4.0 installed and then add the following line to the constructor in your Configuration.cs class:</p>
<p>SetSqlGenerator(&quot;System.Data.SqlServerCe.3.5&quot;, new System.Data.Entity.Migrations.Sql.SqlCeMigrationSqlGenerator());</p>
<p>@shawn – We have an item on our backlog to look at this but we weren’t planning to put it in v1. We’ve had a few folks ask about it though so we’ll reconsider it for v1. Obviously –script would fail if you had arbitrary code included in a migration.</p>
<p>@Felipe Fujiy – The migrations code will roll into the same assembly so you would still just have one reference in your project. We are planning to add an Enable-Migrations command that would add the Migrations folder so you wouldn’t get it in every project you install EF to.</p>
<p>@zl1 – We need to add the column names on the end to ensure the name is unique if you have multiple FKs between the same tables. You can supply your own name via the API in the migration code file.</p>
<p>@zl1 – It is enabled by default. If you generated code migrations with Alpha 3 they won’t have the create index calls, but you can add them in. If you generate new code migrations with Beta 1, or perform automatic migrations, then indexes should be created on any columns that are foreign keys. If you have a situation where this isn’t happening then please start up a thread in the pre-release forum (link is in the blog post). Include your model classes etc. and we’ll work out what is going wrong.</p>
<p>@lynn eriksen – We’ll take a look at the issues you were having with CE, glad that you are up and running with SQL Express.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243442" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10243426Thu, 01 Dec 2011 17:43:35 GMT91d46819-8472-40ad-a661-2c78acb4018c:10243426Andrew J Peters<p>@Sam Striano,</p>
<p>By convention, Code First will enable cascade delete for 1..* associations. Perhaps this is what you are seeing?</p>
<p>Cheers,</p>
<p>Andrew.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243426" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10243420Thu, 01 Dec 2011 17:37:54 GMT91d46819-8472-40ad-a661-2c78acb4018c:10243420lynn eriksen<p>Got things work using Sql Express and a .mdf file. This is -really- nice! :)</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243420" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10243189Thu, 01 Dec 2011 06:18:38 GMT91d46819-8472-40ad-a661-2c78acb4018c:10243189lynn eriksen<p>I&#39;m in CST, so the date for my post in PST is Wednesday, 11/30/2011.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243189" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10243188Thu, 01 Dec 2011 06:17:08 GMT91d46819-8472-40ad-a661-2c78acb4018c:10243188lynn eriksen<p>I am getting an error when using SqlCE. Using the &#39;- verbose&#39; flag I can see that all of the table and index relaerd scripts run, but then the methods under the section [Inserting migration history record] I get the error. The full details are located in the pre-release forum under the titled post &quot;Migrations Beta1 - Error when calling &#39;update-database&#39; when using SqlCe&quot; created on Thursday, 12/1/2011.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243188" width="1" height="1">re: Code First Migrations: Beta 1 Releasedhttp://blogs.msdn.com/b/adonet/archive/2011/11/29/code-first-migrations-beta-1-released.aspx#10243163Thu, 01 Dec 2011 05:32:56 GMT91d46819-8472-40ad-a661-2c78acb4018c:10243163zl1<p>&quot;Migrations will now create indexes on foreign key columns.&quot;</p>
<p>I generated the script using Update-Database, and I did not see any CREATE INDEX statements for foreign keys. Is there some kind of property setting for this?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243163" width="1" height="1">