"""drop notes.kind — a checklist is something a note HAS (M13 step 2) Revision ID: 0025 Revises: 0024 Create Date: 2026-08-22 `kind` was never a type: a plain TEXT column with no enum and no CHECK, compared against a hardcoded ("text", "list") tuple in six places. `note_items` was always an ordinary child table keyed by note_id, serialization always emitted `items` whatever the kind, and the Android editor already toggled between the two losslessly. The storage has modelled "a body plus optional checkable items" the whole time; only the gates forbade it. Nothing is lost. Items were already rows in their own table, and a note that was `kind = 'list'` keeps every one of them — it just stops being a different sort of thing from the note next to it. """ from alembic import op import sqlalchemy as sa revision = "0025" down_revision = "0024" branch_labels = None depends_on = None def upgrade() -> None: op.drop_column("notes", "kind") def downgrade() -> None: # server_default so existing rows get a value; every note comes back as 'text', # which is right — a restored note with items would previously have hidden its # body, and there is no record of which ones were once lists. op.add_column("notes", sa.Column("kind", sa.Text(), nullable=False, server_default="text"))