21 lines
827 B
Python
21 lines
827 B
Python
"""认知对齐记录模型"""
|
|
from .base import Base
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from sqlalchemy import BigInteger, Integer, Boolean, Text, ForeignKey
|
|
from typing import Optional
|
|
|
|
|
|
class AlignmentRecord(Base):
|
|
__tablename__ = "alignment_records"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
truth_node_id: Mapped[int] = mapped_column(
|
|
BigInteger, ForeignKey("truth_nodes.id"), nullable=False
|
|
)
|
|
user_id: Mapped[int] = mapped_column(
|
|
BigInteger, ForeignKey("users.id"), nullable=False
|
|
)
|
|
alignment_score: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
|
|
is_confirmed: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
|
comments: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
|