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

Configure Feed

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

Migrate "cancdn" to "canCDN" in the database

Summary: Ref T5884. We migrated with "canCDN" and then had live writes with "cancdn". Move everything to "canCDN" for consistency.

Test Plan: Ran migration, verified DB only has "canCDN" afterward.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5884

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

+24 -5
+24
resources/sql/autopatches/20140815.cancdncase.php
··· 1 + <?php 2 + 3 + // This corrects files which incorrectly had a 'cancdn' property written; 4 + // the property should be 'canCDN'. 5 + 6 + $table = new PhabricatorFile(); 7 + $conn_w = $table->establishConnection('w'); 8 + foreach (new LiskMigrationIterator($table) as $file) { 9 + $id = $file->getID(); 10 + echo "Updating capitalization of canCDN property for file {$id}...\n"; 11 + $meta = $file->getMetadata(); 12 + 13 + if (isset($meta['cancdn'])) { 14 + $meta['canCDN'] = $meta['cancdn']; 15 + unset($meta['cancdn']); 16 + 17 + queryfx( 18 + $conn_w, 19 + 'UPDATE %T SET metadata = %s WHERE id = %d', 20 + $table->getTableName(), 21 + json_encode($meta), 22 + $id); 23 + } 24 + }
-5
src/applications/files/storage/PhabricatorFile.php
··· 849 849 return false; 850 850 } 851 851 852 - // TODO: Migrate away this old constant and remove this check. 853 - if (idx($this->metadata, 'cancdn')) { 854 - return true; 855 - } 856 - 857 852 return idx($this->metadata, self::METADATA_CAN_CDN); 858 853 } 859 854