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 |
|---|---|---|---|---|---|---|---|---|
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/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 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20151223.proj.05.updatekeys.php | resources/sql/autopatches/20151223.proj.05.updatekeys.php | <?php
$table = new PhabricatorProject();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $project) {
$path = $project->getProjectPath();
$key = $project->getProjectPathKey();
if (strlen($path) && ($key !== "\0\0\0\0")) {
continue;
}
$path_key = PhabricatorHash... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150503.repositorysymbols.2.php | resources/sql/autopatches/20150503.repositorysymbols.2.php | <?php
// NOTE: This migration moved existing symbols from Arcanist Projects to
// Repositories. It stopped running cleanly about two months later, after
// Spaces were introduced. Since this data is not important and can be
// trivially regenerated, just stop running the migration. See T8691.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170119.menuitem.motivator.01.php | resources/sql/autopatches/20170119.menuitem.motivator.01.php | <?php
$table = new PhabricatorProfileMenuItemConfiguration();
$conn_w = $table->establishConnection('w');
queryfx(
$conn_w,
'DELETE FROM %T WHERE menuItemKey = "motivator"',
$table->getTableName());
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170424.user.01.verify.php | resources/sql/autopatches/20170424.user.01.verify.php | <?php
$table = new PhabricatorUser();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $user) {
// Ignore users who are verified.
if ($user->getIsEmailVerified()) {
continue;
}
// Ignore unverified users with missing (rare) or unverified (common)
// primary emails... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20230902.repository.01.rebuild-index.php | resources/sql/autopatches/20230902.repository.01.rebuild-index.php | <?php
// @phase worker
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery(
'PhabricatorRepositoryQuery');
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20171026.ferret.05.ponder.index.php | resources/sql/autopatches/20171026.ferret.05.ponder.index.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20190412.dashboard.13.rebuild.php | resources/sql/autopatches/20190412.dashboard.13.rebuild.php | <?php
// @phase worker
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery(
'PhabricatorDashboardQuery');
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery(
'PhabricatorDashboardPanelQuery');
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140805.boardcol.2.php | resources/sql/autopatches/20140805.boardcol.2.php | <?php
// Was PhabricatorEdgeConfig::TYPE_COLUMN_HAS_OBJECT
$type_has_object = 44;
$column = new PhabricatorProjectColumn();
$conn_w = $column->establishConnection('w');
$rows = queryfx_all(
$conn_w,
'SELECT src, dst FROM %T WHERE type = %d',
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
$type_has_object);
$cols =... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170824.search.01.saved.php | resources/sql/autopatches/20170824.search.01.saved.php | <?php
// Before T12956, normal users could reorder (and disable) builtin queries.
// After that change, there is a single global order which can only be
// changed by administrators.
// This migration removes the rows which store individual reordering and
// disabling of queries. If a user had reordered queries in su... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20181219.pholio.02.imagemigrate.php | resources/sql/autopatches/20181219.pholio.02.imagemigrate.php | <?php
// Old images used a "mockID" instead of a "mockPHID" to reference mocks.
// Set the "mockPHID" column to the value that corresponds to the "mockID".
$image = new PholioImage();
$mock = new PholioMock();
$conn = $image->establishConnection('w');
$iterator = new LiskRawMigrationIterator($conn, $image->getTableN... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140323.harbor.1.renames.php | resources/sql/autopatches/20140323.harbor.1.renames.php | <?php
$names = array(
'CommandBuildStepImplementation',
'LeaseHostBuildStepImplementation',
'PublishFragmentBuildStepImplementation',
'SleepBuildStepImplementation',
'UploadArtifactBuildStepImplementation',
'WaitForPreviousBuildStepImplementation',
);
$tables = array(
id(new HarbormasterBuildStep())->ge... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150102.policyname.php | resources/sql/autopatches/20150102.policyname.php | <?php
$policies = array(
'Administrators',
'LegalpadSignature',
'LunarPhase',
'Projects',
'Users',
);
$map = array();
foreach ($policies as $policy) {
$old_name = "PhabricatorPolicyRule{$policy}";
$new_name = "Phabricator{$policy}PolicyRule";
$map[$old_name] = $new_name;
}
echo pht('Migrating policie... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20180829.phriction.01.mailkey.php | resources/sql/autopatches/20180829.phriction.01.mailkey.php | <?php
$document_table = new PhrictionDocument();
$document_conn = $document_table->establishConnection('w');
$document_name = $document_table->getTableName();
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($doc... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170811.differential.03.modernxaction.php | resources/sql/autopatches/20170811.differential.03.modernxaction.php | <?php
$map = array(
'0' => 'needs-review',
'1' => 'needs-revision',
'2' => 'accepted',
'3' => 'published',
'4' => 'abandoned',
'5' => 'changes-planned',
);
$table = new DifferentialTransaction();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $xaction) {
$type =... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20190206.external.04.providerlink.php | resources/sql/autopatches/20190206.external.04.providerlink.php | <?php
$account_table = new PhabricatorExternalAccount();
$account_conn = $account_table->establishConnection('w');
$table_name = $account_table->getTableName();
$config_table = new PhabricatorAuthProviderConfig();
$config_conn = $config_table->establishConnection('w');
foreach (new LiskRawMigrationIterator($account_... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150725.slowvote.mailkey.2.php | resources/sql/autopatches/20150725.slowvote.mailkey.2.php | <?php
$table = new PhabricatorSlowvotePoll();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $slowvote) {
$id = $slowvote->getID();
echo pht('Adding mail key for Slowvote %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKe... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20210316.almanac.05.service-mailkey.php | resources/sql/autopatches/20210316.almanac.05.service-mailkey.php | <?php
$service_table = new AlmanacService();
$service_conn = $service_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$service_conn,
$service_table->getTableName());
foreac... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140731.audit.1.subscribers.php | resources/sql/autopatches/20140731.audit.1.subscribers.php | <?php
$table = new PhabricatorRepositoryAuditRequest();
$conn_w = $table->establishConnection('w');
echo pht('Migrating Audit subscribers to subscriptions...')."\n";
foreach (new LiskMigrationIterator($table) as $request) {
$id = $request->getID();
echo pht("Migrating audit %d...\n", $id);
if ($request->getAu... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160720.calendar.invitetxn.php | resources/sql/autopatches/20160720.calendar.invitetxn.php | <?php
$table = new PhabricatorCalendarEventTransaction();
$conn_w = $table->establishConnection('w');
echo pht(
"Restructuring calendar invite transactions...\n");
foreach (new LiskMigrationIterator($table) as $txn) {
$type = PhabricatorCalendarEventInviteTransaction::TRANSACTIONTYPE;
if ($txn->getTransactionT... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20161004.cal.01.noepoch.php | resources/sql/autopatches/20161004.cal.01.noepoch.php | <?php
$table = new PhabricatorCalendarEvent();
$conn = $table->establishConnection('w');
$table_name = 'calendar_event';
// Long ago, "All Day" events were stored with a start and end date set to
// the earliest possible start and end seconds for the corresponding days. We
// then moved to store all day events with t... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20180910.audit.04.xactions.php | resources/sql/autopatches/20180910.audit.04.xactions.php | <?php
$table = new PhabricatorAuditTransaction();
$conn = $table->establishConnection('w');
$status_map = array(
0 => 'none',
1 => 'needs-audit',
2 => 'concern-raised',
3 => 'partially-audited',
4 => 'audited',
5 => 'needs-verification',
);
$state_type = DiffusionCommitStateTransaction::TRANSACTIONTYPE;
... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140106.macromailkey.2.php | resources/sql/autopatches/20140106.macromailkey.2.php | <?php
echo pht('Adding mailkeys to macros.')."\n";
$table = new PhabricatorFileImageMacro();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $macro) {
$id = $macro->getID();
echo pht('Populating macro %d...', $id)."\n";
if (!$macro->getMailKey()... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160110.repo.02.slug.php | resources/sql/autopatches/20160110.repo.02.slug.php | <?php
$table = new PhabricatorRepository();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $repository) {
$slug = $repository->getRepositorySlug();
if ($slug !== null) {
continue;
}
$clone_name = $repository->getDetail('clone-name');
if (!strlen($clone_name)... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160221.almanac.6.networki.php | resources/sql/autopatches/20160221.almanac.6.networki.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20210715.harborcommand.01.xactions.php | resources/sql/autopatches/20210715.harborcommand.01.xactions.php | <?php
// See T13072. Turn the old "process a command" transaction into modular
// transactions that each handle one particular type of command.
$xactions_table = new HarbormasterBuildTransaction();
$xactions_conn = $xactions_table->establishConnection('w');
$row_iterator = new LiskRawMigrationIterator(
$xactions_co... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20141107.phriction.policy.2.php | resources/sql/autopatches/20141107.phriction.policy.2.php | <?php
$table = new PhrictionDocument();
$conn_w = $table->establishConnection('w');
echo pht('Populating Phriction policies.')."\n";
$default_view_policy = PhabricatorPolicies::POLICY_USER;
$default_edit_policy = PhabricatorPolicies::POLICY_USER;
foreach (new LiskMigrationIterator($table) as $doc) {
$id = $doc->g... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20161210.dashboards.02.author.php | resources/sql/autopatches/20161210.dashboards.02.author.php | <?php
// Set authorPHID on Dashboards
//
$table = new PhabricatorDashboard();
$conn_w = $table->establishConnection('w');
$txn_table = new PhabricatorDashboardTransaction();
$txn_conn = $table->establishConnection('r');
echo pht("Building Dashboard authorPHIDs...\n");
foreach (new LiskMigrationIterator($table) as $... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170528.maniphestdupes.php | resources/sql/autopatches/20170528.maniphestdupes.php | <?php
$table = new ManiphestTransaction();
$add_edges = array();
foreach (new LiskMigrationIterator($table) as $txn) {
$txn_type = $txn->getTransactionType();
if ($txn_type == 'mergedinto') {
// dupe handling as implemented in D10427, which creates a specific txn
$add_edges[] = array(
'src' => $txn... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150501.calendar.2.reply.php | resources/sql/autopatches/20150501.calendar.2.reply.php | <?php
echo pht('Adding %s to events.', 'mailkeys')."\n";
$table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $event) {
$id = $event->getID();
echo pht('Populating event %d...', $id)."\n";
queryfx(
$conn_w... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140808.boardprop.3.php | resources/sql/autopatches/20140808.boardprop.3.php | <?php
$table = new PhabricatorProjectColumn();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $column) {
$id = $column->getID();
echo pht('Adjusting column %d...', $id)."\n";
if ($column->getSequence() == 0) {
$properties = $column->getProperties();
$properti... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20180504.owners.01.mailkey.php | resources/sql/autopatches/20180504.owners.01.mailkey.php | <?php
$packages_table = new PhabricatorOwnersPackage();
$packages_conn = $packages_table->establishConnection('w');
$packages_name = $packages_table->getTableName();
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterat... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20250227.paste.01.mailkey.php | resources/sql/autopatches/20250227.paste.01.mailkey.php | <?php
$paste_table = new PhabricatorPaste();
$paste_conn = $paste_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$paste_conn,
$paste_table->getTableName());
foreach ($iter... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160222.almanac.1.properties.php | resources/sql/autopatches/20160222.almanac.1.properties.php | <?php
$table = new AlmanacProperty();
$conn_w = $table->establishConnection('w');
// We're going to JSON-encode the value in each row: previously rows stored
// plain strings, but now they store JSON, so we need to update them.
foreach (new LiskMigrationIterator($table) as $property) {
$key = $property->getFieldNa... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140325.push.3.groups.php | resources/sql/autopatches/20140325.push.3.groups.php | <?php
$conn_w = id(new PhabricatorRepository())->establishConnection('w');
echo pht('Adding transaction log event groups...')."\n";
$logs = queryfx_all(
$conn_w,
'SELECT * FROM %T GROUP BY transactionKey ORDER BY id ASC',
'repository_pushlog');
foreach ($logs as $log) {
$id = $log['id'];
echo pht('Migratin... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150506.calendarunnamedevents.1.php | resources/sql/autopatches/20150506.calendarunnamedevents.1.php | <?php
echo pht('Retro-naming unnamed events.')."\n";
$table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $event) {
$id = $event->getID();
if (strlen($event->getName()) == 0) {
echo pht('Renaming event %d...'... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170320.reviewers.03.migrate.php | resources/sql/autopatches/20170320.reviewers.03.migrate.php | <?php
$table = new DifferentialRevision();
$diff_table = new DifferentialDiff();
$reviewer_table = new DifferentialReviewer();
$table_name = PhabricatorEdgeConfig::TABLE_NAME_EDGE;
$data_name = PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA;
$conn = $table->establishConnection('w');
// Previously "DifferentialRevisionH... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20210802.legalpad_document_signature.02.phid-populate.php | resources/sql/autopatches/20210802.legalpad_document_signature.02.phid-populate.php | <?php
$phid_type = PhabricatorLegalpadDocumentSignaturePHIDType::TYPECONST;
$docsig_table = new LegalpadDocumentSignature();
$conn = $docsig_table->establishConnection('w');
$table_name = $docsig_table->getTableName();
$chunk_size = 4096;
$temporary_table = 'tmp_20210802_docsig_id_map';
try {
queryfx(
$conn... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20210316.almanac.11.network-mailkey.php | resources/sql/autopatches/20210316.almanac.11.network-mailkey.php | <?php
$network_table = new AlmanacNetwork();
$network_conn = $network_table->establishConnection('w');
$properties_table = new PhabricatorMetaMTAMailProperties();
$conn = $properties_table->establishConnection('w');
$iterator = new LiskRawMigrationIterator(
$network_conn,
$network_table->getTableName());
foreac... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20180418.alamanc.interface.unique.php | resources/sql/autopatches/20180418.alamanc.interface.unique.php | <?php
$interface_table = new AlmanacInterface();
$binding_table = new AlmanacBinding();
$interface_conn = $interface_table->establishConnection('w');
queryfx(
$interface_conn,
'LOCK TABLES %T WRITE, %T WRITE',
$interface_table->getTableName(),
$binding_table->getTableName());
$seen = array();
foreach (new Li... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20171101.diff.02.populate.php | resources/sql/autopatches/20171101.diff.02.populate.php | <?php
$table = new DifferentialRevision();
$conn = $table->establishConnection('w');
$diff_table = new DifferentialDiff();
foreach (new LiskMigrationIterator($table) as $revision) {
$revision_id = $revision->getID();
$diff_row = queryfx_one(
$conn,
'SELECT phid FROM %T WHERE revisionID = %d ORDER BY id D... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20190215.daemons.01.dropdataid.php | resources/sql/autopatches/20190215.daemons.01.dropdataid.php | <?php
// See T6615. We're about to change the nullability on the "dataID" column,
// but it may have a UNIQUE KEY on it. Make sure we get rid of this key first
// so we don't run into trouble.
// There's no "IF EXISTS" modifier for "ALTER TABLE" so run this as a PHP patch
// instead of an SQL patch.
$table = new Pha... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20151130.phurl.mailkey.2.php | resources/sql/autopatches/20151130.phurl.mailkey.2.php | <?php
$table = new PhabricatorPhurlURL();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $url) {
$id = $url->getID();
echo pht('Adding mail key for Phurl %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s WHERE id =... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20180809.repo_identities.activity.php | resources/sql/autopatches/20180809.repo_identities.activity.php | <?php
// Advise installs to rebuild the repository identities.
// If the install has no commits (or no commits that lack an
// authorIdentityPHID), don't require a rebuild.
$commits = id(new PhabricatorRepositoryCommit())
->loadAllWhere('authorIdentityPHID IS NULL LIMIT 1');
if (!$commits) {
return;
}
try {
i... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160824.repohint.02.movebad.php | resources/sql/autopatches/20160824.repohint.02.movebad.php | <?php
$table = new PhabricatorRepositoryCommit();
$conn = $table->establishConnection('w');
$rows = queryfx_all(
$conn,
'SELECT fullCommitName FROM repository_badcommit');
$viewer = PhabricatorUser::getOmnipotentUser();
foreach ($rows as $row) {
$identifier = $row['fullCommitName'];
$commit = id(new Diffus... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170811.differential.01.status.php | resources/sql/autopatches/20170811.differential.01.status.php | <?php
// Migrate saved Differential revision queries from using a "<select />"
// control with hard-coded status groups for status selection to using a
// tokenizer with status functions.
$table = new PhabricatorSavedQuery();
$conn = $table->establishConnection('w');
$status_map = array(
'status-open' => array('op... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160221.almanac.4.servicei.php | resources/sql/autopatches/20160221.almanac.4.servicei.php | <?php
// This was an old reindexing migration that has been obsoleted. See T13253.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160122.project.1.boarddefault.php | resources/sql/autopatches/20160122.project.1.boarddefault.php | <?php
// Populate the newish `hasWorkboard` column for projects with workboard.
// Set the default menu item to "Workboard" for projects which used to have
// that default.
$project_table = new PhabricatorProject();
$conn_w = $project_table->establishConnection('w');
$panel_table = id(new PhabricatorProfileMenuItemC... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20161212.dashboardpanel.02.author.php | resources/sql/autopatches/20161212.dashboardpanel.02.author.php | <?php
// Set authorPHID on Dashboard Panels
//
$table = new PhabricatorDashboardPanel();
$conn_w = $table->establishConnection('w');
$txn_table = new PhabricatorDashboardPanelTransaction();
$txn_conn = $table->establishConnection('r');
echo pht("Building Dashboard Panel authorPHIDs...\n");
foreach (new LiskMigratio... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20160715.event.03.allday.php | resources/sql/autopatches/20160715.event.03.allday.php | <?php
// This migration was replaced by "20161004.cal.01.noepoch.php".
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150622.metamta.2.phid-mig.php | resources/sql/autopatches/20150622.metamta.2.phid-mig.php | <?php
$table = new PhabricatorMetaMTAMail();
$conn_w = $table->establishConnection('w');
echo pht('Assigning PHIDs to mails...')."\n";
foreach (new LiskMigrationIterator($table) as $mail) {
$id = $mail->getID();
echo pht('Updating mail %d...', $id)."\n";
if ($mail->getPHID()) {
continue;
}
queryfx(
... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20190207.packages.04.xactions.php | resources/sql/autopatches/20190207.packages.04.xactions.php | <?php
$table = new PhabricatorOwnersPackageTransaction();
$conn = $table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
// Migrate "Auditing State" transactions for Owners Packages from old values
// (which were "0" or "1", as JSON integer literals, without quotes)... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20141113.auditdupes.php | resources/sql/autopatches/20141113.auditdupes.php | <?php
$table = new PhabricatorRepositoryAuditRequest();
$conn_w = $table->establishConnection('w');
echo pht('Removing duplicate Audit requests...')."\n";
$seen_audit_map = array();
foreach (new LiskMigrationIterator($table) as $request) {
$commit_phid = $request->getCommitPHID();
$auditor_phid = $request->getAud... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20170131.dashboard.personal.01.php | resources/sql/autopatches/20170131.dashboard.personal.01.php | <?php
$table = new PhabricatorDashboard();
$conn = $table->establishConnection('r');
$table_name = 'dashboard_install';
$search_table = new PhabricatorProfileMenuItemConfiguration();
$search_conn = $search_table->establishConnection('w');
$search_table_name = 'search_profilepanelconfiguration';
$viewer = Phabricator... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20150725.badges.mailkey.2.php | resources/sql/autopatches/20150725.badges.mailkey.2.php | <?php
$table = new PhabricatorBadgesBadge();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $badge) {
$id = $badge->getID();
echo pht('Adding mail key for badge %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s WHE... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140722.audit.4.migtext.php | resources/sql/autopatches/20140722.audit.4.migtext.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 comment text to modern st... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/autopatches/20140914.betaproto.php | resources/sql/autopatches/20140914.betaproto.php | <?php
$old_key = 'phabricator.show-beta-applications';
$new_key = 'phabricator.show-prototypes';
echo pht("Migrating '%s' to '%s'...", $old_key, $new_key)."\n";
if (PhabricatorEnv::getEnvConfig($new_key)) {
echo pht('Skipping migration, new data is already set.')."\n";
return;
}
$old = PhabricatorEnv::getEnvCon... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130913.maniphest.1.migratesearch.php | resources/sql/patches/20130913.maniphest.1.migratesearch.php | <?php
// This was a complex migration that modernized old search queries. It was
// removed after giving installs a year to perform it because it would be
// unreasonably complex to maintain and users can easily recreate queries.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20131004.dxreviewers.php | resources/sql/patches/20131004.dxreviewers.php | <?php
$table = new DifferentialRevision();
$conn_w = $table->establishConnection('w');
// NOTE: We migrate by revision because the relationship table doesn't have
// an "id" column.
foreach (new LiskMigrationIterator($table) as $revision) {
$revision_id = $revision->getID();
$revision_phid = $revision->getPHID()... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/059.engines.php | resources/sql/patches/059.engines.php | <?php
$conn = $schema_conn;
$tables = queryfx_all(
$conn,
"SELECT TABLE_SCHEMA db, TABLE_NAME tbl
FROM information_schema.TABLES s
WHERE s.TABLE_SCHEMA LIKE %>
AND s.TABLE_NAME != 'search_documentfield'
AND s.ENGINE != 'InnoDB'",
'{$NAMESPACE}_');
if (!$tables) {
return;
}
echo pht(
"The... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20131118.ownerorder.php | resources/sql/patches/20131118.ownerorder.php | <?php
$table = new ManiphestTask();
$conn_w = $table->establishConnection('w');
$user_table = new PhabricatorUser();
$user_conn = $user_table->establishConnection('r');
foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID();
echo pht('Checking task %s...', "T{$id}")."\n";
$owner_phid = $t... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130915.maniphestmigrate.php | resources/sql/patches/20130915.maniphestmigrate.php | <?php
$conn_w = id(new ManiphestTask())->establishConnection('w');
$table_name = id(new ManiphestCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'maniphest_taskauxiliarystorage');
echo pht('Migrating custom storage for Maniphest fields...')."\n";
foreach ($rows as $row) {
$phid... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130805.pastemailkeypop.php | resources/sql/patches/20130805.pastemailkeypop.php | <?php
echo pht('Populating pastes with mail keys...')."\n";
$table = new PhabricatorPaste();
$table->openTransaction();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $paste) {
$id = $paste->getID();
echo "P{$id}: ";
if (!$paste->getMailKey()) {
queryfx(
$c... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130801.pastexactions.php | resources/sql/patches/20130801.pastexactions.php | <?php
// Long ago, this migration populated initial "create" transactions for old
// pastes from before transactions came into existence. It was removed after
// about three years.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130502.countdownrevamp2.php | resources/sql/patches/20130502.countdownrevamp2.php | <?php
echo pht('Giving countdowns PHIDs');
$table = new PhabricatorCountdown();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $countdown) {
if ($countdown->getPHID()) {
continue;
}
echo '.';
queryfx(
$countdown->establishConnection('w'),
'UPDATE %T SET phid = %s WHERE ... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/legalpad-mailkey-populate.php | resources/sql/patches/legalpad-mailkey-populate.php | <?php
echo pht('Populating Legalpad Documents with mail keys...')."\n";
$table = new LegalpadDocument();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $document) {
$id = $document->getID();
echo pht('Document %s: ', $id);
if (!$document->getMailKey()) {
queryfx(
$document->... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130802.heraldphids.php | resources/sql/patches/20130802.heraldphids.php | <?php
$table = new HeraldRule();
$conn_w = $table->establishConnection('w');
echo pht('Assigning PHIDs to Herald Rules...')."\n";
foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
$id = $rule->getID();
echo pht('Rule %d.', $id)."\n";
if ($rule->getPHID()) {
continue;
}
queryfx(
$co... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130820.file-mailkey-populate.php | resources/sql/patches/20130820.file-mailkey-populate.php | <?php
echo pht('Populating files with mail keys...')."\n";
$table = new PhabricatorFile();
$table_name = $table->getTableName();
$conn_w = $table->establishConnection('w');
$conn_w->openTransaction();
$sql = array();
foreach (new LiskRawMigrationIterator($conn_w, 'file') as $row) {
// NOTE: MySQL requires that th... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130508.releephtransactionsmig.php | resources/sql/patches/20130508.releephtransactionsmig.php | <?php
// Previously, this migrated ReleephRequestEvents into ApplicationTransactions.
// Only Facebook ever generated meaningful ReleephRequestEvent data, and has
// already migrated, so this was cleaned up when ReleephRequestEvent was
// removed.
echo pht('(This migration is obsolete.)')."\n";
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/migrate-project-edges.php | resources/sql/patches/migrate-project-edges.php | <?php
echo pht('Migrating project members to edges...')."\n";
$table = new PhabricatorProject();
$table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $proj) {
$id = $proj->getID();
echo pht('Project %d: ', $id);
$members = queryfx_all(
$proj->establishConnection('w'),
'SELECT... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/emailtableport.php | resources/sql/patches/emailtableport.php | <?php
echo pht('Migrating user emails...')."\n";
$table = new PhabricatorUser();
$table->openTransaction();
$conn = $table->establishConnection('w');
$emails = queryfx_all(
$conn,
'SELECT phid, email FROM %T LOCK IN SHARE MODE',
$table->getTableName());
$emails = ipull($emails, 'email', 'phid');
$etable = ... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130507.releephrqmailkeypop.php | resources/sql/patches/20130507.releephrqmailkeypop.php | <?php
echo pht('Populating Releeph requests with mail keys...')."\n";
$table = new ReleephRequest();
$table->openTransaction();
// From ponder-mailkey-populate.php...
foreach (new LiskMigrationIterator($table) as $rq) {
$id = $rq->getID();
echo "RQ{$id}: ";
if (!$rq->getMailKey()) {
queryfx(
$rq->es... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130728.ponderunique.php | resources/sql/patches/20130728.ponderunique.php | <?php
$map = array();
echo pht('Merging duplicate answers by authors...')."\n";
$atable = new PonderAnswer();
$conn_w = $atable->establishConnection('w');
$conn_w->openTransaction();
$answers = new LiskMigrationIterator(new PonderAnswer());
foreach ($answers as $answer) {
$aid = $answer->getID();
$qid = $answer... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130218.updatechannelid.php | resources/sql/patches/20130218.updatechannelid.php | <?php
/* This file is intentionally left empty, see T15126 */
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130728.ponderxcomment.php | resources/sql/patches/20130728.ponderxcomment.php | <?php
$qtable = new PonderQuestionTransaction();
$atable = new PonderAnswerTransaction();
$conn_w = $qtable->establishConnection('w');
$conn_w->openTransaction();
echo pht('Migrating Ponder comments to %s...', 'ApplicationTransactions')."\n";
$rows = new LiskRawMigrationIterator($conn_w, 'ponder_comment');
foreach ... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130621.diffcommentphidmig.php | resources/sql/patches/20130621.diffcommentphidmig.php | <?php
// This patch is unnecessary and was nuked.
| php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/liskcounters.php | resources/sql/patches/liskcounters.php | <?php
// Switch PhabricatorWorkerActiveTask from auto-increment IDs to counter IDs.
// Set the initial counter ID to be larger than any known task ID.
$active_table = new PhabricatorWorkerActiveTask();
$archive_table = new PhabricatorWorkerArchiveTask();
$old_table = 'worker_task';
$conn_w = $active_table->establis... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130711.pholioimageobsolete.php | resources/sql/patches/20130711.pholioimageobsolete.php | <?php
echo pht('Giving Pholio images PHIDs');
$table = new PholioImage();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $image) {
if ($image->getPHID()) {
continue;
}
echo '.';
queryfx(
$image->establishConnection('w'),
'UPDATE %T SET phid = %s WHERE id = %d',
$ima... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130530.sessionhash.php | resources/sql/patches/20130530.sessionhash.php | <?php
// See T13225. Long ago, this upgraded session key storage from unhashed to
// HMAC-SHA1 here. We later upgraded storage to HMAC-SHA256, so this is initial
// upgrade is now fairly pointless. Dropping this migration entirely only logs
// users out of installs that waited more than 5 years to upgrade, which seems... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130716.archivememberlessprojects.php | resources/sql/patches/20130716.archivememberlessprojects.php | <?php
echo pht('Archiving projects with no members...')."\n";
$table = new PhabricatorProject();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $project) {
$members = PhabricatorEdgeQuery::loadDestinationPHIDs(
$project->getPHID(),
PhabricatorProjectProjectHasMemberEdgeType::EDGEC... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20131112.userverified.2.mig.php | resources/sql/patches/20131112.userverified.2.mig.php | <?php
$table = new PhabricatorUser();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $user) {
$username = $user->getUsername();
echo pht('Migrating %s...', $username)."\n";
if ($user->getIsEmailVerified()) {
// Email already verified.
continue;
}
$primary ... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130409.commitdrev.php | resources/sql/patches/20130409.commitdrev.php | <?php
echo pht('Migrating %s to edges...', 'differential.revisionPHID')."\n";
$commit_table = new PhabricatorRepositoryCommit();
$data_table = new PhabricatorRepositoryCommitData();
$editor = new PhabricatorEdgeEditor();
$commit_table->establishConnection('w');
$edges = 0;
foreach (new LiskMigrationIterator($commit_t... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20131106.diffphid.2.mig.php | resources/sql/patches/20131106.diffphid.2.mig.php | <?php
$diff_table = new DifferentialDiff();
$conn_w = $diff_table->establishConnection('w');
$size = 1000;
$row_iter = id(new LiskMigrationIterator($diff_table))->setPageSize($size);
$chunk_iter = new PhutilChunkedIterator($row_iter, $size);
foreach ($chunk_iter as $chunk) {
$sql = array();
foreach ($chunk as ... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
phorgeit/phorge | https://github.com/phorgeit/phorge/blob/aceebaa4305332265a371282a841609fe926b819/resources/sql/patches/20130703.legalpaddocdenorm.php | resources/sql/patches/20130703.legalpaddocdenorm.php | <?php
echo pht(
"Populating Legalpad Documents with titles, %s, and %s...\n",
'recentContributorPHIDs',
'contributorCounts');
$table = new LegalpadDocument();
$table->openTransaction();
foreach (new LiskMigrationIterator($table) as $document) {
$updated = false;
$id = $document->getID();
echo pht('Docume... | php | Apache-2.0 | aceebaa4305332265a371282a841609fe926b819 | 2026-01-05T04:21:50.722734Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.