mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
25 lines
562 B
PHP
25 lines
562 B
PHP
|
<?php
|
||
|
|
||
|
// Populate account passwords (which we copied from the user table in the last
|
||
|
// migration) with new PHIDs.
|
||
|
|
||
|
$table = new PhabricatorAuthPassword();
|
||
|
$conn = $table->establishConnection('w');
|
||
|
|
||
|
$password_type = PhabricatorAuthPasswordPHIDType::TYPECONST;
|
||
|
|
||
|
foreach (new LiskMigrationIterator($table) as $row) {
|
||
|
if (phid_get_type($row->getPHID()) == $password_type) {
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
$new_phid = $row->generatePHID();
|
||
|
|
||
|
queryfx(
|
||
|
$conn,
|
||
|
'UPDATE %T SET phid = %s WHERE id = %d',
|
||
|
$table->getTableName(),
|
||
|
$new_phid,
|
||
|
$row->getID());
|
||
|
}
|