Skip to content

Commit

Permalink
a fix on search path for the base migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
isacikgoz committed Aug 31, 2023
1 parent cd72089 commit ecde1da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/guides/postgres-migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ Once we set the schema to a desired state, we can start migrating the **data** b
$$ UPDATE {{ .source_schema }}.db_migrations set name='add_createat_to_teamembers' where version=92; $$,
$$ 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; $$;
$$ 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'; $$;
Once you save this configuration file, e.g. ``migration.load``, you can run the ``pgLoader`` with the following command:

Expand Down Expand Up @@ -301,7 +303,7 @@ Once we are ready to migrate, we can start migrating the **schema** and the **da
$$ CREATE INDEX IF NOT EXISTS ir_playbookmember_playbookid on {{ .source_schema }}.IR_PlaybookMember(PlaybookId); $$,
$$ ALTER SCHEMA {{ .source_schema }} RENAME TO public; $$,
$$ SELECT pg_catalog.set_config('search_path', '"$user", public', false); $$,
$$ ALTER USER mmuser SET SEARCH_PATH TO 'public'; $$;
$$ ALTER USER {{ .pg_user }} SET SEARCH_PATH TO 'public'; $$;
.. code:: bash
Expand Down Expand Up @@ -358,7 +360,7 @@ Once we are ready to migrate, we can start migrating the **schema** and the **da
$$ UPDATE {{ .source_schema }}.focalboard_users SET `props` = "{}" WHERE `fields` = ""; $$,
$$ ALTER SCHEMA {{ .source_schema }} RENAME TO public; $$,
$$ SELECT pg_catalog.set_config('search_path', '"$user", public', false); $$,
$$ ALTER USER mmuser SET SEARCH_PATH TO 'public'; $$;
$$ ALTER USER {{ .pg_user }} SET SEARCH_PATH TO 'public'; $$;
.. code:: bash
Expand Down

0 comments on commit ecde1da

Please sign in to comment.