1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-14 17:46:13 +01:00
phorge-phorge/resources/sql/autopatches/20160330.badges.qualityxaction.mig.sql
lkassianik 00425cac94 Converting badge quality property from color to an integer representation for later sorting purposes
Summary: Ref T9007

Test Plan: Create badges, update quality, search by quality without change of functionality.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T9007

Differential Revision: https://secure.phabricator.com/D15551
2016-03-30 17:28:34 -07:00

59 lines
1.9 KiB
SQL

/* Migrate old badge quality transactions */
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 140
WHERE oldValue = '"grey"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 120
WHERE oldValue = '"white"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 100
WHERE oldValue = '"green"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 80
WHERE oldValue = '"blue"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 60
WHERE oldValue = '"indigo"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 40
WHERE oldValue = '"orange"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET oldValue = 20
WHERE oldValue = '"yellow"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 140
WHERE newValue = '"grey"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 120
WHERE newValue = '"white"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 100
WHERE newValue = '"green"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 80
WHERE newValue = '"blue"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 60
WHERE newValue = '"indigo"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 40
WHERE newValue = '"orange"' AND transactionType = 'badges:quality';
UPDATE {$NAMESPACE}_badges.badges_transaction
SET newValue = 20
WHERE newValue = '"yellow"' AND transactionType = 'badges:quality';