1.0 KiB
Database migrations
Migrations are forward-only and operate on OceanBase MySQL canonical metadata. Run
make migration-check to render the full upgrade path without changing a
database. Integration tests also apply the migration to a temporary database
and compare it with SQLAlchemy metadata.
The target OceanBase database is shared. Alembic autogenerate and drift checks
are intentionally scoped to tables present in EKP Base.metadata; unrelated
application tables and the separately provisioned vector-index table are never
reflected or treated as migration targets.
OceanBase adds BLOCK_SIZE ... LOCAL syntax that SQLAlchemy's stock MySQL
reflector does not recognize for secondary indexes, unique constraints, and
foreign keys. Real OceanBase drift checks therefore compare columns, types,
defaults, and primary keys while excluding those three falsely reported object
types. Full constraint comparison still runs against SQLite in integration
tests; target-cluster checks separately verify HNSW/PRE-FILTER and the
single-active generated unique index.