Skip to content
Prev Previous commit
Next Next commit
only add index on table create
  • Loading branch information
jjoyce0510 committed Jun 17, 2021
commit 8c4782f56ed869209669ab5d349be5caea438e04
5 changes: 1 addition & 4 deletions docker/mysql-setup/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ create table if not exists metadata_aspect_v2 (
createdby varchar(255) not null,
createdfor varchar(255),
constraint pk_metadata_aspect primary key (urn,aspect,version)
index aspectName (`aspect`)
);

-- create default records for datahub user if not exists
Expand All @@ -38,10 +39,6 @@ SELECT * FROM temp_metadata_aspect_v2
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);

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