feat: add user preferences migration and context

This commit is contained in:
2026-02-03 16:09:50 +08:00
parent abe0dc131b
commit 555bf38b71
21 changed files with 931 additions and 79 deletions

View File

@@ -21,6 +21,7 @@ class User(Base):
is_active = Column(Boolean, default=True, nullable=False)
is_superuser = Column(Boolean, default=False, nullable=False)
aliyun_api_key = Column(Text, nullable=True)
user_preferences = Column(JSON, nullable=True, default=lambda: {"default_backend": "local", "onboarding_completed": False})
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)