c# - Delete a code-first migration before update-database was run -


this frustratingly simple seeming question has been difficult find answer on google , so. have asp.net mvc project using entity framework code-first approach. went add migration when ran add-migration migrationname command, misspelled migrationname.

i have not yet run update-database. renaming migration class name automatically created enough? or have delete migration first , add new 1 correct name? if so, how do that? delete automatically created migration class or there more it?

while may able rename them, think may come issues regards *.resx file gets created contains zipped edmx file along naming stuff. simplest way delete root migration class (which remove migration.designer.cs , migration.resx file) , recreate it.

if have ran update-database command, can still achieve rolling back:

update-database -targetmigration nameofpreviousmigration 

(you may need add -force if rollback destroy data)


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -