mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-29 17:00:59 +01:00
89dcf9792a
Summary: Ref T13444. To interact meaningfully with "DestructionEngine", objects need a PHID. The "UserEmail" object currently does not have one (or a real "Query"). Provide basic PHID support so "DestructionEngine" can interact with the object more powerfully. Test Plan: - Ran migrations, checked data in database, saw sensible PHIDs assigned. - Added a new email address to my account, saw it get a PHID. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13444 Differential Revision: https://secure.phabricator.com/D20913
18 lines
381 B
PHP
18 lines
381 B
PHP
<?php
|
|
|
|
$table = new PhabricatorUserEmail();
|
|
$conn = $table->establishConnection('w');
|
|
|
|
$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
|
|
foreach ($iterator as $row) {
|
|
$phid = $row['phid'];
|
|
|
|
if (!strlen($phid)) {
|
|
queryfx(
|
|
$conn,
|
|
'UPDATE %R SET phid = %s WHERE id = %d',
|
|
$table,
|
|
$table->generatePHID(),
|
|
$row['id']);
|
|
}
|
|
}
|