Developer Documentation
Migrations
Evolve Kaya's SQLite schema with its current manual additive process.
Migrations
Kaya does not use Alembic. Models live in app/models/models.py; table creation and manual SQLite evolution are split between application bootstrap and scripts/migrate_sqlite.py. The container entrypoint normally runs the script first and copies an existing database to kaya.db.pre-migration.
Keep both migration paths idempotent and in sync. Prefer additive tables/columns/indexes, preserve data and defaults, and account for existing rows before adding constraints. Test an empty database, the latest schema and representative older copies.
