ceeccabc98
Move the users table into the shared persistence engine so auth matches the pattern of threads_meta, runs, run_events, and feedback — one engine, one session factory, one schema init codepath. New files --------- - persistence/user/__init__.py, persistence/user/model.py: UserRow ORM class with partial unique index on (oauth_provider, oauth_id) - Registered in persistence/models/__init__.py so Base.metadata.create_all() picks it up Modified -------- - auth/repositories/sqlite.py: rewritten as async SQLAlchemy, identical constructor pattern to the other four repositories (def __init__(self, session_factory) + self._sf = session_factory) - auth/config.py: drop users_db_path field — storage is configured through config.database like every other table - deps.py/get_local_provider: construct SQLiteUserRepository with the shared session factory, fail fast if engine is not initialised - tests/test_auth.py: rewrite test_sqlite_round_trip_new_fields to use the shared engine (init_engine + close_engine in a tempdir) - tests/test_auth_type_system.py: add per-test autouse fixture that spins up a scratch engine and resets deps._cached_* singletons
24 lines
941 B
Python
24 lines
941 B
Python
"""ORM model registration entry point.
|
|
|
|
Importing this module ensures all ORM models are registered with
|
|
``Base.metadata`` so Alembic autogenerate detects every table.
|
|
|
|
The actual ORM classes have moved to entity-specific subpackages:
|
|
- ``deerflow.persistence.thread_meta``
|
|
- ``deerflow.persistence.run``
|
|
- ``deerflow.persistence.feedback``
|
|
- ``deerflow.persistence.user``
|
|
|
|
``RunEventRow`` remains in ``deerflow.persistence.models.run_event`` because
|
|
its storage implementation lives in ``deerflow.runtime.events.store.db`` and
|
|
there is no matching entity directory.
|
|
"""
|
|
|
|
from deerflow.persistence.feedback.model import FeedbackRow
|
|
from deerflow.persistence.models.run_event import RunEventRow
|
|
from deerflow.persistence.run.model import RunRow
|
|
from deerflow.persistence.thread_meta.model import ThreadMetaRow
|
|
from deerflow.persistence.user.model import UserRow
|
|
|
|
__all__ = ["FeedbackRow", "RunEventRow", "RunRow", "ThreadMetaRow", "UserRow"]
|