Mark dead databases as "dead" and don't dump, probe, or list them
Summary: When we delete a database, we still need to create it in the patch sequence so that installs can upgrade correctly. However, we shouldn't try to dump, probe, or list it. Mark deleted databases (of which there is only one) as "dead" and don't dump them. A specific problem this fixes is `bin/storage dump` failing when trying to dump `phabricator_timeline`, which no longer exists. Test Plan: Ran `bin/storage dump`, `list`, `probe`. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6496
This commit is contained in:
@@ -58,13 +58,16 @@ final class PhabricatorStorageManagementAPI {
|
||||
return $this->namespace.'_'.$fragment;
|
||||
}
|
||||
|
||||
public function getDatabaseList(array $patches) {
|
||||
public function getDatabaseList(array $patches, $only_living = false) {
|
||||
assert_instances_of($patches, 'PhabricatorStoragePatch');
|
||||
|
||||
$list = array();
|
||||
|
||||
foreach ($patches as $patch) {
|
||||
if ($patch->getType() == 'db') {
|
||||
if ($only_living && $patch->isDead()) {
|
||||
continue;
|
||||
}
|
||||
$list[] = $this->getDatabaseName($patch->getName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user