Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F973070
20180830.phriction.02.maxes.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
701 B
Referenced Files
None
Subscribers
None
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'
]);
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 6:36 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
232079
Default Alt Text
20180830.phriction.02.maxes.php (701 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment