A set of WF4 Workflows and T4 templates to perform data and schema migration for the 'Generate Database from Model' feature of the Entity Designer. This also includes a "Workflow Manager" to help manage and edit workflows.
Sql Server Data Tools is what you should use for Sql Server 2012. Run Generate Database From Model. This will return you a script to create a new database. I actually edit the Database Generation tt4 script to do a drop database and create database at the beginning. Then run this script and you will have an empty database with the schema from the EDM. Then use the SSDT Compare Tool and target your database project. The compare tool will give you a check list of differences you can apply to your database project. Check the changes you want it make and the click Update. Now your database project schema will be synced with your EDM. Of Course you might still want other things in your database project like reporting stored procs or performance indexes. Just uncheck the Drop/Delete action on those during the compare process.
This tool is a phenomenal time savings. Generating a "sync database" project eliminated our need for in-house deployment and migration tools. Prior to this power pack, we really weren't interested in Database projects. Now, they are a great feature.
I look forward to this being included in the next version of the Entity Framework. My only concern is that this project is stagnating: I don't see bugs being addressed and I fear that it will not work with the next release of EF. It has been almost a year with no updates, despite the presence of bug reports.
Just started working with the Entity Designer Database Generation Power Pack and I must say it is a very solid first offering. Model first design is something new in EF4/VS 2010 and it's great to see a tool available that has evolved alongside VS 2010.
I was very happy to see that it comes with the ability to synchronize with a database project right out of the box. In my opinion, this is the most valuable feature. In the past, the actual production database was considered to be the "truth". As our tools have evolved, this has shifted to where the model, however stored, is the "truth".
Inquiring minds want to know! Is there any hope to using this for our Model-First changes synchronizing/migrating to the database without dropping tables, etc. in Visual Studio 2012?
Hi
It seems you are not planning to continue this power pack. Could you please put the source code of this extension on CodePlex. This way people could make it available for VS2012 and EF5. I bet it would be easier for everyone to let the public implement VS2012 support than rather wait for any update here.
Thanks.
Hi,
I was just wondering if this power pack is planned for release with visual studio 2012 and EF5 any time soon? I am about to embark on a bit of a re factor of a project as I am running into performance issues with TPT. If I had TPH my problems would all go away ;) Just wondering if to wait or not, or if there are any alternatives out there? I am using EF5 model first with spatial and enums.
Thanks.
Hi,
Please tell me my mistakes or some workarounds for my case below.
It seems to be the same that Maverjk said before.
1. Right-click in edmx designer and show Database Generation Workflow Manager.
2. Select a item in left pane. - I can select any to repro.
3. Click "Select Workflow for Database Generation" in right pane.
The green check will never shows with no errors.
4. Click "Next".
5. Progress Bar is shown and successfully proceeded.
Drop and Create SQL scripts are generated and shown.
Which workflow I selected at first step, the generated SQL scritps are same:
it seems to be my selection is not applied.
If I manually select "CSDLToMSL_TPT.tt (VS)" template and "Generate Migration T-SQL.xaml (VS)" workflow
in model designer property grid and generate database with Database Generation Workflow Manager,
it causes error like below.
Error occured in processing 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\CSDLToMSL_TPT.tt'
At Line 0, Col 0: Converting.
ArgumentNullException: Can't set value to null.
Parameter Name: s
At: StringReader.ctor
...
CSDLToMSL_TPT.tt: line 99
...
(sorry for error message summary, because of orginal one is japanese)
My environment is
Windows XP Pro. SP3
Visual Studio 2010 Pro. SP1
Entity Designer Database Generation Power Pack 1.2 that I downloaded from this page now.
In Extension Manager the version is "1.0".
The "Database Generation Workflow Manager" shows "v1.1".
Hi,
I've imported via "update model from db" a stored procedure.
I created automatically the associate complex type and at the end I checked if edmx file has everything.
Then I ran the "generate db from model" and in the Model Browser (and in the edmx file) the definition of stored procedure has been disappeared. Is this a bug or I'm wrong in doing something?
thanks
Christian
Hi,
I've two issues using power pack.
First is when I modify the model a lot and have some data in database I've got the message " rows were detected ... " and I cannot migrate.
Second for the above-mentioned reason I use dacpac and perform 'schema comparision' in the VS.
However the dacpac is not correctly generated. In edmx model entites have nullable properties but dacpac have tables with all 'not null' allowed columns.
Thanks for any help.
KD
Hi, I just downloaded and installed the latest version, but I get the following error trying to process the template:
"Encountered the following errors while processing the template 'c:\program files(x86)\microsoft visual studio 10.0\common 7\ide\extensions\microsoft\entity framework tools\dbgen\csdltossdl_tph.tt: Line0, Column 0: 'Compiling transformations: metadata file 'c:\program files(x86)\microsoft visual studio 10.0\common 7\ide\extensions\microsoft\entity designer database generation power pack\1.0.1\microsoft.data.entity.design.databasegeneration.toolkit.dll' could not be found".
If there is any spelling in that it's because i typed it all in...whew...
Anyway, the program is looking for "\entity designer database generation power pack\1.0.1\" when in actuality the file is located in "\entity designer database generation power pack\1.0".
How do I fix this?
Scott
Hi Scott -
Thanks for bringing this up - I just put up the fix. If you want to get your install working, open up the 'c:\program files(x86)\microsoft visual studio 10.0\common 7\ide\extensions\microsoft\entity framework tools\dbgen\csdltossdl_tph.tt' file and change the @assembly reference to the DatabaseGenerationToolkit.dll assembly to point to the one in the 1.0 folder.
Also, I'm sorry you had to type all that in! You can actually Ctrl C on that error dialog (in any Windows error dialog, actually) and Ctrl V the text. Kind of obscure, I know...
Hope that helps,
adi
Hi Adi,
Thank you for the update. I downloaded and installed the latest, but ran into another error (and thank you for the copy/paste tip).
The template activity 'SsdlToDdlActivity' cannot be invoked because the given 'TemplatePath' input file 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToSQL10.tt' does not exist.
I selected "Generate T-SQL Vai T4(TPH)" and walked through the wizard. This error popped up when it started to generate the DDL.
Am I doing something wrong?
Thanks,
Scott
Hey Scott - does that file exist on your file system? That particular template gets installed when you install Visual Studio (it's not part of the power pack) so I am surprised that it is raising an error. Perhaps you deleted it by accident? If it doesn't exist anymore, please send me your email address and I can send you the template and any other 'standard' files in that folder again.
Is there a way to not pluralize the table names when generating using this tool?
I started Database First using single table names, now I want to switch to model first, but its using EntitySets (plural) instead of Entity names for table names.
Is it possible to mix the Table Per Type and Table Per Hierarchy database generation for a model?
For example a Person->Employee hierarchy would be more naturally if it is a TPT, whereas other types of hierarchies would be more convenient if they are TPH.
Hi Tobias,
Unfortunately with the power pack right now, no. However we've actually been thinking about this and have some prototypes that work over hybrid models. In a few months you'll see some of this work in a new version of the power pack. I have one question though -- what do you think the experience should look like?
Code First has a concept of a fluent mapping API that can be used to explicitly indicate what the tables should look like: http://blogs.msdn.com/efdesign/archive/2009/10/12/code-only-further-enhancements.aspx. Would this suffice for you for Model First or would you prefer something more?
Thanks,
adi