mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
1bf4422c74
Summary: Ref T11015. This supports making path names arbitrarily long and putting a proper unique key on the table. Test Plan: - Migrated, checked database, saw nice digested indexes. - Edited a package, saw new rows update with digested indexes. Maniphest Tasks: T11015 Differential Revision: https://secure.phabricator.com/D19181
19 lines
402 B
PHP
19 lines
402 B
PHP
<?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());
|
|
}
|