Question

I've been using Code-First Migrations Beta up until now and when migrating my database through the Package Manager Console I was able to specify the -TargetDatabase, to indicate what database I wanted the migration to apply to, like so:

Update-Database -TargetDatabase:"MyLiveDatabase"

Since migrations now is included in Entity Framework 4.3, I updated my application to use EF 4.3, but now I cannot set the -TargetDatabase flag anymore. When run in the Package Manager Console I get the following error:

A parameter cannot be found that matches parameter name 'TargetDatabase'

I read through the blog post about migrations in EF 4.3 but cannot find any info about it. I also noticed a comment on an old SO question saying that the flag should be -Target instead of -TargetDatabase, but that doesn't seem to work either. The -Target flag rather seems to be used to specify which migration I want to migrate to.

Has the -TargetDatabase flag been renamed, or how do I specify which database I want to apply the migration to?

Was it helpful?

Solution

You can use the ConnectionStringName flag, you can see the documentation in the package manager console with

get-help update-database
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top