1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 07:50:57 +01:00
phorge-phorge/resources/sql/autopatches/20150708.herald.1.sql
epriestley 00b98eca54 Modularize all DifferentialRevision fields
Summary: Ref T8726. Make all the DifferentialRevision stuff modular.

Test Plan:
  - Created a rule with all fields.
  - Ran upgrade.
  - Saw all fields preserved with new modular versions.
  - Used test console to run rule with all fields, verified field values as broadly sensible.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8726

Differential Revision: https://secure.phabricator.com/D13598
2015-07-08 12:25:48 -07:00

90 lines
3 KiB
SQL

UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.diff.affected'
WHERE r.contentType = 'differential'
AND c.fieldName = 'diff-file';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.author'
WHERE r.contentType = 'differential'
AND c.fieldName = 'author';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.author.projects'
WHERE r.contentType = 'differential'
AND c.fieldName = 'authorprojects';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.diff.new'
WHERE r.contentType = 'differential'
AND c.fieldName = 'diff-added-content';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.diff.content'
WHERE r.contentType = 'differential'
AND c.fieldName = 'diff-content';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.diff.old'
WHERE r.contentType = 'differential'
AND c.fieldName = 'diff-removed-content';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.package'
WHERE r.contentType = 'differential'
AND c.fieldName = 'affected-package';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.repository'
WHERE r.contentType = 'differential'
AND c.fieldName = 'repository';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.repository.projects'
WHERE r.contentType = 'differential'
AND c.fieldName = 'repository-projects';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.reviewers'
WHERE r.contentType = 'differential'
AND c.fieldName = 'reviewers';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.summary'
WHERE r.contentType = 'differential'
AND c.fieldName = 'body';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.title'
WHERE r.contentType = 'differential'
AND c.fieldName = 'title';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'differential.revision.package.owners'
WHERE r.contentType = 'differential'
AND c.fieldName = 'affected-package-owner';