1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 23:40:57 +01:00
phorge-phorge/resources/sql/patches/104.searchkey.sql
epriestley 35c5852d3f Add a safeguard against multiple patches with the same version
Summary:
I accidentally added two "104" patches. This actually works OK for the most part
but is fundamentally bad and wrong.

Merge the patches (installs applied both as "104", so we can't move one to
"105") and add a safeguard.

Test Plan: Ran upgrade_schema.php with two "104" patches, got error'd. Ran
without, got successs.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1614
2012-02-14 16:24:02 -08:00

15 lines
478 B
SQL

ALTER TABLE phabricator_search.search_query
DROP authorPHID;
ALTER TABLE phabricator_search.search_query
ADD queryKey VARCHAR(12) NOT NULL;
/* Preserve URIs for old queries in case anyone has them bookmarked. */
UPDATE phabricator_search.search_query
SET queryKey = id;
ALTER TABLE phabricator_search.search_query
ADD UNIQUE KEY (queryKey);
/* NOTE: Accidentally added this as 104, merging. */
UPDATE phabricator_project.project SET status = IF(status = 5, 100, 0);