From d2baa88171fcc3f327b157277afb905430b5a918 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 27 Apr 2017 15:07:32 -0700 Subject: [PATCH] Allow Owners packages to have arbitrarily long names Summary: - Change column type from `sort128` to `sort`. - Remove `originalName`. This column is unused. Long ago, we used it to generate a `Thread-Topic` header for mail, but just use PHIDs now (the value just needs to be stable for a given object, users normally don't see it). Test Plan: - Created a package with a beautifully long name. Magnificent! - Grepped for `originalName` / `getOriginalName()`, found no Owners hits. - Verified that there isn't any name-length validation code to remove. {F4925637} Reviewers: chad, amckinley Reviewed By: chad Differential Revision: https://secure.phabricator.com/D17798 --- resources/sql/autopatches/20170427.owners.01.long.sql | 2 ++ .../owners/storage/PhabricatorOwnersPackage.php | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 resources/sql/autopatches/20170427.owners.01.long.sql diff --git a/resources/sql/autopatches/20170427.owners.01.long.sql b/resources/sql/autopatches/20170427.owners.01.long.sql new file mode 100644 index 0000000000..01a463f52a --- /dev/null +++ b/resources/sql/autopatches/20170427.owners.01.long.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_owners.owners_package + DROP originalName; diff --git a/src/applications/owners/storage/PhabricatorOwnersPackage.php b/src/applications/owners/storage/PhabricatorOwnersPackage.php index 1b12365e4f..2b22a7a145 100644 --- a/src/applications/owners/storage/PhabricatorOwnersPackage.php +++ b/src/applications/owners/storage/PhabricatorOwnersPackage.php @@ -12,7 +12,6 @@ final class PhabricatorOwnersPackage PhabricatorNgramsInterface { protected $name; - protected $originalName; protected $auditingEnabled; protected $autoReview; protected $description; @@ -105,8 +104,7 @@ final class PhabricatorOwnersPackage self::CONFIG_TIMESTAMPS => false, self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array( - 'name' => 'sort128', - 'originalName' => 'text255', + 'name' => 'sort', 'description' => 'text', 'primaryOwnerPHID' => 'phid?', 'auditingEnabled' => 'bool', @@ -137,9 +135,6 @@ final class PhabricatorOwnersPackage public function setName($name) { $this->name = $name; - if (!$this->getID()) { - $this->originalName = $name; - } return $this; }