add-migration with the new multi context feature

Topics: EF Runtime
Oct 3, 2012 at 9:46 PM

The tooling for the add-migration command seems a little strange from the api perspective.  I created an app that uses two contexts and sets of migrations.  I expected that when I did an add-migration that the tooling would discover which class changed, which it did. Then from there I would have expected that it could determine the context and migration configuration to use based on the context type. Instead I needed to type the name of the configuration class to identify which migration set to add this migration to. That feels pretty  awkard since both of my migration configuration classes get autonamed to Configuration they just sit in different folders/namespaces because I used the -MigrationDirectory param when I enabled migrations.

Any plans to change this or reconsider the current command sets to optimize the experience around typing the least amount of specifiers into the add-migration command?

 

Thanks,

Eric

Developer
Oct 4, 2012 at 5:48 PM

Hi Eric,

We don't actually discover which class changed until we know the specific config type in question. The reason for this is that we need to know the DbContext type in order to build the latest model, which we then diff against the previous model - either in the last code migration or in the database for automatic migrations.

That said, we realize the current Add-Migration experience is a bit painful for multiple models in the same assembly. One thing we want to do is to implement PowerShell auto-complete on the values of parameters, so then at least specifying the target configuration would be easier.

Cheers,

Andrew.

Developer
Oct 4, 2012 at 6:09 PM

Hi Eric,

The work item for auto-complete is: Tab Expansion for PowerShell Cmdlets

Please add your vote and possibly a comment stating how important enabling this on the ConfigurationTypeName parameter is to you.

Thanks,
Brice

Oct 4, 2012 at 11:44 PM

@Andrew

Thanks for the replies. I understand your explanation of the internals, and I am glad to hear you have some line of site to making the experience better.

 

@Brice

 Whats up with the Tab Expansion being  Up for Grabs?  Are you looking for someone to pull request some or all of that in? I dont totally know what your operating model for OSS is and what if any help you are looking for. Honestly, I just expected that getting early feedback was the goal of OSS rather then outside contributions.. which I am totally cool with, if that is the model. But, if you are looking for contributions.. ease of use in the tooling is an area I would be willing to invest some time into.

 

Thanks,

Eric

Developer
Oct 5, 2012 at 4:46 PM

Eric,

We are absolutely looking for contributions. UpForGrabs is something we would take but don't currently have the bandwidth to do ourselves. Any tooling improvements would be greatly appreciated!

Thanks,

Andrew.

Oct 8, 2012 at 4:36 PM

Great.. I looked through the nuget source after getting some hints from the team and found the register-tabexpansion helpers..  I will prototype some approaches to this and see what i come up with.

Oct 21, 2012 at 1:47 PM
Hey guys, still working on getting company approval for this.. should happen just takes time in a company of 100k people.
Eric Hexter

blog | http://Hex.LosTechies.com
info | http://www.linkedin.com/in/erichexter



On Fri, Oct 5, 2012 at 11:46 AM, AndrewPeters <notifications@codeplex.com> wrote:

From: AndrewPeters

Eric,

We are absolutely looking for contributions. UpForGrabs is something we would take but don't currently have the bandwidth to do ourselves. Any tooling improvements would be greatly appreciated!

Thanks,

Andrew.

Read the full discussion online.

To add a post to this discussion, reply to this email (entityframework@discussions.codeplex.com)

To start a new discussion for this project, email entityframework@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com