From 47b51ff696b2d920ee14f6c67442c41306c9b81e Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Thu, 31 Aug 2023 20:24:08 +0300 Subject: [PATCH] updates on the migration template (#24430) --- server/tests/template.load | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/server/tests/template.load b/server/tests/template.load index b72a8816a5..e6400e6651 100644 --- a/server/tests/template.load +++ b/server/tests/template.load @@ -5,7 +5,7 @@ LOAD DATABASE WITH data only, workers = 8, concurrency = 1, multiple readers per thread, rows per range = 50000, - create no tables, + create no tables, create no indexes, preserve index names SET PostgreSQL PARAMETERS @@ -26,12 +26,17 @@ CAST column Channels.Type to "channel_type" drop typemod, type tinyint when (<= precision 4) to boolean using tinyint-to-boolean, type json to jsonb drop typemod -MATERIALIZE VIEWS exclude_products - excluding table names matching ~, ~ +EXCLUDING TABLE NAMES MATCHING ~, ~ BEFORE LOAD DO - $$ ALTER SCHEMA public RENAME TO {{ .source_schema }}; $$ + $$ ALTER SCHEMA public RENAME TO {{ .source_schema }}; $$, + $$ DROP INDEX IF EXISTS idx_posts_message_txt; $$, + $$ DROP INDEX IF EXISTS idx_fileinfo_content_txt; $$ AFTER LOAD DO $$ UPDATE {{ .source_schema }}.db_migrations set name='add_createat_to_teamembers' where version=92; $$, - $$ ALTER SCHEMA {{ .source_schema }} RENAME TO public; $$; + $$ CREATE INDEX IF NOT EXISTS idx_posts_message_txt ON {{ .source_schema }}.posts USING gin(to_tsvector('english', message)); $$, + $$ CREATE INDEX IF NOT EXISTS idx_fileinfo_content_txt ON {{ .source_schema }}.fileinfo USING gin(to_tsvector('english', content)); $$, + $$ ALTER SCHEMA {{ .source_schema }} RENAME TO public; $$, + $$ SELECT pg_catalog.set_config('search_path', '"$user", public', false); $$, + $$ ALTER USER {{ .pg_user }} SET SEARCH_PATH TO 'public'; $$;