1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 19:02:41 +01:00
phorge-phorge/resources/sql/autopatches/20140722.appname.php
epriestley 5462a52b8a Update Quickstart SQL
Summary:
This hasn't been updated in a bit more than a year (last updated in D18594) and we've accumulated a fair number of SQL patches. Update it.

This is mostly automatic (with `bin/storage quickstart`), except:

  - Manual edit to one migration for a missed callsite to `DashboardInstall`.
  - Replaced two InnoDB tables that still have FULLTEXT indexes with MyISAM (see rP6cedd4a95cfc).

This is not really possible to review and more for reference than examination. `bin/storage quickstart` has historically worked correctly.

Test Plan: I have great faith that `bin/storage quickstart` is a script which creates a big `.sql` file.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Differential Revision: https://secure.phabricator.com/D20480
2019-04-30 08:19:39 -07:00

127 lines
2.6 KiB
PHP

<?php
$applications = array(
'Audit',
'Auth',
'Calendar',
'ChatLog',
'Conduit',
'Config',
'Conpherence',
'Countdown',
'Daemons',
'Dashboard',
'Differential',
'Diffusion',
'Diviner',
'Doorkeeper',
'Drydock',
'Fact',
'Feed',
'Files',
'Flags',
'Harbormaster',
'Help',
'Herald',
'Home',
'Legalpad',
'Macro',
'MailingLists',
'Maniphest',
'Applications',
'MetaMTA',
'Notifications',
'Nuance',
'OAuthServer',
'Owners',
'Passphrase',
'Paste',
'People',
'Phame',
'Phlux',
'Pholio',
'Phortune',
'PHPAST',
'Phragment',
'Phrequent',
'Phriction',
'Policy',
'Ponder',
'Project',
'Releeph',
'Repositories',
'Search',
'Settings',
'Slowvote',
'Subscriptions',
'Support',
'System',
'Test',
'Tokens',
'Transactions',
'Typeahead',
'UIExamples',
'XHProf',
);
$map = array();
foreach ($applications as $application) {
$old_name = 'PhabricatorApplication'.$application;
$new_name = 'Phabricator'.$application.'Application';
$map[$old_name] = $new_name;
}
/* -( User preferences )--------------------------------------------------- */
// This originally migrated pinned applications in user preferences, but was
// removed to simplify preference changes after about 22 months.
/* -( Dashboard installs )------------------------------------------------- */
// This originally migrated dashboard install locations, but was removed
// after about 5 years.
/* -( Phabricator configuration )------------------------------------------ */
$config_key = 'phabricator.uninstalled-applications';
echo pht('Migrating `%s` config...', $config_key)."\n";
$config = PhabricatorConfigEntry::loadConfigEntry($config_key);
$old_config = $config->getValue();
$new_config = array();
if ($old_config) {
foreach ($old_config as $application => $uninstalled) {
$new_config[idx($map, $application, $application)] = $uninstalled;
}
$config
->setIsDeleted(0)
->setValue($new_config)
->save();
}
/* -( phabricator.application-settings )----------------------------------- */
$config_key = 'phabricator.application-settings';
echo pht('Migrating `%s` config...', $config_key)."\n";
$config = PhabricatorConfigEntry::loadConfigEntry($config_key);
$old_config = $config->getValue();
$new_config = array();
if ($old_config) {
foreach ($old_config as $application => $settings) {
$application = preg_replace('/^PHID-APPS-/', '', $application);
$new_config['PHID-APPS-'.idx($map, $application, $application)] = $settings;
}
$config
->setIsDeleted(0)
->setValue($new_config)
->save();
}