mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 11:30:55 +01:00
f43d08c2bb
Summary: Depends on D19056. Fixes T8475. Ref T13054. Merges "ModernHunk" back into "Hunk". Test Plan: Grepped for `modernhunk`. Reviewed revisions. Created a new revision. Used `bin/differential migrate-hunk` to migrate hunks between storage formats and back. Maniphest Tasks: T13054, T8475 Differential Revision: https://secure.phabricator.com/D19057
39 lines
938 B
PHP
39 lines
938 B
PHP
<?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'],
|
|
DifferentialHunk::DATATYPE_TEXT,
|
|
'utf8',
|
|
DifferentialHunk::DATAFORMAT_RAW,
|
|
// In rare cases, this could be NULL. See T12090.
|
|
(string)$row['changes'],
|
|
$row['dateCreated'],
|
|
$row['dateModified']);
|
|
}
|
|
|
|
echo tsprintf(
|
|
"%s\n",
|
|
pht('Done.'));
|