Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13981266
D10273.id24754.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10273.id24754.diff
View Options
diff --git a/resources/sql/autopatches/20140815.cancdncase.php b/resources/sql/autopatches/20140815.cancdncase.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20140815.cancdncase.php
@@ -0,0 +1,24 @@
+<?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);
+ }
+}
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -849,11 +849,6 @@
return false;
}
- // TODO: Migrate away this old constant and remove this check.
- if (idx($this->metadata, 'cancdn')) {
- return true;
- }
-
return idx($this->metadata, self::METADATA_CAN_CDN);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 3:22 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736802
Default Alt Text
D10273.id24754.diff (1 KB)
Attached To
Mode
D10273: Migrate "cancdn" to "canCDN" in the database
Attached
Detach File
Event Timeline
Log In to Comment