mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
b1533e5468
Summary: Ref T13682. Ref T13065. Migrate and update "SlowvotePoll" to use more modern mailkey storage (in the mail application, rather than onboard). Also make other minor modernization changes. Test Plan: Created a new poll. Ran migration, verified mail key copied properly in database. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13682, T13065 Differential Revision: https://secure.phabricator.com/D21842
28 lines
682 B
PHP
28 lines
682 B
PHP
<?php
|
|
|
|
$poll_table = new PhabricatorSlowvotePoll();
|
|
$poll_conn = $poll_table->establishConnection('w');
|
|
|
|
$properties_table = new PhabricatorMetaMTAMailProperties();
|
|
$conn = $properties_table->establishConnection('w');
|
|
|
|
$iterator = new LiskRawMigrationIterator(
|
|
$poll_conn,
|
|
$poll_table->getTableName());
|
|
|
|
foreach ($iterator as $row) {
|
|
queryfx(
|
|
$conn,
|
|
'INSERT IGNORE INTO %R
|
|
(objectPHID, mailProperties, dateCreated, dateModified)
|
|
VALUES
|
|
(%s, %s, %d, %d)',
|
|
$properties_table,
|
|
$row['phid'],
|
|
phutil_json_encode(
|
|
array(
|
|
'mailKey' => $row['mailKey'],
|
|
)),
|
|
PhabricatorTime::getNow(),
|
|
PhabricatorTime::getNow());
|
|
}
|