From 8d53f1511565db2aeef0b69c7ea5f7f50339d473 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 27 Jul 2015 15:08:01 -0700 Subject: [PATCH] Put the HeraldActionRecord table back on the shelf Summary: Fixes T8958. I renamed this class and table (in D13644), but the migration `20150606.mlist.1.php` needs to load records from the table before the table rename applies. Put the table back and accept a tiny bit of cruft here to fix this problem. We can no-op the migration after a while. I'll cherry-pick this to `stable`. Test Plan: Applied migration. Created Herald rules. Reviewed existing Herald rules. Reviewers: btrahan Subscribers: epriestley Maniphest Tasks: T8958 Differential Revision: https://secure.phabricator.com/D13736 --- resources/sql/autopatches/20150727.heraldaction.1.sql | 2 ++ src/applications/herald/storage/HeraldActionRecord.php | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 resources/sql/autopatches/20150727.heraldaction.1.sql diff --git a/resources/sql/autopatches/20150727.heraldaction.1.sql b/resources/sql/autopatches/20150727.heraldaction.1.sql new file mode 100644 index 0000000000..f4cbf19504 --- /dev/null +++ b/resources/sql/autopatches/20150727.heraldaction.1.sql @@ -0,0 +1,2 @@ +RENAME TABLE {$NAMESPACE}_herald.herald_actionrecord + TO {$NAMESPACE}_herald.herald_action; diff --git a/src/applications/herald/storage/HeraldActionRecord.php b/src/applications/herald/storage/HeraldActionRecord.php index 1ad4721b21..dfbee3b79d 100644 --- a/src/applications/herald/storage/HeraldActionRecord.php +++ b/src/applications/herald/storage/HeraldActionRecord.php @@ -7,6 +7,14 @@ final class HeraldActionRecord extends HeraldDAO { protected $action; protected $target; + public function getTableName() { + // TODO: This class was renamed, but we have a migration which affects the + // table prior to to the rename. For now, having cruft here is cleaner than + // having it in the migration. We could rename this table again and no-op + // the migration after some time. See T8958. + return 'herald_action'; + } + protected function getConfiguration() { return array( self::CONFIG_SERIALIZATION => array(