1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 23:32:40 +01:00
phorge-phorge/resources/sql/autopatches/20150708.herald.2.sql
epriestley f9134fc331 Modularize all Herald pre-commit ref fields
Summary: Ref T8726. Just (pre-commit content) one more left.

Test Plan:
  - Created a big rule with every field.
  - Migrated it.
  - Verified the rule was still the same.
  - Pushed a bunch of changes and reviewed the transcripts.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8726

Differential Revision: https://secure.phabricator.com/D13600
2015-07-08 12:26:00 -07:00

48 lines
1.7 KiB
SQL

UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'diffusion.pre.ref.type'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
AND c.fieldName = 'ref-type';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'diffusion.pre.ref.name'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
AND c.fieldName = 'ref-name';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'diffusion.pre.ref.change'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
AND c.fieldName = 'ref-change';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'diffusion.pre.ref.repository'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
AND c.fieldName = 'repository';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'diffusion.pre.ref.repository.projects'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
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 = 'diffusion.pre.ref.pusher'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
AND c.fieldName = 'pusher';
UPDATE {$NAMESPACE}_herald.herald_condition c
JOIN {$NAMESPACE}_herald.herald_rule r
ON c.ruleID = r.id
SET c.fieldName = 'diffusion.pre.ref.pusher.projects'
WHERE r.contentType = 'HeraldPreCommitRefAdapter'
AND c.fieldName = 'pusher-projects';