Skip to content

Commit

Permalink
add task commands for ef migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Jul 5, 2023
1 parent 234dda7 commit ac64855
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,16 @@ tasks:

migrate-db:
dir: ./backend/LexBoxApi
cmd: dotnet run migrate --environment "Development"
cmds:
- dotnet run migrate --environment "Development"

# usage: task add-migration -- "migration name"
add-migration:
dir: ./backend/LexBoxApi
cmds:
- dotnet ef migrations add --project ../LexData/LexData.csproj --startup-project LexBoxApi.csproj --context LexData.LexBoxDbContext --output-dir Migrations {{.CLI_ARGS}}
# this will remove the last migration, don't remove migrations that have been pushed to production, but you can remove ones you created locally.
remove-last-migration:
dir: ./backend/LexBoxApi
cmds:
- dotnet ef migrations remove --project ../LexData/LexData.csproj --startup-project LexBoxApi.csproj --context LexData.LexBoxDbContext

0 comments on commit ac64855

Please sign in to comment.