修复用户状态列映射兼容问题

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-05-01 11:39:17 +08:00
parent 8c9699cd46
commit 110fb79e60
5 changed files with 35 additions and 1 deletions
+1
View File
@@ -25,6 +25,7 @@ class Settings(BaseSettings):
db_password: str = "fquiz"
user_username_column: Literal["username", "user_name"] = "username"
user_password_column: Literal["password", "password_hash"] = "password_hash"
user_status_column: Literal["status", "state"] = "status"
file_vfs_root: str = "./data/vfs"
minio_enabled: bool = False
minio_endpoint: str = "http://minio:9000"
+6 -1
View File
@@ -39,7 +39,12 @@ class User(Base):
settings.user_password_column,
String(255),
)
status: Mapped[str] = mapped_column("state", String(32), default="ENABLED", index=True)
status: Mapped[str] = mapped_column(
settings.user_status_column,
String(32),
default="ENABLED",
index=True,
)
created_at: Mapped[datetime] = mapped_column(
"create_date",
DateTime(timezone=False),