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
37 changes: 37 additions & 0 deletions alembic/versions/0febf8c21610_dropped_column_coding_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""dropped column coding_mode

Revision ID: 0febf8c21610
Revises: 4baf7c606f77
Create Date: 2026-02-05 10:00:48.157541

"""
from typing import Sequence, Union

from alembic import op

import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '0febf8c21610'
down_revision: Union[str, Sequence[str], None] = '4baf7c606f77'
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.drop_column('exercise', 'coding_mode')
op.add_column('exercise_progress', sa.Column('failed_submissions', sa.INTEGER(), nullable=False))
op.add_column('exercise_progress', sa.Column('next_grading_allowed_at', sa.DateTime(timezone=True), nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('exercise_progress', 'next_grading_allowed_at')
op.drop_column('exercise_progress', 'failed_submissions')
op.add_column('exercise', sa.Column('coding_mode', sa.VARCHAR(length=3), autoincrement=False, nullable=False))
# ### end Alembic commands ###

This file was deleted.

1 change: 0 additions & 1 deletion app/api/schema/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
class ExerciseCreate(BaseModel):
title: str
markdown: str
coding_mode: str
skip_delay: int
next_exercise_id: Optional[int]

Expand Down
2 changes: 0 additions & 2 deletions app/db/model/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Exercise(Base):
id = sa.Column(sa.INTEGER, default=None, primary_key=True)
title = sa.Column(sa.TEXT, nullable=False)
markdown = sa.Column(sa.TEXT, nullable=False)
coding_mode = sa.Column(sa.VARCHAR(3), nullable=False)
next_exercise_id = sa.Column(sa.Integer, sa.ForeignKey("exercise.id"), nullable=True)
skip_delay = sa.Column(sa.Integer, nullable=False)

Expand All @@ -18,7 +17,6 @@ def to_dict(self):
"id": self.id,
"title": self.title,
"markdown": self.markdown,
"coding_mode": self.coding_mode,
"next_exercise_id": self.next_exercise_id,
"skip_delay": self.skip_delay,
}
Expand Down
Loading