Files
OpenHands/openhands/app_server/app_lifespan/alembic
chuckbutkus d5e66b4f3a SAAS: Introducing orgs (phase 1) (#11265)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: rohitvinodmalhotra@gmail.com <rohitvinodmalhotra@gmail.com>
Co-authored-by: Hiep Le <69354317+hieptl@users.noreply.github.com>
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2026-01-15 22:03:31 -05:00
..
2025-10-14 02:16:44 +00:00
2025-10-14 02:16:44 +00:00
2025-10-14 02:16:44 +00:00

# 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'
```