feat(DB): autocomplete unique index changes
This commit is contained in:
parent
7bb18b7039
commit
95405dcdfa
4 changed files with 36 additions and 2 deletions
17
ee/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql
Normal file
17
ee/scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql
Normal file
|
|
@ -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;
|
||||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
17
scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql
Normal file
17
scripts/helm/db/init_dbs/postgresql/1.8.0/1.8.0.sql
Normal file
|
|
@ -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;
|
||||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue