What is migrations

EF core tool

Install package

Install-Package Microsoft.EntityFrameworkCore.Tools

Get-Help Add-Migration

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