Clean up Alembic migrations

- Removed outdated and redundant Alembic migration files to streamline the migration directory. This improves maintainability and eliminates duplicate or unused scripts.
This commit is contained in:
Felipe Cardoso
2025-11-27 09:12:30 +01:00
parent 4a06b96b2e
commit 2bbe925cef
26 changed files with 883 additions and 971 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: help lint lint-fix format format-check type-check test test-cov validate clean install-dev sync check-docker install-e2e test-e2e test-e2e-schema test-all
.PHONY: help lint lint-fix format format-check type-check test test-cov validate clean install-dev sync check-docker install-e2e test-e2e test-e2e-schema test-all drop-db reset-db
# Default target
help:
@@ -25,6 +25,10 @@ help:
@echo " make test-all - Run all tests (unit + E2E)"
@echo " make check-docker - Check if Docker is available"
@echo ""
@echo "Database:"
@echo " make drop-db - Drop local database entirely (requires Docker)"
@echo " make reset-db - Drop and recreate database with migrations"
@echo ""
@echo "Cleanup:"
@echo " make clean - Remove cache and build artifacts"
@@ -119,6 +123,22 @@ test-all:
@$(MAKE) test
@$(MAKE) test-e2e
# ============================================================================
# Database Management
# ============================================================================
drop-db: check-docker
@echo "🗑️ Dropping local database..."
@cd .. && docker compose -f docker-compose.dev.yml exec -T db psql -U postgres -c "DROP DATABASE IF EXISTS app WITH (FORCE);" 2>/dev/null || \
cd .. && docker compose -f docker-compose.dev.yml exec -T db psql -U postgres -c "DROP DATABASE IF EXISTS app;"
@cd .. && docker compose -f docker-compose.dev.yml exec -T db psql -U postgres -c "CREATE DATABASE app;"
@echo "✅ Database dropped and recreated (empty)"
reset-db: drop-db
@echo "🔄 Applying migrations..."
@uv run python migrate.py --local apply
@echo "✅ Database reset complete!"
# ============================================================================
# Cleanup
# ============================================================================