Last post Sep 29, 2014 02:36 AM by Kevin Shen - MSFT
Sep 27, 2014 07:43 AM|softech.employee|LINK
i am developing an application in mvc5 and code first approach.
Firstly , i had one class in my data context file and everything worked. enable-migrations, add-migration and update-database were working fine but second time, i added more classes and tried to execute these statements. it gave me an exception.
enable-migrations -ContextTypeName IdentityDb -MigrationsDirectory DAL\IdentityMigrations
enable-migrations -ContextTypeName SMSContext -MigrationsDirectory DAL\SMSMigrations
add-migration -ConfigurationTypeName SMSApp.DAL.IdentityMigrations.Configuration "InitialCreate"
A previous migration called 'InitialCreate' was already applied to the target database. If you meant to re-scaffold 'InitialCreate', revert it by running 'Update-Database -TargetMigration $InitialDatabase', then delete '201409261933262_InitialCreate1.cs' and run 'Add-Migration InitialCreate' again.
Sep 27, 2014 08:09 AM|SheldonS|LINK
Take a look at this about Code First Migrations.
Sep 27, 2014 08:38 AM|softech.employee|LINK
Thanks Sheldon i already doing this. could you please read my other post at here?
It has the complete problem.
Sep 29, 2014 02:36 AM|Kevin Shen - MSFT|LINK
If you don't mind,please share your project which can reproduce your issue and remove your personal information for us
So that I can test it in my side.