@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add setup check for missing SQL patches

Test Plan: Saw the warning, upgraded storage, didn't see it.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5618

+31 -8
+31 -8
src/applications/config/check/PhabricatorSetupCheckDatabase.php
··· 15 15 16 16 ini_set('mysql.connect_timeout', 2); 17 17 18 + $config = array( 19 + 'user' => $conn_user, 20 + 'pass' => $conn_pass, 21 + 'host' => $conn_host, 22 + 'database' => null, 23 + ); 24 + 18 25 $conn_raw = PhabricatorEnv::newObjectFromConfig( 19 26 'mysql.implementation', 20 - array( 21 - array( 22 - 'user' => $conn_user, 23 - 'pass' => $conn_pass, 24 - 'host' => $conn_host, 25 - 'database' => null, 26 - ), 27 - )); 27 + array($config)); 28 28 29 29 try { 30 30 queryfx($conn_raw, 'SELECT 1'); ··· 80 80 ->setMessage($message) 81 81 ->setIsFatal(true) 82 82 ->addCommand(hsprintf('<tt>phabricator/ $</tt> ./bin/storage upgrade')); 83 + } else { 84 + 85 + $config['database'] = $namespace.'_meta_data'; 86 + $conn_meta = PhabricatorEnv::newObjectFromConfig( 87 + 'mysql.implementation', 88 + array($config)); 89 + 90 + $applied = queryfx_all($conn_meta, 'SELECT patch FROM patch_status'); 91 + $applied = ipull($applied, 'patch', 'patch'); 92 + 93 + $all = PhabricatorSQLPatchList::buildAllPatches(); 94 + $diff = array_diff_key($all, $applied); 95 + 96 + if ($diff) { 97 + $this->newIssue('storage.patch') 98 + ->setName(pht('Upgrade MySQL Schema')) 99 + ->setMessage(pht( 100 + "Run the storage upgrade script to upgrade Phabricator's database ". 101 + "schema. Missing patches: %s.", 102 + implode(', ', array_keys($diff)))) 103 + ->addCommand( 104 + hsprintf('<tt>phabricator/ $</tt> ./bin/storage upgrade')); 105 + } 83 106 } 84 107 } 85 108 }