Author : MD TAREQ HASSAN
What is migrations
- Version control of database
- Upgrading a database for any change of Entities
EF core tool
Install package
Install-Package Microsoft.EntityFrameworkCore.Tools
Get-Help Add-Migration
Migration related commands
Set data project as startup project before adding migration
initial migration
Add-Migration init
Migration after changing entity
Update-Database
Idempotent flag: default is apply all migration. idempotent flag ensures that same migration does apply twice
Script-Migration -Idempotent