Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Issue: Better way to specify Migration configuration [598]

$
0
0
This issue arises when there are multiple contexts present within a single project and more than one of them has migrations enabled. The way that this situation is currently handled is that the user is required to specify the fully qualified name of the migration configuration which turns out to be unnecessarily verbose.

I suggest that we allow the migration to be selected simply by specifying the folder name, the same way we specify the folder name when the Enable-Migrations -MigrationsDirectory flag is specified.

Example:
for: Enable-Migrations -ContextTypeName MultiTenancyTest2.Models.BlogContext -MigrationsDirectory d0
instead of: Add-Migration m -ConfigurationTypeName MultiTenancyTest2.d0.Configuration
and: Update-Database -ConfigurationTypeName MultiTenancyTest2.d0.Configuration
use: Add-Migration m -MigrationsDirectory d0
and: Update-Database -MigrationsDirectory d0

This will not conflict because there is no way of specifying the name of the Migration configuration class name and even if the user does try and specify it and put two in the same folder it breaks other aspects of migrations. Also, the folders are always placed in the root project directory, we can simply use the same parameter for Add-Migration and Update-Database that we use for Enable-Migrations

Viewing all articles
Browse latest Browse all 10318

Trending Articles