Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98045171
20180830.phriction.02.maxes.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
Thu, Jan 9, 00:58
Size
701 B
Mime Type
text/x-php
Expires
Sat, Jan 11, 00:58 (1 d, 9 h)
Engine
blob
Format
Raw Data
Handle
23501661
Attached To
rPH Phabricator
20180830.phriction.02.maxes.php
View Options
<?php
// Populate the "maxVersion" column by copying the maximum "version" from the
// content table.
$document_table
=
new
PhrictionDocument
();
$content_table
=
new
PhrictionContent
();
$conn
=
$document_table
->
establishConnection
(
'w'
);
$iterator
=
new
LiskRawMigrationIterator
(
$conn
,
$document_table
->
getTableName
());
foreach
(
$iterator
as
$row
)
{
$content
=
queryfx_one
(
$conn
,
'SELECT MAX(version) max FROM %T WHERE documentPHID = %s'
,
$content_table
->
getTableName
(),
$row
[
'phid'
]);
if
(!
$content
)
{
continue
;
}
queryfx
(
$conn
,
'UPDATE %T SET maxVersion = %d WHERE id = %d'
,
$document_table
->
getTableName
(),
$content
[
'max'
],
$row
[
'id'
]);
}
Event Timeline
Log In to Comment