1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 17:30:59 +01:00
phorge-phorge/resources/sql/autopatches/20180306.opath.02.digestpopulate.php

20 lines
402 B
PHP
Raw Normal View History

<?php
$table = new PhabricatorOwnersPath();
$conn = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $path) {
$index = PhabricatorHash::digestForIndex($path->getPath());
if ($index === $path->getPathIndex()) {
continue;
}
queryfx(
$conn,
'UPDATE %T SET pathIndex = %s WHERE id = %d',
$table->getTableName(),
$index,
$path->getID());
}