Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 987 Bytes

migration_instruction.md

File metadata and controls

44 lines (36 loc) · 987 Bytes

How to create migrations in EF Core

  1. Install dotnet with version 3.1.201. Please be advised that ClassTranscribe Database may not run properly on newer version. Install instruction can be found at https://github.com/dotnet/core/blob/main/release-notes/3.1/3.1.3/3.1.201-download.md

  2. Install dotnet-ef 3.1.4 by running

dotnet tool install --global dotnet-ef --version 3.1.4
  1. Go to the ClassTranscribeDatabase directory
cd WebAPI/ClassTranscribeDatabase
  1. Create a new migration by running
(also try dotnet ef may work for you)
dotnet-ef migrations add <name of migration>

How to apply migration in the local database

dotnet-ef database update

To remove,

dotnet-ef migrations remove

How to apply migration in Docker container

  1. Rebuild the solution
dotnet build --no-restore
  1. Rebuild API image
docker build -t api -f API.Dockerfile .
  1. Run Docker compose to see the changes
docker compose up api