Homec4science

Use string constants, not integer constants, to represent task status internally

Authored by epriestley <git@epriestley.com> on Mar 25 2014, 21:58.

Description

Use string constants, not integer constants, to represent task status internally

Summary:
Ref T1812. I think integer constants are going to be confusing and error prone for users to interact with. For example, because we use 0-5, adding a second "open" status like "needs verification" without disrupting the existing statuses would require users to define a status with, e.g., constant 6, but order it between constants 0 and 1. And if they later remove statuses, they need to avoid reusing existing constants.

Instead, use more manageable string constants like "open", "resolved", etc.

We must migrate three tables:

  • The task table itself, to update task status.
  • The transaction table, to update historic status changes.
  • The saved query table, to update saved queries which specify status sets.

Test Plan:

  • Saved a query with complicated status filters.
  • Ran migrations.
  • Looked at the query, at existing tasks, and at task transactions.
  • Forced migrations to run again to verify idempotentcy/safety.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1812

Differential Revision: https://secure.phabricator.com/D8583

Details

Committed
epriestley <git@epriestley.com>Mar 25 2014, 21:58
Pushed
aubortJan 31 2017, 17:16
Parents
rPH47d6d0bbadd9: Drive Maniphest statuses with internal pseudo-configuration
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH0a76d82a7c4d: Use string constants, not integer constants, to represent task status internally (authored by epriestley <git@epriestley.com>).Mar 25 2014, 21:58