Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14093983
D19670.id47009.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D19670.id47009.diff
View Options
diff --git a/resources/sql/autopatches/20180914.audit.01.mailkey.php b/resources/sql/autopatches/20180914.audit.01.mailkey.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20180914.audit.01.mailkey.php
@@ -0,0 +1,26 @@
+<?php
+
+$commit_table = new PhabricatorRepositoryCommit();
+$commit_conn = $commit_table->establishConnection('w');
+$commit_name = $commit_table->getTableName();
+
+$properties_table = new PhabricatorMetaMTAMailProperties();
+$conn = $properties_table->establishConnection('w');
+
+$iterator = new LiskRawMigrationIterator($commit_conn, $commit_name);
+foreach ($iterator as $commit) {
+ queryfx(
+ $conn,
+ 'INSERT IGNORE INTO %T
+ (objectPHID, mailProperties, dateCreated, dateModified)
+ VALUES
+ (%s, %s, %d, %d)',
+ $properties_table->getTableName(),
+ $commit['phid'],
+ phutil_json_encode(
+ array(
+ 'mailKey' => $commit['mailKey'],
+ )),
+ PhabricatorTime::getNow(),
+ PhabricatorTime::getNow());
+}
diff --git a/resources/sql/autopatches/20180914.audit.02.rmkey.sql b/resources/sql/autopatches/20180914.audit.02.rmkey.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20180914.audit.02.rmkey.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_repository.repository_commit
+ DROP mailKey;
diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -25,7 +25,6 @@
protected $committerIdentityPHID;
protected $commitIdentifier;
protected $epoch;
- protected $mailKey;
protected $authorPHID;
protected $auditStatus = DiffusionCommitAuditStatus::NONE;
protected $summary = '';
@@ -116,7 +115,6 @@
self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'commitIdentifier' => 'text40',
- 'mailKey' => 'bytes20',
'authorPHID' => 'phid?',
'authorIdentityPHID' => 'phid?',
'committerIdentityPHID' => 'phid?',
@@ -321,13 +319,6 @@
return mpull($audits, 'getAuditorPHID');
}
- public function save() {
- if (!$this->mailKey) {
- $this->mailKey = Filesystem::readRandomCharacters(20);
- }
- return parent::save();
- }
-
public function delete() {
$data = $this->loadCommitData();
$audits = id(new PhabricatorRepositoryAuditRequest())
@@ -605,7 +596,6 @@
'phid' => $this->getPHID(),
'commitIdentifier' => $this->getCommitIdentifier(),
'epoch' => $this->getEpoch(),
- 'mailKey' => $this->getMailKey(),
'authorPHID' => $this->getAuthorPHID(),
'auditStatus' => $this->getAuditStatus(),
'summary' => $this->getSummary(),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 1:39 PM (12 h, 41 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6789655
Default Alt Text
D19670.id47009.diff (2 KB)
Attached To
Mode
D19670: Remove "mailKey" from "PhabricatorRepositoryCommit"
Attached
Detach File
Event Timeline
Log In to Comment