mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 15:22:41 +01:00
25 lines
571 B
PHP
25 lines
571 B
PHP
|
<?php
|
||
|
|
||
|
$table = new DifferentialRevision();
|
||
|
$conn = $table->establishConnection('w');
|
||
|
$diff_table = new DifferentialDiff();
|
||
|
|
||
|
foreach (new LiskMigrationIterator($table) as $revision) {
|
||
|
$revision_id = $revision->getID();
|
||
|
|
||
|
$diff_row = queryfx_one(
|
||
|
$conn,
|
||
|
'SELECT phid FROM %T WHERE revisionID = %d ORDER BY id DESC LIMIT 1',
|
||
|
$diff_table->getTableName(),
|
||
|
$revision_id);
|
||
|
|
||
|
if ($diff_row) {
|
||
|
queryfx(
|
||
|
$conn,
|
||
|
'UPDATE %T SET activeDiffPHID = %s WHERE id = %d',
|
||
|
$table->getTableName(),
|
||
|
$diff_row['phid'],
|
||
|
$revision_id);
|
||
|
}
|
||
|
}
|