Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""add step_limit column to test_case

Revision ID: 2a1b6cce2dae
Revises: fa88dd438b04
Create Date: 2026-02-07 15:51:44.881825

"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = '2a1b6cce2dae'
down_revision: Union[str, Sequence[str], None] = 'fa88dd438b04'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('test_case', sa.Column('step_limit', sa.Integer(), nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('test_case', 'step_limit')
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""added expected_instructions column to test_case table

Revision ID: fa88dd438b04
Revises: 0febf8c21610
Create Date: 2026-02-05 10:28:52.171857

"""
from typing import Sequence, Union

from alembic import op

import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = 'fa88dd438b04'
down_revision: Union[str, Sequence[str], None] = '0febf8c21610'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('test_case', sa.Column('expected_instructions', sa.JSON(), nullable=False))
# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('test_case', 'expected_instructions')
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions app/api/schema/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TestCaseCreate(BaseModel):
user_input: list[str]
expected_output: list[str]
expected_instructions: list[str]
step_limit: Optional[int] = None


class TestCaseRead(TestCaseCreate):
Expand Down
2 changes: 2 additions & 0 deletions app/db/model/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TestCase(Base):
user_input = sa.Column(sa.JSON, nullable=False)
expected_output = sa.Column(sa.JSON, nullable=False)
expected_instructions = sa.Column(sa.JSON, nullable=False)
step_limit = sa.Column(sa.Integer, nullable=True)

def to_dict(self):
return {
Expand All @@ -44,6 +45,7 @@ def to_dict(self):
"user_input": self.user_input,
"expected_output": self.expected_output,
"expected_instructions": self.expected_instructions,
"step_limit": self.step_limit,
}


Expand Down