2018-09-14 15:24:32 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$commit_table = new PhabricatorRepositoryCommit();
|
|
|
|
$commit_conn = $commit_table->establishConnection('w');
|
|
|
|
$commit_name = $commit_table->getTableName();
|
|
|
|
|
|
|
|
$properties_table = new PhabricatorMetaMTAMailProperties();
|
|
|
|
$conn = $properties_table->establishConnection('w');
|
|
|
|
|
|
|
|
$iterator = new LiskRawMigrationIterator($commit_conn, $commit_name);
|
2018-11-14 18:41:07 +01:00
|
|
|
$chunks = new PhutilChunkedIterator($iterator, 100);
|
|
|
|
foreach ($chunks as $chunk) {
|
|
|
|
$sql = array();
|
|
|
|
foreach ($chunk as $commit) {
|
|
|
|
$sql[] = qsprintf(
|
|
|
|
$conn,
|
|
|
|
'(%s, %s, %d, %d)',
|
|
|
|
$commit['phid'],
|
|
|
|
phutil_json_encode(
|
|
|
|
array(
|
|
|
|
'mailKey' => $commit['mailKey'],
|
|
|
|
)),
|
|
|
|
PhabricatorTime::getNow(),
|
|
|
|
PhabricatorTime::getNow());
|
|
|
|
}
|
|
|
|
|
2018-09-14 15:24:32 +02:00
|
|
|
queryfx(
|
|
|
|
$conn,
|
2018-11-14 18:41:07 +01:00
|
|
|
'INSERT IGNORE INTO %R
|
2018-09-14 15:24:32 +02:00
|
|
|
(objectPHID, mailProperties, dateCreated, dateModified)
|
2018-11-14 18:41:07 +01:00
|
|
|
VALUES %LQ',
|
|
|
|
$properties_table,
|
|
|
|
$sql);
|
2018-09-14 15:24:32 +02:00
|
|
|
}
|