@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Force hunk storage migration to the modern format

Summary:
Ref T8475. This forces installs to migrate hunks to the modern format.

We stopped writing to the legacy format a very long time ago (2+ years?) without issues.

This doesn't destroy any data. T8623 has guidance and I'll publish more changelog guidance.

Test Plan: Faked some legacy data and migrated it.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8475

Differential Revision: https://secure.phabricator.com/D17039

+38
+38
resources/sql/autopatches/20161213.diff.01.hunks.php
··· 1 + <?php 2 + 3 + $conn = id(new DifferentialRevision())->establishConnection('w'); 4 + $src_table = 'differential_hunk'; 5 + $dst_table = 'differential_hunk_modern'; 6 + 7 + echo tsprintf( 8 + "%s\n", 9 + pht('Migrating old hunks...')); 10 + 11 + foreach (new LiskRawMigrationIterator($conn, $src_table) as $row) { 12 + queryfx( 13 + $conn, 14 + 'INSERT INTO %T 15 + (changesetID, oldOffset, oldLen, newOffset, newLen, 16 + dataType, dataEncoding, dataFormat, data, 17 + dateCreated, dateModified) 18 + VALUES 19 + (%d, %d, %d, %d, %d, 20 + %s, %s, %s, %s, 21 + %d, %d)', 22 + $dst_table, 23 + $row['changesetID'], 24 + $row['oldOffset'], 25 + $row['oldLen'], 26 + $row['newOffset'], 27 + $row['newLen'], 28 + DifferentialModernHunk::DATATYPE_TEXT, 29 + 'utf8', 30 + DifferentialModernHunk::DATAFORMAT_RAW, 31 + $row['changes'], 32 + $row['dateCreated'], 33 + $row['dateModified']); 34 + } 35 + 36 + echo tsprintf( 37 + "%s\n", 38 + pht('Done.'));