2016-12-13 19:01:41 +01:00
|
|
|
<?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'],
|
2018-02-10 21:04:42 +01:00
|
|
|
DifferentialHunk::DATATYPE_TEXT,
|
2016-12-13 19:01:41 +01:00
|
|
|
'utf8',
|
2018-02-10 21:04:42 +01:00
|
|
|
DifferentialHunk::DATAFORMAT_RAW,
|
2017-01-10 20:53:14 +01:00
|
|
|
// In rare cases, this could be NULL. See T12090.
|
|
|
|
(string)$row['changes'],
|
2016-12-13 19:01:41 +01:00
|
|
|
$row['dateCreated'],
|
|
|
|
$row['dateModified']);
|
|
|
|
}
|
|
|
|
|
|
|
|
echo tsprintf(
|
|
|
|
"%s\n",
|
|
|
|
pht('Done.'));
|