Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2340728
131.migraterevisionquery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
802 B
Referenced Files
None
Subscribers
None
131.migraterevisionquery.php
View Options
<?php
$table
=
new
DifferentialRevision
();
$table
->
openTransaction
();
$table
->
beginReadLocking
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
echo
'Migrating revisions'
;
do
{
$revisions
=
$table
->
loadAllWhere
(
'branchName IS NULL LIMIT 1000'
);
foreach
(
$revisions
as
$revision
)
{
echo
'.'
;
$diff
=
$revision
->
loadActiveDiff
();
if
(!
$diff
)
{
continue
;
}
$branch_name
=
$diff
->
getBranch
();
$arc_project_phid
=
$diff
->
getArcanistProjectPHID
();
queryfx
(
$conn_w
,
'UPDATE %T SET branchName = %s, arcanistProjectPHID = %s WHERE id = %d'
,
$table
->
getTableName
(),
$branch_name
,
$arc_project_phid
,
$revision
->
getID
());
}
}
while
(
count
(
$revisions
)
==
1000
);
$table
->
endReadLocking
();
$table
->
saveTransaction
();
echo
"
\n
Done.
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 9:28 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
444902
Default Alt Text
131.migraterevisionquery.php (802 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment