Skip to content

Commit dd89589

Browse files
committed
added new class CodeTailorParsons
1 parent 1d7838b commit dd89589

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

components/rsptx/db/models.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,27 @@ class Question(Base, IdMixin):
613613
QuestionValidator: TypeAlias = sqlalchemy_to_pydantic(Question) # type: ignore
614614

615615

616+
class CodeTailorParsons(Base, IdMixin):
617+
__tablename__ = "codetailor_parsons"
618+
__table_args__ = (
619+
UniqueConstraint("question_id", "sid", "timestamp"),
620+
Index("codetailor_parsons_qid_sid_idx", "question_id", "sid"),
621+
)
622+
# Original Question this was generated from
623+
question_id = Column(
624+
Integer,
625+
ForeignKey("questions.id"),
626+
nullable=False,
627+
index=True,
628+
)
629+
sid = Column(String(512), nullable=False, index=True)
630+
timestamp = Column(DateTime, nullable=False)
631+
htmlsrc = Column(Text)
632+
question_json = Column(JSON, nullable=False)
633+
634+
CodeTailorParsonsValidator: TypeAlias = sqlalchemy_to_pydantic(CodeTailorParsons) # type: ignore
635+
636+
616637
class Tag(Base, IdMixin):
617638
__tablename__ = "tags"
618639

0 commit comments

Comments
 (0)