1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00
phorge-phorge/resources/sql/autopatches/20160330.badges.migratequality.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

32 lines
738 B
SQL

/* Change quality from color to int */
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 140
WHERE quality = 'grey';
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 120
WHERE quality = 'white';
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 100
WHERE quality = 'green';
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 80
WHERE quality = 'blue';
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 60
WHERE quality = 'indigo';
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 40
WHERE quality = 'orange';
UPDATE {$NAMESPACE}_badges.badges_badge
SET quality = 20
WHERE quality = 'yellow';
ALTER TABLE {$NAMESPACE}_badges.badges_badge
MODIFY quality INT UNSIGNED NOT NULL;