Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140325.push.3.groups.php
<?php | <?php | ||||
$conn_w = id(new PhabricatorRepository())->establishConnection('w'); | $table = id(new DiffusionRepository()) | ||||
->setApplicationName('repository') | |||||
->setTableName('repository'); | |||||
$conn_w = $table->establishConnection('w'); | |||||
echo pht('Adding transaction log event groups...')."\n"; | echo pht('Adding transaction log event groups...')."\n"; | ||||
$logs = queryfx_all( | $logs = queryfx_all( | ||||
$conn_w, | $conn_w, | ||||
'SELECT * FROM %T GROUP BY transactionKey ORDER BY id ASC', | 'SELECT * FROM %T GROUP BY transactionKey ORDER BY id ASC', | ||||
'repository_pushlog'); | 'repository_pushlog'); | ||||
foreach ($logs as $log) { | foreach ($logs as $log) { | ||||
$id = $log['id']; | $id = $log['id']; | ||||
echo pht('Migrating log %d...', $id)."\n"; | echo pht('Migrating log %d...', $id)."\n"; | ||||
if ($log['pushEventPHID']) { | if ($log['pushEventPHID']) { | ||||
continue; | continue; | ||||
} | } | ||||
$event_phid = id(new PhabricatorRepositoryPushEvent())->generatePHID(); | $event_phid = id(new DiffusionRepositoryPushEvent())->generatePHID(); | ||||
queryfx( | queryfx( | ||||
$conn_w, | $conn_w, | ||||
'INSERT INTO %T (phid, repositoryPHID, epoch, pusherPHID, remoteAddress, | 'INSERT INTO %T (phid, repositoryPHID, epoch, pusherPHID, remoteAddress, | ||||
remoteProtocol, rejectCode, rejectDetails) | remoteProtocol, rejectCode, rejectDetails) | ||||
VALUES (%s, %s, %d, %s, %d, %s, %d, %s)', | VALUES (%s, %s, %d, %s, %d, %s, %d, %s)', | ||||
'repository_pushevent', | 'repository_pushevent', | ||||
$event_phid, | $event_phid, | ||||
Show All 17 Lines |