Add explicit model imports to Alembic env.py
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
## Overview
Update `alembic/env.py` to explicitly import all model modules. This is a prerequisite for the models package restructuring.
## Background
Currently, `env.py` only imports a subset of models:
```python
import ai.backend.manager.models.agent # noqa
import ai.backend.manager.models.kernel # noqa
import ai.backend.manager.models.keypair # noqa
import ai.backend.manager.models.vfolder # noqa
import ai.backend.manager.models.event_log # noqa
import ai.backend.manager.models.rbac_models # noqa
```
When `models/__init__.py` stops eagerly importing all modules, Alembic needs explicit imports to register tables with metadata.
## Tasks
- [ ] Add explicit imports for all model modules in `alembic/env.py`
- [ ] Consider using `pkgutil.iter_modules()` for automatic discovery
## Acceptance Criteria
- [ ] `alembic upgrade head` works correctly
- [ ] `alembic revision --autogenerate` detects all tables
- [ ] No regression in existing migrations
JIRA Issue: BA-3618
Contributor guide
Assessment
This issue has not been assessed yet.