mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 19:02:41 +01:00
fadb2bd52b
Summary: Ref T13641. Ref T13065. Migrate and drop the onboard "mailKey" column for Almanac Services. Test Plan: Ran storage migration, got clean report, saw migrated value in mail properties table. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13641, T13065 Differential Revision: https://secure.phabricator.com/D21629
28 lines
688 B
PHP
28 lines
688 B
PHP
<?php
|
|
|
|
$service_table = new AlmanacService();
|
|
$service_conn = $service_table->establishConnection('w');
|
|
|
|
$properties_table = new PhabricatorMetaMTAMailProperties();
|
|
$conn = $properties_table->establishConnection('w');
|
|
|
|
$iterator = new LiskRawMigrationIterator(
|
|
$service_conn,
|
|
$service_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());
|
|
}
|