Add mail/feed support to PhamePost

Summary: Allows feed stories and mail for new Phame Posts.

Test Plan: Write Post, Get Mail

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14426
This commit is contained in:
Chad Little
2015-11-06 17:40:13 -08:00
parent 80f1d01602
commit 6fe2377cc2
8 changed files with 169 additions and 14 deletions

View File

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

View File

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