Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"onCreateCommand": "dotnet tool install --global dotnet-ef --version 9.0.7",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../KarateDockerfile"
},
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "9.0.303"
}
},
"runArgs": [
"--network=host"
],
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

## Migrations

### Adding a new migration (Windows via Visual Studio)
### Adding a new migration

Run the database using doocker compose executing the following script
Run the database using docker compose executing the following script
```bash
docker compose --profile db-only up -d
```

#### Visual Studio
After making changes to the model and AppDbContext open Tools -> NuGet Package Manager -> Package Manager Console

Execute the following with your migration name
Expand All @@ -20,3 +21,17 @@ To apply migration run the following:
```bash
Update-Database -Project Application
```

#### VS Code

Open project in the devcontainer and open Terminal -> New Terminal

Execute the following with your migration name
```bash
dotnet ef migrations add <YOUR_MIGRATION_NAME> --startup-project Api/ --project Application/ -- --environment MockForDevelopment
```

To apply migration run the following:
```bash
dotnet ef database update --startup-project Api/ --project Application/ -- --environment MockForDevelopment
```