Skip to main content

Module search

Module search 

Source
Expand description

The PG search index’s migrations: the .sql files of sql/search.

haste-fhir-search decides which table and column hold each search parameter, so it is what knows whether a database has them all. migrate applies the migrations and then has it check; pending_migration has it write the migration creating what the database lacks, which generate search-migration saves in sql/search. A change to an existing object (a column’s type, an index’s definition) is written by hand: drop it, then create it.

Functions§

migrate
Applies the search migrations that the database of pool lacks, then checks the database has everything the search schema needs.
pending_migration
Applies the search migrations that the database of pool lacks, then returns the migration creating what the search schema still needs, or None when the database lacks nothing.