33 lines
1011 B
Python
33 lines
1011 B
Python
"""lesson_no_rule — "no rule fits" is a recorded answer
|
|
|
|
Revision ID: 0112
|
|
Revises: 0111
|
|
Create Date: 2026-10-01
|
|
|
|
One row per lesson that was judged to fall under no rule, with the reason. A
|
|
lesson with neither a confirmed link nor this row is UNJUDGED, which is what
|
|
`list_lessons(unjudged=true)` lists. CASCADE from the lesson. No backfill: no
|
|
lesson has been judged yet, and writing "no rule fits" for one nobody looked
|
|
at would assert a judgment nobody made.
|
|
"""
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision = "0112"
|
|
down_revision = "0111"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"lesson_no_rule",
|
|
sa.Column("lesson_id", sa.Integer(), sa.ForeignKey("notes.id", ondelete="CASCADE"), primary_key=True),
|
|
sa.Column("why", sa.Text(), nullable=False),
|
|
sa.Column("judged_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.text("now()")),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("lesson_no_rule")
|