Skip to content

Instantly share code, notes, and snippets.

@jcockhren
Created December 5, 2015 20:34
Show Gist options
  • Save jcockhren/243d76d925d51abcb3df to your computer and use it in GitHub Desktop.
Save jcockhren/243d76d925d51abcb3df to your computer and use it in GitHub Desktop.
Wrangling Database Migrations

In order to Re-create initial migration (In Package Manager Console)

  1. Update-Database -TargetMigration $InitialDatabase (Deletes all tables in database, but keeps Database file)
  2. If you have a file with the name "InitialCreate1" delete it. If it's not there, no worries.
  3. Add-Migration InitialCreate (re-create InitialCreate migration file with you new models changes)
  4. Update-Database (now apply the newly created migration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment