Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14322538
D17039.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
D17039.diff
View Options
diff --git a/resources/sql/autopatches/20161213.diff.01.hunks.php b/resources/sql/autopatches/20161213.diff.01.hunks.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20161213.diff.01.hunks.php
@@ -0,0 +1,38 @@
+<?php
+
+$conn = id(new DifferentialRevision())->establishConnection('w');
+$src_table = 'differential_hunk';
+$dst_table = 'differential_hunk_modern';
+
+echo tsprintf(
+ "%s\n",
+ pht('Migrating old hunks...'));
+
+foreach (new LiskRawMigrationIterator($conn, $src_table) as $row) {
+ queryfx(
+ $conn,
+ 'INSERT INTO %T
+ (changesetID, oldOffset, oldLen, newOffset, newLen,
+ dataType, dataEncoding, dataFormat, data,
+ dateCreated, dateModified)
+ VALUES
+ (%d, %d, %d, %d, %d,
+ %s, %s, %s, %s,
+ %d, %d)',
+ $dst_table,
+ $row['changesetID'],
+ $row['oldOffset'],
+ $row['oldLen'],
+ $row['newOffset'],
+ $row['newLen'],
+ DifferentialModernHunk::DATATYPE_TEXT,
+ 'utf8',
+ DifferentialModernHunk::DATAFORMAT_RAW,
+ $row['changes'],
+ $row['dateCreated'],
+ $row['dateModified']);
+}
+
+echo tsprintf(
+ "%s\n",
+ pht('Done.'));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 12:49 PM (21 h, 11 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6907408
Default Alt Text
D17039.diff (1 KB)
Attached To
Mode
D17039: Force hunk storage migration to the modern format
Attached
Detach File
Event Timeline
Log In to Comment