1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 02:42:40 +01:00
phorge-phorge/resources/sql/autopatches/20150804.ponder.answer.mailkey.2.php
Chad Little 4e7b5defc3 Add mailKeys to Ponder Answer
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
2015-08-04 10:49:15 -07:00

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);
}