Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15517011
D21184.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D21184.diff
View Options
diff --git a/resources/sql/autopatches/20200428.inline.01.differential.column.sql b/resources/sql/autopatches/20200428.inline.01.differential.column.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.01.differential.column.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
+ ADD attributes LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20200428.inline.02.diffusion.column.sql b/resources/sql/autopatches/20200428.inline.02.diffusion.column.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.02.diffusion.column.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_audit.audit_transaction_comment
+ ADD attributes LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20200428.inline.03.differential.value.sql b/resources/sql/autopatches/20200428.inline.03.differential.value.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.03.differential.value.sql
@@ -0,0 +1,2 @@
+UPDATE {$NAMESPACE}_differential.differential_transaction_comment
+ SET attributes = '{}' WHERE attributes = '';
diff --git a/resources/sql/autopatches/20200428.inline.04.diffusion.value.sql b/resources/sql/autopatches/20200428.inline.04.diffusion.value.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.04.diffusion.value.sql
@@ -0,0 +1,2 @@
+UPDATE {$NAMESPACE}_audit.audit_transaction_comment
+ SET attributes = '{}' WHERE attributes = '';
diff --git a/src/applications/audit/storage/PhabricatorAuditTransactionComment.php b/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
--- a/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
+++ b/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
@@ -12,6 +12,7 @@
protected $hasReplies = 0;
protected $replyToCommentPHID;
protected $legacyCommentID;
+ protected $attributes = array();
private $replyToComment = self::ATTACHABLE;
@@ -54,6 +55,10 @@
),
) + $config[self::CONFIG_KEY_SCHEMA];
+ $config[self::CONFIG_SERIALIZATION] = array(
+ 'attributes' => self::SERIALIZATION_JSON,
+ ) + idx($config, self::CONFIG_SERIALIZATION, array());
+
return $config;
}
diff --git a/src/applications/differential/storage/DifferentialTransactionComment.php b/src/applications/differential/storage/DifferentialTransactionComment.php
--- a/src/applications/differential/storage/DifferentialTransactionComment.php
+++ b/src/applications/differential/storage/DifferentialTransactionComment.php
@@ -11,6 +11,7 @@
protected $fixedState;
protected $hasReplies = 0;
protected $replyToCommentPHID;
+ protected $attributes = array();
private $replyToComment = self::ATTACHABLE;
private $isHidden = self::ATTACHABLE;
@@ -32,6 +33,7 @@
protected function getConfiguration() {
$config = parent::getConfiguration();
+
$config[self::CONFIG_COLUMN_SCHEMA] = array(
'revisionPHID' => 'phid?',
'changesetID' => 'id?',
@@ -42,6 +44,7 @@
'hasReplies' => 'bool',
'replyToCommentPHID' => 'phid?',
) + $config[self::CONFIG_COLUMN_SCHEMA];
+
$config[self::CONFIG_KEY_SCHEMA] = array(
'key_draft' => array(
'columns' => array('authorPHID', 'transactionPHID'),
@@ -53,6 +56,11 @@
'columns' => array('revisionPHID'),
),
) + $config[self::CONFIG_KEY_SCHEMA];
+
+ $config[self::CONFIG_SERIALIZATION] = array(
+ 'attributes' => self::SERIALIZATION_JSON,
+ ) + idx($config, self::CONFIG_SERIALIZATION, array());
+
return $config;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 19, 11:26 PM (4 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7799144
Default Alt Text
D21184.diff (3 KB)
Attached To
Mode
D21184: Add generic "attributes" storage to inline comment tables
Attached
Detach File
Event Timeline
Log In to Comment