Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F69706715
20140325.push.3.groups.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 3, 02:32
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jul 5, 02:32 (2 d)
Engine
blob
Format
Raw Data
Handle
18670142
Attached To
rPH Phabricator
20140325.push.3.groups.php
View Options
<?php
$conn_w
=
id
(
new
PhabricatorRepository
())->
establishConnection
(
'w'
);
echo
"Adding transaction log event groups...
\n
"
;
$logs
=
queryfx_all
(
$conn_w
,
'SELECT * FROM %T GROUP BY transactionKey ORDER BY id ASC'
,
'repository_pushlog'
);
foreach
(
$logs
as
$log
)
{
$id
=
$log
[
'id'
];
echo
"Migrating log {$id}...
\n
"
;
if
(
$log
[
'pushEventPHID'
])
{
continue
;
}
$event_phid
=
id
(
new
PhabricatorRepositoryPushEvent
())->
generatePHID
();
queryfx
(
$conn_w
,
'INSERT INTO %T (phid, repositoryPHID, epoch, pusherPHID, remoteAddress,
remoteProtocol, rejectCode, rejectDetails)
VALUES (%s, %s, %d, %s, %d, %s, %d, %s)'
,
'repository_pushevent'
,
$event_phid
,
$log
[
'repositoryPHID'
],
$log
[
'epoch'
],
$log
[
'pusherPHID'
],
$log
[
'remoteAddress'
],
$log
[
'remoteProtocol'
],
$log
[
'rejectCode'
],
$log
[
'rejectDetails'
]);
queryfx
(
$conn_w
,
'UPDATE %T SET pushEventPHID = %s WHERE transactionKey = %s'
,
'repository_pushlog'
,
$event_phid
,
$log
[
'transactionKey'
]);
}
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment