Skip to content
Prev Previous commit
Next Next commit
Remove conditional index creation
  • Loading branch information
jjoyce0510 committed Jun 17, 2021
commit d6b03a1375557ba710be6c49bdf43c2d3169d7dd
8 changes: 1 addition & 7 deletions docker/mysql-setup/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@ WHERE NOT EXISTS (SELECT * from metadata_aspect_v2);
DROP TABLE temp_metadata_aspect_v2;

-- create index on the "aspect" column to support aspect-oriented queries.
-- TODO: Add conditional index creation.
ALTER TABLE metadata_aspect_v2 ADD INDEX (aspect);


IF NOT (SELECT COUNT(1) indexExists FROM INFORMATION_SCHEMA.STATISTICS
WHERE table_schema=DATABASE() AND table_name='metadata_aspect_v2' AND index_name='aspectName';
) THEN
CREATE INDEX aspectName ON metadata_aspect_v2 (aspect);
END IF;

-- create metadata index table
CREATE TABLE IF NOT EXISTS metadata_index (
`id` BIGINT NOT NULL AUTO_INCREMENT,
Expand Down