Files
shaguabijia-app-server/app/db/base.py
T
马润林 1aafc28621 feat: 正式 App 后端登录模块 v0.1.0
引入 JWT 认证、极光一键登录、短信 mock 登录与用户表,并补充技术实施文档与部署配置。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 17:37:18 +08:00

18 lines
546 B
Python

"""SQLAlchemy 2.0 Declarative Base。
所有 ORM model 继承 `Base`。Alembic 通过 `Base.metadata` 拿到完整表结构生成 migration。
"""
from __future__ import annotations
from sqlalchemy.orm import DeclarativeBase, MappedAsDataclass
class Base(DeclarativeBase):
"""所有 model 的公共基类。"""
# 在 Alembic env.py 里 import Base 才能扫描到所有 model,
# 这里也 import 一次确保 metadata 包含全部表。
# (新增 model 时记得加到 app.models.__init__ 里)
from app import models # noqa: E402,F401