Correctly implementing mailkey for Phurl

Summary: Re T6049, Correctly implementing mailkey for Phurl

Test Plan: Edit Phurl URL, receive email.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14605
This commit is contained in:
lkassianik
2015-11-30 06:44:03 -08:00
parent 9d59086d01
commit 47a5ebb4fe
5 changed files with 34 additions and 7 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_phurl.phurl_url
ADD mailKey binary(20) NOT NULL;

View File

@@ -0,0 +1,18 @@
<?php
$table = new PhabricatorPhurlURL();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $url) {
$id = $url->getID();
echo pht('Adding mail key for Phurl %d...', $id);
echo "\n";
queryfx(
$conn_w,
'UPDATE %T SET mailKey = %s WHERE id = %d',
$table->getTableName(),
Filesystem::readRandomCharacters(20),
$id);
}