Issue upgrade guidance to rebuild indexes for the Ferret engine
Summary: Ref T12819. This is shipping, so issue upgrade guidance to instruct installs to rebuild the index. Also generate a new `quickstart.sql` since we haven't regenerated in a bit and there's been a large amount of table churn fairly recently. Test Plan: Ran `bin/storage upgrade`, saw guidance notification in UI. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12819 Differential Revision: https://secure.phabricator.com/D18594
This commit is contained in:
19
resources/sql/autopatches/20170912.ferret.01.activity.php
Normal file
19
resources/sql/autopatches/20170912.ferret.01.activity.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
// Advise installs to perform a reindex in order to rebuild the Ferret engine
|
||||
// indexes.
|
||||
|
||||
// If the install is completely empty with no user accounts, don't require
|
||||
// a rebuild. In particular, this happens when rebuilding the quickstart file.
|
||||
$users = id(new PhabricatorUser())->loadAllWhere('1 = 1 LIMIT 1');
|
||||
if (!$users) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
id(new PhabricatorConfigManualActivity())
|
||||
->setActivityType(PhabricatorConfigManualActivity::TYPE_REINDEX)
|
||||
->save();
|
||||
} catch (AphrontDuplicateKeyQueryException $ex) {
|
||||
// If we've already noted that this activity is required, just move on.
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user