#IT:EF/CodeFirst/Migrations:HowTo:Strategies# * [[../|(UP)]] {{indexmenu>.#2|nsort tsort}} Understanding the changes to workflow that arise due to using CodeFirst Migrations can be a challenge at first. ## Process ## * Invoke [[IT/AD/Code First/Migrations/HowTo/Enable-Migrations|Enable-Migrations]] with `-AutoMigrations` turned on, in order to start the migration with no *InitialMigration* in the Migrations Folder. * If: * you'll be applying migrations to a database structure that will be created by other means (ie by an imported initial script): invoke [[IT/AD/Code First/Migrations/HowTo/Add-Migration|Add-Migration]] with `-IgnoreChanges` in order to create a blank *InitialMigration*. * If you don't, when running Migrations, the *InitialMigration* will try to create already existing tables, and cause an exception. * if your script will be creating the database, then just call [[IT/AD/Code First/Migrations/HowTo/Add-Migration|Add-Migration]] to create an *InitialChanges* that creates the tables. * Once the *InitialChanges* migration is created, [[IT/AD/Code First/Migrations/HowTo/Enable or Disable Automatic Migrations|Disable Automatic Migrations]] so that you have to always create [[IT/AD/Code First/Migrations/HowTo/Get an Overview#Coded Migrations]]. * Whether you were using a DbContext initialiser that was dropping/recreating the database or not, switch to a Migrations based initialiser. * If the db changes, it will ensure that a coded migration is created, then applied (no need to manually call [[IT/AD/Code First/Migrations/HowTo/Update-Database|Update-Database]].