Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13963251
D15340.id36994.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
805 B
Referenced Files
None
Subscribers
None
D15340.id36994.diff
View Options
diff --git a/resources/sql/autopatches/20160223.paste.fileedges.php b/resources/sql/autopatches/20160223.paste.fileedges.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160223.paste.fileedges.php
@@ -0,0 +1,21 @@
+<?php
+
+// For a while in November 2015, attachment edges between pastes and their
+// underlying file data were not written correctly. This restores edges for
+// any missing pastes.
+
+$table = new PhabricatorPaste();
+$edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
+
+foreach (new LiskMigrationIterator($table) as $paste) {
+ $paste_phid = $paste->getPHID();
+ $file_phid = $paste->getFilePHID();
+
+ if (!$file_phid) {
+ continue;
+ }
+
+ id(new PhabricatorEdgeEditor())
+ ->addEdge($paste_phid, $edge_type, $file_phid)
+ ->save();
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 16 2024, 2:51 PM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717889
Default Alt Text
D15340.id36994.diff (805 B)
Attached To
Mode
D15340: Correct an old issue with Paste by restoring the file attachment edge
Attached
Detach File
Event Timeline
Log In to Comment