1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00
phorge-phorge/resources/sql/patches/20130926.dinkeys.sql
epriestley 3cb67480e0 Adjust keys for new Differential inline comment table
Summary:
Ref T2222. This sequences //before// D7139 and sorts out keys on the table. In particular:

  - There was a fairly silly `draft` key modeled after Pholio; drop it.
  - Add a `revisionPHID` key. This is queried mostly-transitionally on the revision view screen.
  - Add a `changesetID` key. This is queried by a bunch of interfaces that want more surgical results than `revisionPHID` provides.
  - Add an `authorPHID, transactionPHID` key. This is queried on the list interface to find pending drafts.
  - Add a `legacy` key. This is queried by the feed publisher.

Test Plan: Used the query analyzer to hit all (I think?) of the pages, saw keyed queries.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D7140
2013-09-26 13:48:36 -07:00

15 lines
561 B
SQL

ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
DROP KEY `key_draft`;
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD KEY `key_changeset` (changesetID);
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD KEY `key_draft` (authorPHID, transactionPHID);
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD KEY `key_revision` (revisionPHID);
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD KEY `key_legacy` (legacyCommentID);