pub async fn sync_and_migrate(db: &DbPool) -> Result<(), Error>Expand description
Synchronize database schema from all registered entities, then run all pending migrations.
- Bootstrap
_modo_migrationstable (must exist before schema sync) - Collect all
EntityRegistrationentries frominventory - Register framework entities first, then user entities
- Run
SchemaBuilder::sync()(addition-only, topo-sorted by SeaORM) - Execute extra SQL (composite indices, partial unique indices)
- Run pending migrations (version-ordered, tracked in
_modo_migrations)