diff --git a/resources/sql/autopatches/20150102.tasksubscriber.sql b/resources/sql/autopatches/20150102.tasksubscriber.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20150102.tasksubscriber.sql @@ -0,0 +1 @@ +DROP TABLE `{$NAMESPACE}_maniphest`.`maniphest_tasksubscriber`; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1043,7 +1043,6 @@ 'ManiphestTaskStatus' => 'applications/maniphest/constants/ManiphestTaskStatus.php', 'ManiphestTaskStatusDatasource' => 'applications/maniphest/typeahead/ManiphestTaskStatusDatasource.php', 'ManiphestTaskStatusTestCase' => 'applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php', - 'ManiphestTaskSubscriber' => 'applications/maniphest/storage/ManiphestTaskSubscriber.php', 'ManiphestTransaction' => 'applications/maniphest/storage/ManiphestTransaction.php', 'ManiphestTransactionComment' => 'applications/maniphest/storage/ManiphestTransactionComment.php', 'ManiphestTransactionEditor' => 'applications/maniphest/editor/ManiphestTransactionEditor.php', @@ -4186,7 +4185,6 @@ 'ManiphestTaskStatus' => 'ManiphestConstants', 'ManiphestTaskStatusDatasource' => 'PhabricatorTypeaheadDatasource', 'ManiphestTaskStatusTestCase' => 'PhabricatorTestCase', - 'ManiphestTaskSubscriber' => 'ManiphestDAO', 'ManiphestTransaction' => 'PhabricatorApplicationTransaction', 'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment', 'ManiphestTransactionEditor' => 'PhabricatorApplicationTransactionEditor', diff --git a/src/applications/maniphest/storage/ManiphestTaskSubscriber.php b/src/applications/maniphest/storage/ManiphestTaskSubscriber.php deleted file mode 100644 --- a/src/applications/maniphest/storage/ManiphestTaskSubscriber.php +++ /dev/null @@ -1,62 +0,0 @@ - self::IDS_MANUAL, - self::CONFIG_TIMESTAMPS => false, - self::CONFIG_COLUMN_SCHEMA => array( - 'id' => null, - ), - self::CONFIG_KEY_SCHEMA => array( - 'PRIMARY' => array( - 'columns' => array('subscriberPHID', 'taskPHID'), - 'unique' => true, - ), - 'taskPHID' => array( - 'columns' => array('taskPHID', 'subscriberPHID'), - 'unique' => true, - ), - ), - ); - } - - public static function updateTaskSubscribers(ManiphestTask $task) { - $dao = new ManiphestTaskSubscriber(); - $conn = $dao->establishConnection('w'); - - $sql = array(); - $subscribers = $task->getCCPHIDs(); - $subscribers[] = $task->getOwnerPHID(); - $subscribers = array_unique($subscribers); - - foreach ($subscribers as $subscriber_phid) { - $sql[] = qsprintf( - $conn, - '(%s, %s)', - $task->getPHID(), - $subscriber_phid); - } - - queryfx( - $conn, - 'DELETE FROM %T WHERE taskPHID = %s', - $dao->getTableName(), - $task->getPHID()); - if ($sql) { - queryfx( - $conn, - 'INSERT INTO %T (taskPHID, subscriberPHID) VALUES %Q', - $dao->getTableName(), - implode(', ', $sql)); - } - } - -}