Fix: harden local dev startup flow
This commit is contained in:
@@ -1,30 +1,39 @@
|
||||
project_root := justfile_directory()
|
||||
backend_dir := project_root + "/Backend"
|
||||
common_sh := project_root + "/Commands/Local/scripts/common.sh"
|
||||
posix_root := project_root + "/POSIX"
|
||||
|
||||
# Apply embedded database migrations.
|
||||
migrate-up:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"'
|
||||
cd '{{backend_dir}}' && go run ./cmd/migrate up
|
||||
|
||||
# Roll back the most recent embedded database migration.
|
||||
# Roll back the most recent embedded database migration (confirmation required).
|
||||
migrate-down:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"; confirm_destructive_action "This will roll back the most recent embedded database migration. Continue?"'
|
||||
cd '{{backend_dir}}' && go run ./cmd/migrate down
|
||||
|
||||
# Reset all embedded database migrations.
|
||||
# Reset all embedded database migrations (confirmation required).
|
||||
migrate-reset:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"; confirm_destructive_action "This will reset all embedded database migrations. Continue?"'
|
||||
cd '{{backend_dir}}' && go run ./cmd/migrate reset
|
||||
|
||||
# Reset embedded database migrations and apply them again from scratch.
|
||||
# Reset embedded database migrations and apply them again from scratch (confirmation required).
|
||||
migrate-rebuild:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"; confirm_destructive_action "This will reset all embedded database migrations and reapply them from scratch. Continue?"'
|
||||
cd '{{backend_dir}}' && go run ./cmd/migrate reset && go run ./cmd/migrate up
|
||||
|
||||
# Show the embedded database migration status.
|
||||
migrate-status:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"'
|
||||
cd '{{backend_dir}}' && go run ./cmd/migrate status
|
||||
|
||||
# Rebuild the POSIX-to-DB projection from the current POSIX root.
|
||||
posix-rebuild:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"'
|
||||
cd '{{backend_dir}}' && go run ./cmd/posix rebuild
|
||||
|
||||
# Format backend Go source files.
|
||||
fmt:
|
||||
bash -c 'source "{{common_sh}}"; ensure_posix_root "{{project_root}}" "{{posix_root}}"'
|
||||
cd '{{backend_dir}}' && gofmt -w ./cmd ./db ./internal
|
||||
|
||||
Reference in New Issue
Block a user