diff --git a/resources/sql/autopatches/20180215.phriction.05.statustext.sql b/resources/sql/autopatches/20180215.phriction.05.statustext.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20180215.phriction.05.statustext.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phriction.phriction_document + CHANGE status status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT}; diff --git a/resources/sql/autopatches/20180215.phriction.06.statusvalue.sql b/resources/sql/autopatches/20180215.phriction.06.statusvalue.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20180215.phriction.06.statusvalue.sql @@ -0,0 +1,11 @@ +UPDATE {$NAMESPACE}_phriction.phriction_document + SET status = 'active' WHERE status = '0'; + +UPDATE {$NAMESPACE}_phriction.phriction_document + SET status = 'deleted' WHERE status = '1'; + +UPDATE {$NAMESPACE}_phriction.phriction_document + SET status = 'moved' WHERE status = '2'; + +UPDATE {$NAMESPACE}_phriction.phriction_document + SET status = 'stub' WHERE status = '3'; diff --git a/src/applications/phriction/constants/PhrictionDocumentStatus.php b/src/applications/phriction/constants/PhrictionDocumentStatus.php --- a/src/applications/phriction/constants/PhrictionDocumentStatus.php +++ b/src/applications/phriction/constants/PhrictionDocumentStatus.php @@ -3,10 +3,10 @@ final class PhrictionDocumentStatus extends PhabricatorObjectStatus { - const STATUS_EXISTS = 0; - const STATUS_DELETED = 1; - const STATUS_MOVED = 2; - const STATUS_STUB = 3; + const STATUS_EXISTS = 'active'; + const STATUS_DELETED = 'deleted'; + const STATUS_MOVED = 'moved'; + const STATUS_STUB = 'stub'; public static function getConduitConstant($const) { static $map = array( diff --git a/src/applications/phriction/query/PhrictionDocumentQuery.php b/src/applications/phriction/query/PhrictionDocumentQuery.php --- a/src/applications/phriction/query/PhrictionDocumentQuery.php +++ b/src/applications/phriction/query/PhrictionDocumentQuery.php @@ -196,7 +196,7 @@ if ($this->statuses !== null) { $where[] = qsprintf( $conn, - 'd.status IN (%Ld)', + 'd.status IN (%Ls)', $this->statuses); } diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -31,7 +31,7 @@ 'slug' => 'sort128', 'depth' => 'uint32', 'contentID' => 'id?', - 'status' => 'uint32', + 'status' => 'text32', 'mailKey' => 'bytes20', ), self::CONFIG_KEY_SCHEMA => array(