Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15416173
D18034.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
D18034.diff
View Options
diff --git a/resources/sql/autopatches/20141106.uniqdrafts.php b/resources/sql/autopatches/20141106.uniqdrafts.php
--- a/resources/sql/autopatches/20141106.uniqdrafts.php
+++ b/resources/sql/autopatches/20141106.uniqdrafts.php
@@ -1,30 +1,3 @@
<?php
-// Destroy duplicate drafts before storage adjustment adds a unique key to this
-// table. See T1191. We retain the newest draft.
-
-// (We can't easily do this in a single SQL statement because MySQL won't let us
-// modify a table that's joined in a subquery.)
-
-$table = new DifferentialDraft();
-$conn_w = $table->establishConnection('w');
-
-$duplicates = queryfx_all(
- $conn_w,
- 'SELECT DISTINCT u.id id FROM %T u
- JOIN %T v
- ON u.objectPHID = v.objectPHID
- AND u.authorPHID = v.authorPHID
- AND u.draftKey = v.draftKey
- AND u.id < v.id',
- $table->getTableName(),
- $table->getTableName());
-
-$duplicates = ipull($duplicates, 'id');
-foreach (PhabricatorLiskDAO::chunkSQL($duplicates) as $chunk) {
- queryfx(
- $conn_w,
- 'DELETE FROM %T WHERE id IN (%Q)',
- $table->getTableName(),
- $chunk);
-}
+// This table has been removed; see T12104 for details.
diff --git a/resources/sql/autopatches/20170526.dropdifferentialdrafts.sql b/resources/sql/autopatches/20170526.dropdifferentialdrafts.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170526.dropdifferentialdrafts.sql
@@ -0,0 +1 @@
+DROP TABLE {$NAMESPACE}_differential.differential_draft;
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
@@ -441,7 +441,6 @@
'DifferentialDiffTransactionQuery' => 'applications/differential/query/DifferentialDiffTransactionQuery.php',
'DifferentialDiffViewController' => 'applications/differential/controller/DifferentialDiffViewController.php',
'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php',
- 'DifferentialDraft' => 'applications/differential/storage/DifferentialDraft.php',
'DifferentialExactUserFunctionDatasource' => 'applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php',
'DifferentialFieldParseException' => 'applications/differential/exception/DifferentialFieldParseException.php',
'DifferentialFieldValidationException' => 'applications/differential/exception/DifferentialFieldValidationException.php',
@@ -5391,7 +5390,6 @@
'DifferentialDiffTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'DifferentialDiffViewController' => 'DifferentialController',
'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'DoorkeeperFeedStoryPublisher',
- 'DifferentialDraft' => 'DifferentialDAO',
'DifferentialExactUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'DifferentialFieldParseException' => 'Exception',
'DifferentialFieldValidationException' => 'Exception',
diff --git a/src/applications/differential/storage/DifferentialDraft.php b/src/applications/differential/storage/DifferentialDraft.php
deleted file mode 100644
--- a/src/applications/differential/storage/DifferentialDraft.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-final class DifferentialDraft extends DifferentialDAO {
-
- protected $objectPHID;
- protected $authorPHID;
- protected $draftKey;
-
- protected function getConfiguration() {
- return array(
- self::CONFIG_COLUMN_SCHEMA => array(
- 'draftKey' => 'text64',
- ),
- self::CONFIG_KEY_SCHEMA => array(
- 'key_unique' => array(
- 'columns' => array('objectPHID', 'authorPHID', 'draftKey'),
- 'unique' => true,
- ),
- ),
- ) + parent::getConfiguration();
- }
-
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 9:44 AM (1 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7715300
Default Alt Text
D18034.diff (3 KB)
Attached To
Mode
D18034: Drop DifferentialDraft storage
Attached
Detach File
Event Timeline
Log In to Comment