<p>I installed VS SP1 and played around with Entity Framework.</p>

<p>I created a schema from an existing database and tried some basic operations.</p>

<p>Most of it went well, except the database schema update.</p>

<p>I changed the database in every basic way:</p>

<ul>
<li>added a new table</li>
<li>deleted a table</li>
<li>added a new column to an existing table</li>
<li>deleted a column from an existing table</li>
<li>changed the type of an existing column</li>
</ul>

<p>The first three went well, but the type change and the column deletion did not followed the database changes.</p>

<p>Is there any way to make is work from the designer? Or is it not supported at the moment? I didn't find any related material yet, but still searching.</p>

[{'answer_id': 12441, 'author': 'Darren Kopp', 'author_id': 77, 'author_profile': 'https://Stackoverflow.com/users/77', 'pm_score': 4, 'selected': True, 'text': "<p>I would guess that possibly those don't happen because they would break the build for existing code, but that's just a guess on my part.</p>\n\n<p>Here's my logic:</p>\n\n<p>First, EF is supposed to be more than 1:1 table mapping, so it's quite possible that just because you are deleting a column from table A doesn't mean that for that entity, there shouldn't be a property Description. You might just map that property to another table.</p>\n\n<p>Second, changing a type could just break builds. that's the only rationale there.</p>\n"}, {'answer_id': 15668, 'author': 'Chris Patterson', 'author_id': 1882, 'author_profile': 'https://Stackoverflow.com/users/1882', 'pm_score': 1, 'selected': False, 'text': "<p>From the demos of the designer I've seen, it's not a flawless tool. It is a version 1.0 product, so it's bound to have some pain points. The change type is one of them it seems. From watching the designer and the code generation, I figured that one would break either at compile time (not likely) or at run-time (when the model is actually executed).</p>\n"}, {'answer_id': 80854, 'author': 'vintana', 'author_id': 13594, 'author_profile': 'https://Stackoverflow.com/users/13594', 'pm_score': 0, 'selected': False, 'text': '<p>You need to delete the column by yourself from the designer or the XML file.</p>\n'}, {'answer_id': 128955, 'author': 'scotta', 'author_id': 2066290, 'author_profile': 'https://Stackoverflow.com/users/2066290', 'pm_score': 3, 'selected': False, 'text': "<p>I've found that, in general, there are still quite a few bugs with the 'Update Model from Database' functionality.</p>\n\n<p>Keys are the killer for me - I've yet to have any modification I make to a foreign-key relationship or to add a Primary Key to a table and have the updater work correctly (in that it will give a compile error on the generated code) - but to solve the problem it's a simple matter of deleting the model and re-importing (only takes a minute) - this is less than ideal obviously, but I've never had a failure from a 'fresh' import.</p>\n"}, {'answer_id': 1225137, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>As mentioned before, you can just delete the column from the designer. As far as changing the data type of the column: just refresh the model from the database then go to the table mappings and select the column that you changed in the DB. the values on the right represent your model, oddly enough this does not get updated automatically, but just select the column to the right and go to properties and change the data type there. It should become a drop down menu. </p>\n\n<p>Cheers.</p>\n\n<p>Ruddy</p>\n'}, {'answer_id': 1546021, 'author': 'fyasar', 'author_id': 88032, 'author_profile': 'https://Stackoverflow.com/users/88032', 'pm_score': 0, 'selected': False, 'text': '<p>I builded similar application like your requested. But my solution was to hard.\nI will try to tell;</p>\n<ol>\n<li><p>You have to create your own database management clases and these objects will be responsible for create, update database schema (I created manually that).</p>\n</li>\n<li><p>I saw good article and source code on <a href="http://blogs.msdn.com/adonet/archive/2008/06/20/edm-tools-options-part-1-of-4.aspx" rel="nofollow noreferrer">ADO.NET Team blog</a> then you can also download EDMTools from this blog, it open source. And you can also implement model generation and update routines from that into your project.</p>\n</li>\n<li><p>Finally when the your schema changed you should recreate and bind your model and rebuild your data assembly during runtime. But you have to know most important think, you should tie your data model assembly to your project with loosely coupled (check out this <a href="http://social.msdn.microsoft.com/forums/en-US/clr/thread/093c3606-e68e-46f4-98a1-f2396d3f88ca" rel="nofollow noreferrer">post</a>)</p>\n<p>Other way, you should wait for EF 4.0 release (it CTP 1 now), they announced that they will provide create,delete,update DatabaseScript functions.</p>\n</li>\n</ol>\n<p>Good lock</p>\n'}, {'answer_id': 14855337, 'author': 'Konrad Brodzik', 'author_id': 1606584, 'author_profile': 'https://Stackoverflow.com/users/1606584', 'pm_score': 0, 'selected': False, 'text': "<p>The way I'm doing this (and I'm doing all of the things you mention, plus renaming columns) is by making changes to the database and regenerating the EF code using EF Code First.</p>\n\n<p>I'm not tampering with the EF Code First classes for the good or the bad (including nonsensically named columns for relations) to ease the process.</p>\n\n<p>No designer or ORM schema generator will be able to make changes to your production database if it has constrained data in it. This is why you should always start with checking if your changes to the DB are feasible, try them on a development database and then adapt your code to reflect the changes.</p>\n"}]
['https://Stackoverflow.com/questions/12142', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/968/']