repo stringlengths 7 63 | file_url stringlengths 81 284 | file_path stringlengths 5 200 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:02:33 2026-01-05 05:24:06 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20170410.calendar.01.repair.php | resources/sql/autopatches/20170410.calendar.01.repair.php | <?php
// See T12488. Some events survived "20161004.cal.01.noepoch.php" without
// having "utcInstanceEpoch" computed, which breaks ICS export. This appears
// to be the result of some bug which has been fixed in the meantime, so just
// redo this part of the migration.
$table = new PhabricatorCalendarEvent();
$conn ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180306.opath.02.digestpopulate.php | resources/sql/autopatches/20180306.opath.02.digestpopulate.php | <?php
$table = new PhabricatorOwnersPath();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $path) {
$index = PhabricatorHash::digestForIndex($path->getPath());
if ($index === $path->getPathIndex()) {
continue;
}
queryfx(
$conn,
'UPDATE %T SET pathIndex = ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160223.paste.fileedges.php | resources/sql/autopatches/20160223.paste.fileedges.php | <?php
// For a while in November 2015, attachment edges between pastes and their
// underlying file data were not written correctly. This restores edges for
// any missing pastes.
// See T13510. The "pastebin" database was later renamed to "paste", which
// broke this migration. The migration was removed in 2020 sinc... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140815.cancdncase.php | resources/sql/autopatches/20140815.cancdncase.php | <?php
// This corrects files which incorrectly had a 'cancdn' property written;
// the property should be 'canCDN'.
$table = new PhabricatorFile();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $file) {
$id = $file->getID();
echo pht(
"Updating capitalization of %s ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140211.dx.2.migcommenttext.php | resources/sql/autopatches/20140211.dx.2.migcommenttext.php | <?php
$conn_w = id(new DifferentialRevision())->establishConnection('w');
$rows = new LiskRawMigrationIterator($conn_w, 'differential_comment');
$content_source = PhabricatorContentSource::newForSource(
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
echo pht('Migrating Differential comment text to mo... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20170912.ferret.01.activity.php | resources/sql/autopatches/20170912.ferret.01.activity.php | <?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');
i... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160406.columns.1.php | resources/sql/autopatches/20160406.columns.1.php | <?php
$table = new ManiphestTransaction();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $xaction) {
$type = $xaction->getTransactionType();
$id = $xaction->getID();
// This is an old ManiphestTransaction::TYPE_COLUMN. It did not do anything
// on its own and was h... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20190909.herald.01.rebuild.php | resources/sql/autopatches/20190909.herald.01.rebuild.php | <?php
// @phase worker
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery('HeraldRuleQuery');
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151107.phame.blog.mailkey.2.php | resources/sql/autopatches/20151107.phame.blog.mailkey.2.php | <?php
$table = new PhameBlog();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $blog) {
$id = $blog->getID();
echo pht('Adding mail key for Blog %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s WHERE id = %d',
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20191028.uriindex.01.rebuild.php | resources/sql/autopatches/20191028.uriindex.01.rebuild.php | <?php
// @phase worker
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery(
'PhabricatorRepositoryQuery');
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140731.cancdn.php | resources/sql/autopatches/20140731.cancdn.php | <?php
$table = new PhabricatorFile();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $file) {
$id = $file->getID();
echo pht('Updating flags for file %d...', $id)."\n";
$meta = $file->getMetadata();
if (!idx($meta, 'canCDN')) {
$meta['canCDN'] = true;
queryf... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160531.pref.07.phidval.php | resources/sql/autopatches/20160531.pref.07.phidval.php | <?php
$table = new PhabricatorUserPreferences();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $row) {
if ($row->getPHID() !== '') {
continue;
}
queryfx(
$conn_w,
'UPDATE %T SET phid = %s WHERE id = %d',
$table->getTableName(),
$table->generatePHI... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160927.phurl.ngrams.php | resources/sql/autopatches/20160927.phurl.ngrams.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140725.audit.1.migxactions.php | resources/sql/autopatches/20140725.audit.1.migxactions.php | <?php
$conn_w = id(new PhabricatorAuditTransaction())->establishConnection('w');
$rows = new LiskRawMigrationIterator($conn_w, 'audit_comment');
$content_source = PhabricatorContentSource::newForSource(
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
echo pht('Migrating Audit comments to modern storag... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150120.maniphestdefaultauthor.php | resources/sql/autopatches/20150120.maniphestdefaultauthor.php | <?php
$key = 'metamta.maniphest.default-public-author';
echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
$value = PhabricatorEnv::getEnvConfigIfExists($key);
$maniphest = new PhabricatorManiphestApplication();
$config_key =
PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR;
if ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160303.drydock.2.bluei.php | resources/sql/autopatches/20160303.drydock.2.bluei.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140321.mstatus.2.mig.php | resources/sql/autopatches/20140321.mstatus.2.mig.php | <?php
$status_map = array(
0 => 'open',
1 => 'resolved',
2 => 'wontfix',
3 => 'invalid',
4 => 'duplicate',
5 => 'spite',
);
$conn_w = id(new ManiphestTask())->establishConnection('w');
echo pht('Migrating tasks to new status constants...')."\n";
foreach (new LiskMigrationIterator(new ManiphestTask()) as ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20191113.identity.02.populate.php | resources/sql/autopatches/20191113.identity.02.populate.php | <?php
$table = new PhabricatorRepositoryIdentity();
$conn = $table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
foreach ($iterator as $row) {
$name = $row['identityNameRaw'];
$name = phutil_utf8ize($name);
$email = new PhutilEmailAddress($name);
$address... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160510.repo.01.uriindex.php | resources/sql/autopatches/20160510.repo.01.uriindex.php | <?php
$repos = id(new PhabricatorRepositoryQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->needURIs(true)
->execute();
foreach ($repos as $repo) {
$repo->updateURIIndex();
}
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151023.harborpolicy.2.php | resources/sql/autopatches/20151023.harborpolicy.2.php | <?php
$table = new HarbormasterBuildPlan();
$conn_w = $table->establishConnection('w');
$view_policy = PhabricatorPolicies::getMostOpenPolicy();
queryfx(
$conn_w,
'UPDATE %T SET viewPolicy = %s WHERE viewPolicy = %s',
$table->getTableName(),
$view_policy,
'');
$edit_policy = id(new PhabricatorHarbormasterA... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140226.dxcustom.1.fielddata.php | resources/sql/autopatches/20140226.dxcustom.1.fielddata.php | <?php
$conn_w = id(new DifferentialRevision())->establishConnection('w');
$rows = new LiskRawMigrationIterator($conn_w, 'differential_auxiliaryfield');
echo pht('Modernizing Differential auxiliary field storage...')."\n";
$table_name = id(new DifferentialCustomFieldStorage())->getTableName();
foreach ($rows as $row)... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140722.audit.3.miginlines.php | resources/sql/autopatches/20140722.audit.3.miginlines.php | <?php
$audit_table = new PhabricatorAuditTransaction();
$conn_w = $audit_table->establishConnection('w');
$conn_w->openTransaction();
$src_table = 'audit_inlinecomment';
$dst_table = 'audit_transaction_comment';
echo pht('Migrating Audit inline comments to new format...')."\n";
$content_source = PhabricatorContentS... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151106.phame.post.mailkey.2.php | resources/sql/autopatches/20151106.phame.post.mailkey.2.php | <?php
$table = new PhamePost();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $post) {
$id = $post->getID();
echo pht('Adding mail key for Post %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s WHERE id = %d',
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20141222.maniphestprojtxn.php | resources/sql/autopatches/20141222.maniphestprojtxn.php | <?php
$table = new ManiphestTransaction();
$conn_w = $table->establishConnection('w');
echo pht(
"Converting Maniphest project transactions to modern edge transactions...\n");
$metadata = array(
'edge:type' => PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
);
foreach (new LiskMigrationIterator($table) as ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150804.ponder.answer.mailkey.2.php | resources/sql/autopatches/20150804.ponder.answer.mailkey.2.php | <?php
$table = new PonderAnswer();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $answer) {
$id = $answer->getID();
echo pht('Adding mail key for Answer %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s WHERE id =... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160503.repo.03.lpathmigrate.php | resources/sql/autopatches/20160503.repo.03.lpathmigrate.php | <?php
$table = new PhabricatorRepository();
$conn_w = $table->establishConnection('w');
$default_path = PhabricatorEnv::getEnvConfig('repository.default-local-path');
$default_path = rtrim($default_path, '/');
foreach (new LiskMigrationIterator($table) as $repository) {
$local_path = $repository->getLocalPath();
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180121.auth.04.accountphid.php | resources/sql/autopatches/20180121.auth.04.accountphid.php | <?php
// Populate account passwords (which we copied from the user table in the last
// migration) with new PHIDs.
$table = new PhabricatorAuthPassword();
$conn = $table->establishConnection('w');
$password_type = PhabricatorAuthPasswordPHIDType::TYPECONST;
foreach (new LiskMigrationIterator($table) as $row) {
if... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140904.macroattach.php | resources/sql/autopatches/20140904.macroattach.php | <?php
$table = new PhabricatorFileImageMacro();
foreach (new LiskMigrationIterator($table) as $macro) {
$name = $macro->getName();
echo pht("Linking macro '%s'...", $name)."\n";
$editor = new PhabricatorEdgeEditor();
$phids[] = $macro->getFilePHID();
$phids[] = $macro->getAudioPHID();
$phids = array_fil... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20141107.ssh.4.keymig.php | resources/sql/autopatches/20141107.ssh.4.keymig.php | <?php
$table = new PhabricatorAuthSSHKey();
$conn_w = $table->establishConnection('w');
echo pht('Updating SSH public key indexes...')."\n";
$keys = new LiskMigrationIterator($table);
foreach ($keys as $key) {
$id = $key->getID();
echo pht('Updating key %d...', $id)."\n";
try {
$hash = $key->toPublicKey(... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140205.cal.3.phid-mig.php | resources/sql/autopatches/20140205.cal.3.phid-mig.php | <?php
$table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w');
echo pht('Assigning PHIDs to events...')."\n";
foreach (new LiskMigrationIterator($table) as $event) {
$id = $event->getID();
echo pht('Updating event %d...', $id)."\n";
if ($event->getPHID()) {
continue;
}
quer... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180214.harbor.01.aborted.php | resources/sql/autopatches/20180214.harbor.01.aborted.php | <?php
$table = new HarbormasterBuildable();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $buildable) {
if ($buildable->getBuildableStatus() !== 'building') {
continue;
}
$aborted = queryfx_one(
$conn,
'SELECT * FROM %T WHERE buildablePHID = %s AND buildSta... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150725.countdown.mailkey.2.php | resources/sql/autopatches/20150725.countdown.mailkey.2.php | <?php
$table = new PhabricatorCountdown();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $countdown) {
$id = $countdown->getID();
echo pht('Adding mail key for countdown %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKe... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140711.pnames.2.php | resources/sql/autopatches/20140711.pnames.2.php | <?php
echo pht('Updating project datasource tokens...')."\n";
foreach (new LiskMigrationIterator(new PhabricatorProject()) as $project) {
$name = $project->getName();
echo pht("Updating project '%d'...", $name)."\n";
$project->updateDatasourceTokens();
}
echo pht('Done.')."\n";
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180215.phriction.02.phidvalues.php | resources/sql/autopatches/20180215.phriction.02.phidvalues.php | <?php
$table = new PhrictionContent();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $row) {
if (strlen($row->getPHID())) {
continue;
}
queryfx(
$conn,
'UPDATE %T SET phid = %s WHERE id = %d',
$table->getTableName(),
$table->generatePHID(),
$row... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160503.repo.04.mirrormigrate.php | resources/sql/autopatches/20160503.repo.04.mirrormigrate.php | <?php
$table = new PhabricatorRepository();
$conn_w = $table->establishConnection('w');
$mirrors = queryfx_all(
$conn_w,
'SELECT * FROM %T',
'repository_mirror');
foreach ($mirrors as $mirror) {
$repository_phid = $mirror['repositoryPHID'];
$uri = $mirror['remoteURI'];
$already_exists = id(new Phabricat... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180828.phriction.06.c.documentid.php | resources/sql/autopatches/20180828.phriction.06.c.documentid.php | <?php
// See T13193. We're about to drop the "documentID" column, which is part of
// a UNIQUE KEY. In MariaDB, we must first drop the "documentID" key or we get
// into deep trouble.
// There's no "IF EXISTS" modifier for "ALTER TABLE" so run this as a PHP patch
// instead of an SQL patch.
$table = new PhrictionCon... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180830.phriction.02.maxes.php | resources/sql/autopatches/20180830.phriction.02.maxes.php | <?php
// Populate the "maxVersion" column by copying the maximum "version" from the
// content table.
$document_table = new PhrictionDocument();
$content_table = new PhrictionContent();
$conn = $document_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$conn,
$document_table->getTableN... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140706.harbormasterdepend.1.php | resources/sql/autopatches/20140706.harbormasterdepend.1.php | <?php
$plan_table = new HarbormasterBuildPlan();
$step_table = new HarbormasterBuildStep();
$conn_w = $plan_table->establishConnection('w');
foreach (new LiskMigrationIterator($plan_table) as $plan) {
echo pht(
"Migrating build plan %d: %s...\n",
$plan->getID(),
$plan->getName());
// Load all build s... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140722.renameauth.php | resources/sql/autopatches/20140722.renameauth.php | <?php
$map = array(
'PhabricatorAuthProviderOAuthAmazon' => 'PhabricatorAmazonAuthProvider',
'PhabricatorAuthProviderOAuthAsana' => 'PhabricatorAsanaAuthProvider',
'PhabricatorAuthProviderOAuth1Bitbucket'
=> 'PhabricatorBitbucketAuthProvider',
'PhabricatorAuthProviderOAuthDisqus' => 'PhabricatorDisqusAuthP... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160225.almanac.3.stype.php | resources/sql/autopatches/20160225.almanac.3.stype.php | <?php
// Previously, Almanac services stored a "serviceClass". Migrate these to
// new "serviceType" values.
$table = new AlmanacService();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $service) {
$new_type = null;
try {
$old_type = $service->getServiceType();
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20181220.pholio.01.mailkey.php | resources/sql/autopatches/20181220.pholio.01.mailkey.php | <?php
$mock_table = new PholioMock();
$mock_conn = $mock_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$mock_conn,
$mock_table->getTableName());
foreach ($iterator as $ro... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140210.herald.rule-condition-mig.php | resources/sql/autopatches/20140210.herald.rule-condition-mig.php | <?php
$table = new HeraldCondition();
$conn_w = $table->establishConnection('w');
echo pht(
"Migrating Herald conditions of type Herald rule from IDs to PHIDs...\n");
foreach (new LiskMigrationIterator($table) as $condition) {
if ($condition->getFieldName() != HeraldAnotherRuleField::FIELDCONST) {
continue;
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140521.projectslug.2.mig.php | resources/sql/autopatches/20140521.projectslug.2.mig.php | <?php
$project_table = new PhabricatorProject();
$table_name = $project_table->getTableName();
$conn_w = $project_table->establishConnection('w');
$slug_table_name = id(new PhabricatorProjectSlug())->getTableName();
$time = PhabricatorTime::getNow();
echo pht('Migrating projects to slugs...')."\n";
foreach (new LiskM... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140420.rel.2.objectmig.php | resources/sql/autopatches/20140420.rel.2.objectmig.php | <?php
$pull_table = new ReleephRequest();
$table_name = $pull_table->getTableName();
$conn_w = $pull_table->establishConnection('w');
echo pht('Setting object PHIDs for requests...')."\n";
foreach (new LiskMigrationIterator($pull_table) as $pull) {
$id = $pull->getID();
echo pht('Migrating pull request %d...', $... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140218.passwords.4.vcs.php | resources/sql/autopatches/20140218.passwords.4.vcs.php | <?php
// This migration once upgraded VCS password hashing, but the table was
// later removed in 2018 (see T13043).
// Since almost four years have passed since this migration, the cost of
// losing this data is very small (users just need to reset their passwords),
// and a version of this migration against the mod... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160227.harbormaster.2.plani.php | resources/sql/autopatches/20160227.harbormaster.2.plani.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20190412.dashboard.01.panels.php | resources/sql/autopatches/20190412.dashboard.01.panels.php | <?php
// Convert dashboards to a new storage format. The old storage format looks
// like this:
// {
// "0": ["PHID-DSHP-A", ...],
// "1": ["PHID-DSHP-B", ...]
// }
// The new storage format looks like this:
// [
// {
// "panelKey": "abcdefgh",
// "panelPHID": "PHID-DSHP-A",
// "columnKey": "left"... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150116.maniphestapplicationemails.php | resources/sql/autopatches/20150116.maniphestapplicationemails.php | <?php
$key = 'metamta.maniphest.public-create-email';
echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
$value = PhabricatorEnv::getEnvConfigIfExists($key);
$maniphest = new PhabricatorManiphestApplication();
if ($value) {
try {
PhabricatorMetaMTAApplicationEmail::initializeNewAppEm... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150602.mlist.2.php | resources/sql/autopatches/20150602.mlist.2.php | <?php
$conn_w = id(new PhabricatorMetaMTAMail())->establishConnection('w');
$lists = new LiskRawMigrationIterator($conn_w, 'metamta_mailinglist');
echo pht('Migrating mailing lists...')."\n";
foreach ($lists as $list) {
$name = $list['name'];
$email = $list['email'];
$uri = $list['uri'];
$old_phid = $list['p... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20210316.almanac.13.event-mailkey.php | resources/sql/autopatches/20210316.almanac.13.event-mailkey.php | <?php
$event_table = new PhabricatorCalendarEvent();
$event_conn = $event_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$event_conn,
$event_table->getTableName());
foreac... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160308.nuance.04.sourcei.php | resources/sql/autopatches/20160308.nuance.04.sourcei.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20220525.slowvote.01.mailkey.php | resources/sql/autopatches/20220525.slowvote.01.mailkey.php | <?php
$poll_table = new PhabricatorSlowvotePoll();
$poll_conn = $poll_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$poll_conn,
$poll_table->getTableName());
foreach ($it... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20141106.uniqdrafts.php | resources/sql/autopatches/20141106.uniqdrafts.php | <?php
// This table has been removed; see T12104 for details.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20200222.xident.02.dropkey.php | resources/sql/autopatches/20200222.xident.02.dropkey.php | <?php
// See T13493. This table previously had a UNIQUE KEY on "<accountType,
// accountDomain, accountID>", which is obsolete. The application now violates
// this key, so make sure it gets dropped.
// There's no "IF EXISTS" modifier for "ALTER TABLE" so run this as a PHP patch
// instead of an SQL patch.
$table = ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20141218.maniphestcctxn.php | resources/sql/autopatches/20141218.maniphestcctxn.php | <?php
$table = new ManiphestTransaction();
$conn_w = $table->establishConnection('w');
echo pht(
"Converting Maniphest CC transactions to modern ".
"subscriber transactions...\n");
foreach (new LiskMigrationIterator($table) as $txn) {
// ManiphestTransaction::TYPE_CCS
if ($txn->getTransactionType() == 'ccs') ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180910.audit.03.status.php | resources/sql/autopatches/20180910.audit.03.status.php | <?php
$table = new PhabricatorRepositoryCommit();
$conn = $table->establishConnection('w');
$status_map = array(
0 => 'none',
1 => 'needs-audit',
2 => 'concern-raised',
3 => 'partially-audited',
4 => 'audited',
5 => 'needs-verification',
);
foreach ($status_map as $old_status => $new_status) {
queryfx(... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20190815.account.01.carts.php | resources/sql/autopatches/20190815.account.01.carts.php | <?php
$edge_type = PhortuneAccountHasMerchantEdgeType::EDGECONST;
$table = new PhortuneCart();
foreach (new LiskMigrationIterator($table) as $cart) {
id(new PhabricatorEdgeEditor())
->addEdge($cart->getAccountPHID(), $edge_type, $cart->getMerchantPHID())
->save();
}
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20181031.board.01.queryreset.php | resources/sql/autopatches/20181031.board.01.queryreset.php | <?php
// See T13208. It was previously possible to replace a saved query with another
// saved query, causing loss of the first query. Find projects which have their
// default query set to an invalid query and throw the setting away.
$viewer = PhabricatorUser::getOmnipotentUser();
$table = new PhabricatorProject();... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20161011.conpherence.ngrams.php | resources/sql/autopatches/20161011.conpherence.ngrams.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20161213.diff.01.hunks.php | resources/sql/autopatches/20161213.diff.01.hunks.php | <?php
$conn = id(new DifferentialRevision())->establishConnection('w');
$src_table = 'differential_hunk';
$dst_table = 'differential_hunk_modern';
echo tsprintf(
"%s\n",
pht('Migrating old hunks...'));
foreach (new LiskRawMigrationIterator($conn, $src_table) as $row) {
queryfx(
$conn,
'INSERT INTO %T
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20200222.xident.01.migrate.php | resources/sql/autopatches/20200222.xident.01.migrate.php | <?php
$account_table = new PhabricatorExternalAccount();
$identifier_table = new PhabricatorExternalAccountIdentifier();
$conn = $account_table->establishConnection('w');
$table_name = $account_table->getTableName();
$iterator = new LiskRawMigrationIterator($conn, $table_name);
foreach ($iterator as $account_row) {
... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20170526.milestones.php | resources/sql/autopatches/20170526.milestones.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20170316.rawfiles.01.php | resources/sql/autopatches/20170316.rawfiles.01.php | <?php
// Previously, files generated by "View Raw File" were written as permanent
// files with excessively wide view permissions. This destroys these files
// so they are recreated as temporary files with correct permissions when
// next accessed.
$table = new DifferentialChangeset();
$conn = $table->establishConnec... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151231.proj.01.icon.php | resources/sql/autopatches/20151231.proj.01.icon.php | <?php
$icon_map = array(
'fa-briefcase' => 'project',
'fa-tags' => 'tag',
'fa-lock' => 'policy',
'fa-users' => 'group',
'fa-folder' => 'folder',
'fa-calendar' => 'timeline',
'fa-flag-checkered' => 'goal',
'fa-truck' => 'release',
'fa-bug' => 'bugs',
'fa-trash-o' => 'cleanup',
'fa-umbrella' => '... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20190115.mfa.02.migrate.php | resources/sql/autopatches/20190115.mfa.02.migrate.php | <?php
// Previously, MFA factors for individual users were bound to raw factor types.
// The only factor type ever implemented in the upstream was "totp".
// Going forward, individual factors are bound to a provider instead. This
// allows factor types to have some configuration, like API keys for
// service-based MF... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151210.land.2.refphid.php | resources/sql/autopatches/20151210.land.2.refphid.php | <?php
$table = new PhabricatorRepositoryRefCursor();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $cursor) {
if (strlen($cursor->getPHID())) {
continue;
}
queryfx(
$conn_w,
'UPDATE %T SET phid = %s WHERE id = %d',
$table->getTableName(),
$table->... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150606.mlist.1.php | resources/sql/autopatches/20150606.mlist.1.php | <?php
$conn_r = id(new PhabricatorMetaMTAMail())->establishConnection('r');
$rows = queryfx_all(
$conn_r,
'SELECT phid, email FROM %T',
'metamta_mailinglist');
if (!$rows) {
echo pht('No mailing lists to migrate.')."\n";
return;
}
$list_map = array();
foreach ($rows as $row) {
$list_map[phutil_utf8_strto... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20161005.cal.01.rrules.php | resources/sql/autopatches/20161005.cal.01.rrules.php | <?php
$table = new PhabricatorCalendarEvent();
$conn = $table->establishConnection('w');
$table_name = 'calendar_event';
foreach (new LiskRawMigrationIterator($conn, $table_name) as $row) {
$parameters = phutil_json_decode($row['parameters']);
if (isset($parameters['recurrenceRule'])) {
// This event has alre... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180306.opath.03.purge.php | resources/sql/autopatches/20180306.opath.03.purge.php | <?php
$table = new PhabricatorOwnersPath();
$conn = $table->establishConnection('w');
$seen = array();
foreach (new LiskMigrationIterator($table) as $path) {
$package_id = $path->getPackageID();
$repository_phid = $path->getRepositoryPHID();
$path_index = $path->getPathIndex();
if (!isset($seen[$package_id][... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20210316.almanac.07.binding-mailkey.php | resources/sql/autopatches/20210316.almanac.07.binding-mailkey.php | <?php
$binding_table = new AlmanacBinding();
$binding_conn = $binding_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$binding_conn,
$binding_table->getTableName());
foreac... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140210.projcfield.1.blurb.php | resources/sql/autopatches/20140210.projcfield.1.blurb.php | <?php
$conn_w = id(new PhabricatorProject())->establishConnection('w');
$table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'project_profile');
echo pht('Migrating project descriptions to custom storage...')."\n";
foreach ($rows as $row) {
$ph... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140108.ddbpname.2.php | resources/sql/autopatches/20140108.ddbpname.2.php | <?php
echo pht('Adding names to Drydock blueprints.')."\n";
$table = new DrydockBlueprint();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $blueprint) {
$id = $blueprint->getID();
echo pht('Populating blueprint %d...', $id)."\n";
if (!strlen($... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150129.pastefileapplicationemails.php | resources/sql/autopatches/20150129.pastefileapplicationemails.php | <?php
$key_files = 'metamta.files.public-create-email';
$key_paste = 'metamta.paste.public-create-email';
echo pht(
"Migrating `%s` and `%s` to new application email infrastructure...\n",
$key_files,
$key_paste);
$value_files = PhabricatorEnv::getEnvConfigIfExists($key_files);
$files_app = new PhabricatorFilesA... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151221.search.3.reindex.php | resources/sql/autopatches/20151221.search.3.reindex.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150515.project.mailkey.2.php | resources/sql/autopatches/20150515.project.mailkey.2.php | <?php
$table = new PhabricatorProject();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $project) {
$id = $project->getID();
echo pht('Adding mail key for project %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s W... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140410.accountsecret.2.php | resources/sql/autopatches/20140410.accountsecret.2.php | <?php
echo pht('Updating users...')."\n";
foreach (new LiskMigrationIterator(new PhabricatorUser()) as $user) {
$id = $user->getID();
echo pht('Updating %d...', $id)."\n";
if (strlen($user->getAccountSecret())) {
continue;
}
queryfx(
$user->establishConnection('w'),
'UPDATE %T SET accountSecre... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160604.user.01.stringmailprefs.php | resources/sql/autopatches/20160604.user.01.stringmailprefs.php | <?php
$table = new PhabricatorUserPreferences();
$conn_w = $table->establishConnection('w');
// Convert "Mail Format", "Re Prefix" and "Vary Subjects" mail settings to
// string constants to avoid weird stuff where we store "true" and "false" as
// strings in the database.
// Each of these keys will be converted to... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20170918.ref.01.position.php | resources/sql/autopatches/20170918.ref.01.position.php | <?php
$table = new PhabricatorRepositoryRefPosition();
$conn = $table->establishConnection('w');
$key_name = 'key_position';
try {
queryfx(
$conn,
'ALTER TABLE %T DROP KEY %T',
$table->getTableName(),
$key_name);
} catch (AphrontQueryException $ex) {
// This key may or may not exist, depending on ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20191114.email.02.populate.php | resources/sql/autopatches/20191114.email.02.populate.php | <?php
$table = new PhabricatorUserEmail();
$conn = $table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
foreach ($iterator as $row) {
$phid = $row['phid'];
if (!strlen($phid)) {
queryfx(
$conn,
'UPDATE %R SET phid = %s WHERE id = %d',
$t... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180120.auth.04.vcsphid.php | resources/sql/autopatches/20180120.auth.04.vcsphid.php | <?php
// Populate VCS passwords (which we copied from the old "VCS Password" table
// in the last migration) with new PHIDs.
$table = new PhabricatorAuthPassword();
$conn = $table->establishConnection('w');
$password_type = PhabricatorAuthPasswordPHIDType::TYPECONST;
foreach (new LiskMigrationIterator($table) as $r... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20190412.herald.01.rebuild.php | resources/sql/autopatches/20190412.herald.01.rebuild.php | <?php
// @phase worker
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery('HeraldRuleQuery');
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140212.dx.1.armageddon.php | resources/sql/autopatches/20140212.dx.1.armageddon.php | <?php
$conn_w = id(new DifferentialRevision())->establishConnection('w');
$rows = new LiskRawMigrationIterator($conn_w, 'differential_comment');
$content_source = PhabricatorContentSource::newForSource(
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
echo pht('Migrating Differential comments to modern... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180914.audit.01.mailkey.php | resources/sql/autopatches/20180914.audit.01.mailkey.php | <?php
$commit_table = new PhabricatorRepositoryCommit();
$commit_conn = $commit_table->establishConnection('w');
$commit_name = $commit_table->getTableName();
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($com... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180418.almanac.network.unique.php | resources/sql/autopatches/20180418.almanac.network.unique.php | <?php
$table = new AlmanacNetwork();
$conn = $table->establishConnection('w');
queryfx(
$conn,
'LOCK TABLES %T WRITE',
$table->getTableName());
$seen = array();
foreach (new LiskMigrationIterator($table) as $network) {
$name = $network->getName();
// If this is the first copy of this row we've seen, mark ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20150526.owners.mailkey.2.php | resources/sql/autopatches/20150526.owners.mailkey.2.php | <?php
$table = new PhabricatorOwnersPackage();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $package) {
$id = $package->getID();
echo pht('Adding mail key for package %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey ... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20180910.audit.01.searches.php | resources/sql/autopatches/20180910.audit.01.searches.php | <?php
$table = new PhabricatorSavedQuery();
$conn = $table->establishConnection('w');
$status_map = array(
0 => 'none',
1 => 'needs-audit',
2 => 'concern-raised',
3 => 'partially-audited',
4 => 'audited',
5 => 'needs-verification',
);
foreach (new LiskMigrationIterator($table) as $query) {
if ($query->... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20161130.search.02.rebuild.php | resources/sql/autopatches/20161130.search.02.rebuild.php | <?php
// See T11741. Long ago, in T11922, we switched from "MyISAM FULLTEXT" to
// "InnoDB FULLTEXT". This migration prompted installs to rebuild the index.
// Later, in T12974, we switched from "InnoDB FULLTEXT" to "Ferret", mostly
// mooting this. The underlying tables and engines were later removed entirely.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160406.badges.ngrams.php | resources/sql/autopatches/20160406.badges.ngrams.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160112.repo.02.uri.index.php | resources/sql/autopatches/20160112.repo.02.uri.index.php | <?php
// A later patch ("20160510.repo.01.uriindex.php") performs an identical
// regeneration of the index, so we no longer need to do it here.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160503.repo.05.urimigrate.php | resources/sql/autopatches/20160503.repo.05.urimigrate.php | <?php
$table = new PhabricatorRepository();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $repository) {
$uris = array();
$serve_http = $repository->getDetail('serve-over-http');
$http_io = PhabricatorRepositoryURI::IO_DEFAULT;
$disable_http = false;
switch ($ser... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20161216.dashboard.ngram.02.php | resources/sql/autopatches/20161216.dashboard.ngram.02.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20190129.project.01.spaces.php | resources/sql/autopatches/20190129.project.01.spaces.php | <?php
// See PHI1046. The "spacePHID" column for milestones may have fallen out of
// sync; correct all existing values.
$table = new PhabricatorProject();
$conn = $table->establishConnection('w');
$table_name = $table->getTableName();
foreach (new LiskRawMigrationIterator($conn, $table_name) as $project_row) {
qu... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160601.user.02.copyprefs.php | resources/sql/autopatches/20160601.user.02.copyprefs.php | <?php
// Move timezone, translation and pronoun from the user object to preferences
// so they can be defaulted and edited like other settings.
$table = new PhabricatorUser();
$conn_w = $table->establishConnection('w');
$table_name = $table->getTableName();
$prefs_table = new PhabricatorUserPreferences();
foreach (n... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20170915.ref.01.migrate.php | resources/sql/autopatches/20170915.ref.01.migrate.php | <?php
$table = new PhabricatorRepositoryRefCursor();
$conn = $table->establishConnection('w');
$map = array();
foreach (new LiskMigrationIterator($table) as $ref) {
$repository_phid = $ref->getRepositoryPHID();
$ref_type = $ref->getRefType();
$ref_hash = $ref->getRefNameHash();
$ref_key = "{$repository_phid}... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140115.auth.3.unlimit.php | resources/sql/autopatches/20140115.auth.3.unlimit.php | <?php
// Prior to this patch, we issued sessions "web-1", "web-2", etc., up to some
// limit. This collapses all the "web-X" sessions into "web" sessions.
$session_table = new PhabricatorAuthSession();
$conn_w = $session_table->establishConnection('w');
foreach (new LiskMigrationIterator($session_table) as $session)... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20160221.almanac.2.devicei.php | resources/sql/autopatches/20160221.almanac.2.devicei.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20151218.key.2.keyphid.php | resources/sql/autopatches/20151218.key.2.keyphid.php | <?php
$table = new PhabricatorAuthSSHKey();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $cursor) {
if (strlen($cursor->getPHID())) {
continue;
}
queryfx(
$conn_w,
'UPDATE %T SET phid = %s WHERE id = %d',
$table->getTableName(),
$table->generateP... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20161005.conpherence.image.2.php | resources/sql/autopatches/20161005.conpherence.image.2.php | <?php
// This migration once resized room images for Conpherence, but the File table
// later changed significantly. See T12628.
| php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20140629.legalsig.2.php | resources/sql/autopatches/20140629.legalsig.2.php | <?php
$table = new LegalpadDocumentSignature();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $signature) {
echo pht("Updating Legalpad signature %d...\n", $signature->getID());
$data = $signature->getSignatureData();
queryfx(
$conn_w,
'UPDATE %T SET signerNa... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
phacility/phabricator | https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/resources/sql/autopatches/20210215.changeset.02.phid-populate.php | resources/sql/autopatches/20210215.changeset.02.phid-populate.php | <?php
$phid_type = DifferentialChangesetPHIDType::TYPECONST;
$changeset_table = new DifferentialChangeset();
$conn = $changeset_table->establishConnection('w');
$table_name = $changeset_table->getTableName();
$chunk_size = 4096;
$temporary_table = 'tmp_20210215_changeset_id_map';
try {
queryfx(
$conn,
'... | php | Apache-2.0 | 5720a38cfe95b00ca4be5016dd0d2f3195f4fa04 | 2026-01-04T15:03:23.651835Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.