22 lines
776 B
Python
22 lines
776 B
Python
from sqlalchemy import Column, Integer, String, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.infrastructure.database.models import Base
|
|
|
|
|
|
class StepTask(Base):
|
|
__tablename__ = 'step_tasks'
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
text = Column(String, nullable=False)
|
|
|
|
step_id = Column(Integer, ForeignKey('steps.id'), nullable=False)
|
|
type_id = Column(Integer, ForeignKey('task_types.id'), nullable=False)
|
|
|
|
step = relationship('Step', back_populates='tasks')
|
|
type = relationship('TaskType', back_populates='tasks')
|
|
|
|
files = relationship('TaskFile', back_populates='task')
|
|
answer_options = relationship('AnswerOption', back_populates='task')
|
|
answers = relationship('TaskAnswer', back_populates='task')
|