Skip to main content
Glama
v57.ts1.63 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 /* * Generated by @medplum/generator * Do not edit manually. */ import type { PoolClient } from 'pg'; const SIMPLE = 'simple'; const ENGLISH = 'english'; export async function run(client: PoolClient): Promise<void> { const fields = [ ['HumanName', 'name', SIMPLE], ['HumanName', 'given', SIMPLE], ['HumanName', 'family', SIMPLE], ['Address', 'address', SIMPLE], ['Address', 'city', SIMPLE], ['Address', 'country', SIMPLE], ['Address', 'postalCode', SIMPLE], ['Address', 'state', SIMPLE], ['Address', 'use', SIMPLE], ['ValueSetElement', 'display', ENGLISH], ]; for (const [table, column, lang] of fields) { // Drop existing index if it exists // These indexes were created in migration v37 // Note: These used "_tsv_idx" await client.query(`DROP INDEX CONCURRENTLY IF EXISTS "${table}_${column}_tsv_idx"`); // Drop the precomputed columns if they exist // These columns were created in migration v37 await client.query(`ALTER TABLE "${table}" DROP COLUMN IF EXISTS "${column}_tsv"`); // Drop incorrect TSV index // This was created in migration v51 with a bug in the index name await client.query(`DROP INDEX CONCURRENTLY IF EXISTS "${table}_idx_tsv"`); // Now add new TSV index column using the full name including table and column name await client.query( `CREATE INDEX CONCURRENTLY IF NOT EXISTS "${table}_${column}_idx_tsv" ON "${table}" USING gin (to_tsvector('${lang}', "${column}"))` ); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/medplum/medplum'

If you have feedback or need assistance with the MCP directory API, please join our Discord server