1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00
phorge-phorge/resources/sql/autopatches/20140731.cancdn.php

21 lines
453 B
PHP
Raw Normal View History

<?php
$table = new PhabricatorFile();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $file) {
$id = $file->getID();
echo "Updating flags for file {$id}...\n";
$meta = $file->getMetadata();
if (!idx($meta, 'canCDN')) {
$meta['canCDN'] = true;
queryfx(
$conn_w,
'UPDATE %T SET metadata = %s WHERE id = %d',
$table->getTableName(),
json_encode($meta),
$id);
}
}