Skip to content

Commit

Permalink
Defensive coding in update SQL, drop indexes before trying to create …
Browse files Browse the repository at this point in the history
…them.
  • Loading branch information
cheesegrits committed Sep 9, 2016
1 parent f93ce4f commit 6d2758c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions administrator/components/com_fabrik/sql/updates/mysql/3.4.sql
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
DROP INDEX IF EXISTS showinsummary ON `#__fabrik_elements`;
DROP INDEX IF EXISTS plugin ON `#__fabrik_elements`;
DROP INDEX IF EXISTS join_checked_out ON `#__fabrik_elements`;
DROP INDEX IF EXISTS join_group_id ON `#__fabrik_elements`;
DROP INDEX IF EXISTS parent_id ON `#__fabrik_elements`;
CREATE INDEX showinsummary ON `#__fabrik_elements` (show_in_list_summary);
CREATE INDEX plugin ON `#__fabrik_elements` (plugin(10));
CREATE INDEX join_checked_out ON `#__fabrik_elements` (checked_out);
CREATE INDEX join_group_id ON `#__fabrik_elements` (group_id);
CREATE INDEX parent_id ON `#__fabrik_elements` (parent_id);

DROP INDEX IF EXISTS join_group_id ON `#__fabrik_formgroup`;
DROP INDEX IF EXISTS join_form_id ON `#__fabrik_formgroup`;
DROP INDEX IF EXISTS ordering ON `#__fabrik_formgroup`;
CREATE INDEX join_group_id ON `#__fabrik_formgroup` (group_id);
CREATE INDEX join_form_id ON `#__fabrik_formgroup` (form_id);
CREATE INDEX ordering ON `#__fabrik_formgroup` (ordering);

DROP INDEX IF EXISTS published ON `#__fabrik_groups`;
CREATE INDEX published ON `#__fabrik_groups` (published);

DROP INDEX IF EXISTS list_id ON `#__fabrik_joins`;
DROP INDEX IF EXISTS element_id ON `#__fabrik_joins`;
DROP INDEX IF EXISTS group_id ON `#__fabrik_joins`;
DROP INDEX IF EXISTS table_join ON `#__fabrik_joins`;
CREATE INDEX list_id ON `#__fabrik_joins` (list_id);
CREATE INDEX element_id ON `#__fabrik_joins` (element_id);
CREATE INDEX group_id ON `#__fabrik_joins` (group_id);
CREATE INDEX table_join ON `#__fabrik_joins` (table_join(100));

DROP INDEX IF EXISTS published ON `#__fabrik_forms`;
DROP INDEX IF EXISTS form_id ON `#__fabrik_lists`;
CREATE INDEX published ON `#__fabrik_forms` (published);
CREATE INDEX form_id ON `#__fabrik_lists` (form_id);

DROP INDEX IF EXISTS element_id ON `#__fabrik_jsactions`;
CREATE INDEX element_id ON `#__fabrik_jsactions` (element_id);

0 comments on commit 6d2758c

Please sign in to comment.