mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
25 lines
632 B
PHP
25 lines
632 B
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 "Updating capitalization of canCDN property for file {$id}...\n";
|
||
|
$meta = $file->getMetadata();
|
||
|
|
||
|
if (isset($meta['cancdn'])) {
|
||
|
$meta['canCDN'] = $meta['cancdn'];
|
||
|
unset($meta['cancdn']);
|
||
|
|
||
|
queryfx(
|
||
|
$conn_w,
|
||
|
'UPDATE %T SET metadata = %s WHERE id = %d',
|
||
|
$table->getTableName(),
|
||
|
json_encode($meta),
|
||
|
$id);
|
||
|
}
|
||
|
}
|