Skip to content

Commit

Permalink
schema/mysql: Add missing indices to hostgroup and servicegroup
Browse files Browse the repository at this point in the history
fixes #615
  • Loading branch information
nilmerg committed Jul 11, 2023
1 parent a57f0cb commit 759eadc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 6 additions & 2 deletions schema/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ CREATE TABLE hostgroup (

PRIMARY KEY (id),

INDEX idx_hostgroup_name (name) COMMENT 'Host/service/host group list filtered by host group name'
INDEX idx_hostgroup_display_name (display_name) COMMENT 'Hostgroup list filtered/ordered by display_name',
INDEX idx_hostgroup_name_ci (name_ci) COMMENT 'Hostgroup list filtered using quick search',
INDEX idx_hostgroup_name (name) COMMENT 'Host/service/host group list filtered by host group name; Hostgroup detail filter'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

CREATE TABLE hostgroup_member (
Expand Down Expand Up @@ -404,7 +406,9 @@ CREATE TABLE servicegroup (

PRIMARY KEY (id),

INDEX idx_servicegroup_name (name) COMMENT 'Host/service/service group list filtered by service group name'
INDEX idx_servicegroup_display_name (display_name) COMMENT 'Servicegroup list filtered/ordered by display_name',
INDEX idx_servicegroup_name_ci (name_ci) COMMENT 'Servicegroup list filtered using quick search',
INDEX idx_servicegroup_name (name) COMMENT 'Host/service/service group list filtered by service group name; Servicegroup detail filter'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

CREATE TABLE servicegroup_member (
Expand Down
11 changes: 11 additions & 0 deletions schema/mysql/upgrades/1.2.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE hostgroup
ADD INDEX idx_hostgroup_display_name (display_name) COMMENT 'Hostgroup list filtered/ordered by display_name',
ADD INDEX idx_hostgroup_name_ci (name_ci) COMMENT 'Hostgroup list filtered using quick search',
DROP INDEX idx_hostgroup_name,
ADD INDEX idx_hostgroup_name (name) COMMENT 'Host/service/host group list filtered by host group name; Hostgroup detail filter';

ALTER TABLE servicegroup
ADD INDEX idx_servicegroup_display_name (display_name) COMMENT 'Servicegroup list filtered/ordered by display_name',
ADD INDEX idx_servicegroup_name_ci (name_ci) COMMENT 'Servicegroup list filtered using quick search',
DROP INDEX idx_servicegroup_name,
ADD INDEX idx_servicegroup_name (name) COMMENT 'Host/service/service group list filtered by service group name; Servicegroup detail filter';

0 comments on commit 759eadc

Please sign in to comment.