From ac462d1203740ced67cb13e4696acf8ef217f580 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 28 May 2026 08:15:13 -0400 Subject: [PATCH] =?UTF-8?q?feat(plan):=20migration=200056=20=E2=80=94=20ta?= =?UTF-8?q?sk=5Fkind=20column=20on=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alembic/versions/0056_task_kind.py | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 alembic/versions/0056_task_kind.py diff --git a/alembic/versions/0056_task_kind.py b/alembic/versions/0056_task_kind.py new file mode 100644 index 0000000..fa07d18 --- /dev/null +++ b/alembic/versions/0056_task_kind.py @@ -0,0 +1,35 @@ +"""task_kind column on notes: distinguishes plan-tasks from work-tasks + +Revision ID: 0056 +Revises: 0055 +Create Date: 2026-05-28 + +A plan is a Task (a note with non-null status) marked task_kind='plan'. +The CHECK constraint lands in the same migration as the value set, per the +'new CHECK-enum values need a same-change migration' rule. +""" +from alembic import op +import sqlalchemy as sa + + +revision = "0056" +down_revision = "0055" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.add_column( + "notes", + sa.Column( + "task_kind", sa.Text(), nullable=False, server_default="work", + ), + ) + op.create_check_constraint( + "notes_task_kind_check", "notes", "task_kind IN ('work','plan')", + ) + + +def downgrade() -> None: + op.drop_constraint("notes_task_kind_check", "notes", type_="check") + op.drop_column("notes", "task_kind")