Page MenuHomePhabricator

D14468.diff
No OneTemporary

D14468.diff

diff --git a/resources/sql/autopatches/20151112.herald.edge.sql b/resources/sql/autopatches/20151112.herald.edge.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20151112.herald.edge.sql
@@ -0,0 +1,16 @@
+CREATE TABLE {$NAMESPACE}_herald.edge (
+ src VARBINARY(64) NOT NULL,
+ type INT UNSIGNED NOT NULL,
+ dst VARBINARY(64) NOT NULL,
+ dateCreated INT UNSIGNED NOT NULL,
+ seq INT UNSIGNED NOT NULL,
+ dataID INT UNSIGNED,
+ PRIMARY KEY (src, type, dst),
+ KEY `src` (src, type, dateCreated, seq),
+ UNIQUE KEY `key_dst` (dst, type, src)
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+
+CREATE TABLE {$NAMESPACE}_herald.edgedata (
+ id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ data LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -5073,6 +5073,7 @@
'PhabricatorFlaggableInterface',
'PhabricatorPolicyInterface',
'PhabricatorDestructibleInterface',
+ 'PhabricatorSubscribableInterface',
),
'HeraldRuleController' => 'HeraldController',
'HeraldRuleEditor' => 'PhabricatorApplicationTransactionEditor',
diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php
--- a/src/applications/herald/storage/HeraldRule.php
+++ b/src/applications/herald/storage/HeraldRule.php
@@ -5,7 +5,8 @@
PhabricatorApplicationTransactionInterface,
PhabricatorFlaggableInterface,
PhabricatorPolicyInterface,
- PhabricatorDestructibleInterface {
+ PhabricatorDestructibleInterface,
+ PhabricatorSubscribableInterface {
const TABLE_RULE_APPLIED = 'herald_ruleapplied';
@@ -320,8 +321,25 @@
}
+/* -( PhabricatorSubscribableInterface )----------------------------------- */
+
+
+ public function isAutomaticallySubscribed($phid) {
+ return $this->isPersonalRule() && $phid == $this->getAuthorPHID();
+ }
+
+ public function shouldShowSubscribersProperty() {
+ return true;
+ }
+
+ public function shouldAllowSubscription($phid) {
+ return true;
+ }
+
+
/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
public function destroyObjectPermanently(
PhabricatorDestructionEngine $engine) {
diff --git a/src/applications/herald/storage/HeraldSchemaSpec.php b/src/applications/herald/storage/HeraldSchemaSpec.php
--- a/src/applications/herald/storage/HeraldSchemaSpec.php
+++ b/src/applications/herald/storage/HeraldSchemaSpec.php
@@ -33,6 +33,7 @@
'unique' => true,
),
));
+ $this->buildEdgeSchemata(new HeraldRule());
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, May 24, 3:05 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6296897
Default Alt Text
D14468.diff (2 KB)

Event Timeline