mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-25 21:36:52 +08:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
16 lines
593 B
Plaintext
16 lines
593 B
Plaintext
# OpenHands App Server Alembic Integration
|
|
|
|
This alembic integration keeps the SQLite database up to date in single user deployments by managing schema migrations for app_server models. Migrations are applied automatically on startup.
|
|
|
|
## Configuration
|
|
|
|
Uses `DbSessionInjector` from `get_global_config()` for database connectivity and auto-detects models from the declarative base in `openhands.app_server.utils.sql_utils.Base`.
|
|
|
|
## Key Commands
|
|
|
|
Generate migration from model changes:
|
|
```bash
|
|
cd openhands/app_server/app_lifespan
|
|
alembic revision --autogenerate -m 'Sync DB with Models'
|
|
```
|