mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
4e7b5defc3
Summary: Ref T3846. Adds mailkey generation and migration. Test Plan: Ran the migration, see keys in mysql. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T3846 Differential Revision: https://secure.phabricator.com/D13785
18 lines
408 B
PHP
18 lines
408 B
PHP
<?php
|
|
|
|
$table = new PonderAnswer();
|
|
$conn_w = $table->establishConnection('w');
|
|
$iterator = new LiskMigrationIterator($table);
|
|
foreach ($iterator as $answer) {
|
|
$id = $answer->getID();
|
|
|
|
echo pht('Adding mail key for Answer %d...', $id);
|
|
echo "\n";
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET mailKey = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
Filesystem::readRandomCharacters(20),
|
|
$id);
|
|
}
|