mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-09 16:32:39 +01:00
b256f2d7b2
Summary: Ref T4103. This give preferences a PHID, policy/transaction interfaces, a transaction table, and a Query class. This doesn't actually change how they're edited, yet. Test Plan: - Ran migrations. - Inspected database for date created, date modified, PHIDs. - Changed some of my preferences. - Deleted a user's preferences, verified they reset properly. - Set some preferences as a new user, got a new row. - Destroyed a user, verified their preferences were destroyed. - Sent Conpherence messages. - Send mail. - Tried to edit another user's settings. - Tried to edit a bot's settings as a non-admin. - Edited a bot's settings as an admin (technically, none of the editable settings are actually stored in the settings table, currently). Reviewers: chad Reviewed By: chad Maniphest Tasks: T4103 Differential Revision: https://secure.phabricator.com/D15991
17 lines
347 B
PHP
17 lines
347 B
PHP
<?php
|
|
|
|
$table = new PhabricatorUserPreferences();
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
foreach (new LiskMigrationIterator($table) as $row) {
|
|
if ($row->getPHID() !== '') {
|
|
continue;
|
|
}
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET phid = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
$table->generatePHID(),
|
|
$row->getID());
|
|
}
|