From aa74af19834ba96ccaa7bcd54a5f7fa14bcc97bc Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 7 Feb 2018 03:29:33 -0800 Subject: [PATCH] Remove all "originalTitle"/"originalName" fields from objects Summary: Depends on D19012. Ref T13053. In D19012, I've changed "Thread-Topic" to always use PHIDs. This change drops the selective on-object storage we have to track the original, human-readable title for objects. Even if we end up backing out the "Thread-Topic" change, we'd be better off storing this in a table in the Mail app which just has ``, since then we get the right behavior without needing every object to have this separate field. Test Plan: Grepped for `original`, `originalName`, `originalTitle`, etc. Reviewers: amckinley Maniphest Tasks: T13053 Differential Revision: https://secure.phabricator.com/D19013 --- resources/sql/autopatches/20180207.mail.01.task.sql | 2 ++ .../sql/autopatches/20180207.mail.02.revision.sql | 2 ++ resources/sql/autopatches/20180207.mail.03.mock.sql | 2 ++ .../differential/storage/DifferentialRevision.php | 10 ---------- .../maniphest/editor/ManiphestTransactionEditor.php | 1 - src/applications/maniphest/storage/ManiphestTask.php | 10 ---------- src/applications/pholio/storage/PholioMock.php | 2 -- .../pholio/xaction/PholioMockNameTransaction.php | 3 --- src/applications/ponder/storage/PonderQuestion.php | 5 ----- 9 files changed, 6 insertions(+), 31 deletions(-) create mode 100644 resources/sql/autopatches/20180207.mail.01.task.sql create mode 100644 resources/sql/autopatches/20180207.mail.02.revision.sql create mode 100644 resources/sql/autopatches/20180207.mail.03.mock.sql diff --git a/resources/sql/autopatches/20180207.mail.01.task.sql b/resources/sql/autopatches/20180207.mail.01.task.sql new file mode 100644 index 0000000000..f04b90c809 --- /dev/null +++ b/resources/sql/autopatches/20180207.mail.01.task.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task + DROP originalTitle; diff --git a/resources/sql/autopatches/20180207.mail.02.revision.sql b/resources/sql/autopatches/20180207.mail.02.revision.sql new file mode 100644 index 0000000000..881efbcc94 --- /dev/null +++ b/resources/sql/autopatches/20180207.mail.02.revision.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_differential.differential_revision + DROP originalTitle; diff --git a/resources/sql/autopatches/20180207.mail.03.mock.sql b/resources/sql/autopatches/20180207.mail.03.mock.sql new file mode 100644 index 0000000000..360d7cf9a7 --- /dev/null +++ b/resources/sql/autopatches/20180207.mail.03.mock.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_pholio.pholio_mock + DROP originalName; diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 2c82de164a..938c588857 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -20,7 +20,6 @@ final class DifferentialRevision extends DifferentialDAO PhabricatorDraftInterface { protected $title = ''; - protected $originalTitle; protected $status; protected $summary = ''; @@ -98,7 +97,6 @@ final class DifferentialRevision extends DifferentialDAO ), self::CONFIG_COLUMN_SCHEMA => array( 'title' => 'text255', - 'originalTitle' => 'text255', 'status' => 'text32', 'summary' => 'text', 'testPlan' => 'text', @@ -155,14 +153,6 @@ final class DifferentialRevision extends DifferentialDAO return '/'.$this->getMonogram(); } - public function setTitle($title) { - $this->title = $title; - if (!$this->getID()) { - $this->originalTitle = $title; - } - return $this; - } - public function loadIDsByCommitPHIDs($phids) { if (!$phids) { return array(); diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php index 9c8e3869dc..66247ca6d0 100644 --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -522,7 +522,6 @@ final class ManiphestTransactionEditor 'status' => '""', 'priority' => 0, 'title' => '""', - 'originalTitle' => '""', 'description' => '""', 'dateCreated' => 0, 'dateModified' => 0, diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php index f72977c5b2..e19886d3ff 100644 --- a/src/applications/maniphest/storage/ManiphestTask.php +++ b/src/applications/maniphest/storage/ManiphestTask.php @@ -31,7 +31,6 @@ final class ManiphestTask extends ManiphestDAO protected $subpriority = 0; protected $title = ''; - protected $originalTitle = ''; protected $description = ''; protected $originalEmailSource; protected $mailKey; @@ -83,7 +82,6 @@ final class ManiphestTask extends ManiphestDAO 'status' => 'text64', 'priority' => 'uint32', 'title' => 'sort', - 'originalTitle' => 'text', 'description' => 'text', 'mailKey' => 'bytes20', 'ownerOrdering' => 'text64?', @@ -176,14 +174,6 @@ final class ManiphestTask extends ManiphestDAO return $this; } - public function setTitle($title) { - $this->title = $title; - if (!$this->getID()) { - $this->originalTitle = $title; - } - return $this; - } - public function getMonogram() { return 'T'.$this->getID(); } diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php index 4aa9ef4055..523733b3df 100644 --- a/src/applications/pholio/storage/PholioMock.php +++ b/src/applications/pholio/storage/PholioMock.php @@ -25,7 +25,6 @@ final class PholioMock extends PholioDAO protected $editPolicy; protected $name; - protected $originalName; protected $description; protected $coverPHID; protected $mailKey; @@ -65,7 +64,6 @@ final class PholioMock extends PholioDAO self::CONFIG_COLUMN_SCHEMA => array( 'name' => 'text128', 'description' => 'text', - 'originalName' => 'text128', 'mailKey' => 'bytes20', 'status' => 'text12', ), diff --git a/src/applications/pholio/xaction/PholioMockNameTransaction.php b/src/applications/pholio/xaction/PholioMockNameTransaction.php index d1231636af..82fb92fe40 100644 --- a/src/applications/pholio/xaction/PholioMockNameTransaction.php +++ b/src/applications/pholio/xaction/PholioMockNameTransaction.php @@ -15,9 +15,6 @@ final class PholioMockNameTransaction public function applyInternalEffects($object, $value) { $object->setName($value); - if ($object->getOriginalName() === null) { - $object->setOriginalName($this->getNewValue()); - } } public function getTitle() { diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php index eefcdba9be..17f7ee3fdc 100644 --- a/src/applications/ponder/storage/PonderQuestion.php +++ b/src/applications/ponder/storage/PonderQuestion.php @@ -194,11 +194,6 @@ final class PonderQuestion extends PonderDAO return parent::save(); } - public function getOriginalTitle() { - // TODO: Make this actually save/return the original title. - return $this->getTitle(); - } - public function getFullTitle() { $id = $this->getID(); $title = $this->getTitle();