19 lines
616 B
Python
19 lines
616 B
Python
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.infrastructure.database.models import Base
|
|
|
|
|
|
class AnswerOption(Base):
|
|
__tablename__ = 'answer_options'
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
answer = Column(String, nullable=False)
|
|
is_current = Column(Boolean, nullable=False, default=False)
|
|
|
|
task_id = Column(Integer, ForeignKey('step_tasks.id'), nullable=False)
|
|
|
|
task = relationship('StepTask', back_populates='answer_options')
|
|
|
|
test_answers = relationship('TestAnswer', back_populates='answer')
|