feat: Implement Alembic for database migrations, including configuration, baseline schema, and Docker integration.#168
Merged
Conversation
…ion, baseline schema, and Docker integration.
…edicated migration script on startup.
…hecks, and integration tests.
…e scripts, and comprehensive documentation for releases and environment health.
mekarpeles
reviewed
Mar 23, 2026
| @@ -0,0 +1,23 @@ | |||
| # Dev/Prod Mode via LENNY_PRODUCTION | |||
Member
There was a problem hiding this comment.
we probably don't need these plans checked in
Collaborator
Author
There was a problem hiding this comment.
Well, I was reusing the existing environment with different names to make things much clearer.
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.
Closes #167
This pull request introduces a comprehensive database migration system using Alembic, improves operational safety and developer experience with new Makefile commands, and updates the documentation and Docker setup to support these changes. The most significant updates are the addition of Alembic-based migrations (with an initial baseline), new Makefile targets for safe updates and migration management, and enhancements to developer tooling and documentation.
Database migrations and schema management:
alembic.ini,alembic/env.py), a migration script template (alembic/script.py.mako), and the initial baseline migration (alembic/versions/001_baseline_schema.py) foritemsandloanstables. This enables versioned, automated schema changes and safe upgrades. [1] [2] [3] [4]Developer and operational tooling:
Makefilewith new commands for safe updates (make update), database migrations (make migrate,make migrate-status,make migration,make migrate-rollback,make migrate-stamp,make squash-migrations), and a health check utility (make doctor). Added warnings to destructive commands and introducedmake redeployfor safe code updates without data loss. [1] [2] [3]doctor.shscript for comprehensive environment diagnostics, checking Docker, configuration, database, and disk space.Documentation improvements:
README.mdwith sections on updating, database migrations, health checks, and clarified rebuild/update workflows. Added documentation for Alembic and new Makefile commands. [1] [2] [3] [4] [5]Configuration and environment:
VERSIONfile to track the current release version, which is now copied into the Docker image. [1] [2]LENNY_RELOADtoLENNY_PRODUCTIONfor clearer dev/production mode switching, and updated related scripts. [1] [2]Reliability and health:
compose.yamlto ensure the service is ready before dependent services start.These changes lay the foundation for safe, automated upgrades, robust schema management, and improved developer experience.