diff --git a/ee/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql b/ee/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql new file mode 100644 index 000000000..5f5e369dd --- /dev/null +++ b/ee/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql @@ -0,0 +1,17 @@ +BEGIN; +CREATE OR REPLACE FUNCTION openreplay_version() + RETURNS text AS +$$ +SELECT 'v1.8.0-ee' +$$ LANGUAGE sql IMMUTABLE; + +COMMIT; + +CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS autocomplete_unique_m ON autocomplete (project_id, md5(value), type); + +BEGIN; + +DROP INDEX IF EXISTS autocomplete_unique; +ALTER INDEX IF EXISTS autocomplete_unique_m RENAME TO autocomplete_unique; + +COMMIT; \ No newline at end of file diff --git a/ee/scripts/helm/db/init_dbs/postgresql/init_schema.sql b/ee/scripts/helm/db/init_dbs/postgresql/init_schema.sql index 2d1c2b95f..b80486e5b 100644 --- a/ee/scripts/helm/db/init_dbs/postgresql/init_schema.sql +++ b/ee/scripts/helm/db/init_dbs/postgresql/init_schema.sql @@ -658,7 +658,7 @@ $$ project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE ); - CREATE unique index IF NOT EXISTS autocomplete_unique ON autocomplete (project_id, value, type); + CREATE UNIQUE INDEX IF NOT EXISTS autocomplete_unique ON autocomplete (project_id, md5(value), type); CREATE index IF NOT EXISTS autocomplete_project_id_idx ON autocomplete (project_id); CREATE INDEX IF NOT EXISTS autocomplete_type_idx ON public.autocomplete (type); diff --git a/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql b/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql new file mode 100644 index 000000000..a3a0ddd10 --- /dev/null +++ b/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql @@ -0,0 +1,17 @@ +BEGIN; +CREATE OR REPLACE FUNCTION openreplay_version() + RETURNS text AS +$$ +SELECT 'v1.8.0' +$$ LANGUAGE sql IMMUTABLE; + +COMMIT; + +CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS autocomplete_unique_m ON autocomplete (project_id, md5(value), type); + +BEGIN; + +DROP INDEX IF EXISTS autocomplete_unique; +ALTER INDEX IF EXISTS autocomplete_unique_m RENAME TO autocomplete_unique; + +COMMIT; \ No newline at end of file diff --git a/scripts/helm/db/init_dbs/postgresql/init_schema.sql b/scripts/helm/db/init_dbs/postgresql/init_schema.sql index c96bc9fc9..797460ee8 100644 --- a/scripts/helm/db/init_dbs/postgresql/init_schema.sql +++ b/scripts/helm/db/init_dbs/postgresql/init_schema.sql @@ -839,7 +839,7 @@ $$ project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE ); - CREATE unique index autocomplete_unique ON autocomplete (project_id, value, type); + CREATE UNIQUE INDEX autocomplete_unique ON autocomplete (project_id, md5(value), type); CREATE index autocomplete_project_id_idx ON autocomplete (project_id); CREATE INDEX autocomplete_type_idx ON public.autocomplete (type);