mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 23:10:57 +01:00
22 lines
492 B
PHP
22 lines
492 B
PHP
|
<?php
|
||
|
|
||
|
echo "Populating Questions with mail keys...\n";
|
||
|
foreach (new LiskMigrationIterator(new PonderQuestion()) as $question) {
|
||
|
$id = $question->getID();
|
||
|
|
||
|
echo "Question {$id}: ";
|
||
|
if (!$question->getMailKey()) {
|
||
|
queryfx(
|
||
|
$question->establishConnection('w'),
|
||
|
'UPDATE %T SET mailKey = %s WHERE id = %d',
|
||
|
$question->getTableName(),
|
||
|
Filesystem::readRandomCharacters(20),
|
||
|
$id);
|
||
|
echo "Generated Key\n";
|
||
|
} else {
|
||
|
echo "-\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
echo "Done.\n";
|