mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
50f4adef64
Summary: Depends on D19619. Ref T13065. Ref T13077. Migrate Phriction mail keys to the new infrastructure and drop the column. Test Plan: Ran migrations, spot-checked the database. Reviewers: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13077, T13065 Differential Revision: https://secure.phabricator.com/D19620
26 lines
739 B
PHP
26 lines
739 B
PHP
<?php
|
|
|
|
$document_table = new PhrictionDocument();
|
|
$document_conn = $document_table->establishConnection('w');
|
|
$document_name = $document_table->getTableName();
|
|
|
|
$properties_table = new PhabricatorMetaMTAMailProperties();
|
|
$conn = $properties_table->establishConnection('w');
|
|
|
|
$iterator = new LiskRawMigrationIterator($document_conn, $document_name);
|
|
foreach ($iterator as $row) {
|
|
queryfx(
|
|
$conn,
|
|
'INSERT IGNORE INTO %T
|
|
(objectPHID, mailProperties, dateCreated, dateModified)
|
|
VALUES
|
|
(%s, %s, %d, %d)',
|
|
$properties_table->getTableName(),
|
|
$row['phid'],
|
|
phutil_json_encode(
|
|
array(
|
|
'mailKey' => $row['mailKey'],
|
|
)),
|
|
PhabricatorTime::getNow(),
|
|
PhabricatorTime::getNow());
|
|
}
|