15 行
518 B
Python
15 行
518 B
Python
from __future__ import annotations
|
|
from sqlalchemy import Column, Integer, JSON, DateTime
|
|
from sqlalchemy.sql import func
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class SelectorConfig(Base):
|
|
__tablename__ = "selector_config"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
questions = Column(JSON) # list of {id, text, options: [{value, label}]}
|
|
rules = Column(JSON) # list of {conditions, recommendation}
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|