v0.5.3-beta: Database lifecycle & Alembic migration baseline - #32
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
create_all.Description
backend/alembicincludingenv.py,script.py.makoand the initial baseline migration0001_initial_schemathat createsapi_cache,checksandreports.backend/app/core/system_status.py) to includeschema_version,migration_statusandmigration_head, determined defensively via Alembic/SQLAlchemy with safe fallbacks.backend/app/main.pyto only callBase.metadata.create_all()for SQLite (dev/demo) and rely on Alembic for production/Postgres migrations.frontend/src/types.ts,frontend/src/App.tsx,frontend/src/components/Layout.tsx) to display schema version, migration head and a migration-status badge, and bumped visible versions tov0.5.3-beta.docs/operations/upgrades.md,docs/operations/backup-restore.md,docs/operations/database-migrations.md,README.md,RELEASE_NOTES.md) describing migration commands, baseline instructions (alembic stamp 0001_initial_schema) and a safe production workflow.backend/Dockerfile).Testing
pytest backend/tests/test_api_smoke.py -qand all tests passed (15 passed).npm run buildand the production build completed successfully.docker compose -f docker-compose.prod.yml configbut the Docker CLI is not available in this environment so that check was not executed here.Codex Task