Enable migrations for your context.
PM> Enable-Migrations
Creates scaffold for the next migration based on changes you have made to your model since the last migration was created.
PM> Add-Migration MigrationName
Applies all pending migrations to the database.
PM> Update-Database
Applies all pending migration to the database and logs executed sql scripts to console.
PM> Update-Database –Verbose
Applies the specific migration to the database. This can also be used to downgrade to the specific migration.
PM> Update-Database –TargetMigration: MigrationName
Rollback all migrations
PM> Update-Database –TargetMigration:0
Generates a sql script file of all migrations.
PM> Update-Database -Script -SourceMigration: $InitialDatabase -TargetMigration: LastMigrationName
If you don’t specify a target migration, Migrations will use the latest migration as the target. If you don't specify a source migrations, Migrations will use the current state of the database.