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.
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".
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
Hello, after installing the June CTP i cannot use the power pack functionality any more.
If I use the Database Generation Workflow “TablePerTypeStrategy.xaml (VS)” the script is generated correctly. If I use any Workflow from the power pack an exception is thrown:
Die Datei oder Assembly "Microsoft.Data.Entity.Design.DatabaseGeneration, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden. Cheers
It happens because the dll running the workflow for the database sql generation is trying to find the assembly Microsoft.Data.Entity.Design.DatabaseGeneration with version 10.0.0.0. (specific version reference) if you have entity framework june 2011 CTP installed, then you have the version 10.6.0.0. and it gives you an error.
Workaround:
You can do a binding redirect on the visual studio exe ( devenv.exe.config) to force the generation workflow to use the new dll :
Add this under dependentassembly tag:
<assemblyIdentity name="Microsoft.Data.Entity.Design.DatabaseGeneration"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0"
newVersion="10.6.0.0"/>
It seems work ok but I haven't fully tested it.
Hi,
I have a query view and marked the entity set with edmx:copytossdl=false . THe database generation pack still generates the table and replaces the query view with a mapping to the newly generated table. I love the power pack, but this seems to be awkward.
Hi
I have download it but it's still available the version 1.1, I have seen that doesn't work the button "Set Workflow for Database Generation" and also doesn't appear any green flag.
Moreover i have try to test this tools setting mannually the "Database Workflow Generation" inside the model property (I'm using VS 2010 ultimate sp1), but I have found problems to generate a database SQL Server File(.mdf) or SQL CE 4(.sdf)from the model, there is always the same error to indentify the schema provider.
There is some kind of solution to this kind of problems?
Thanks in advantage to anyone that can help to understand.
When right-clicking the entity designer and selecting "Generate database from model", the new Workflow Manager UI will not appear; instead, the old DDL window shows. The new database generation workflows are available anyway, and they work.
I am using VS 2010 Ultimate SP1 and powerpack version 1.2. What am I missing or doing workng?
Hello, I want to create a custom workflow with a few additional steps. I've cloned the standard one to my project and edited the xaml file but all my modifications are overwritten when I start db generation process. I'd be thankful for any hints and suggestions how to workaround this issue. TIA.
Best regards.