// 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';
export async function run(client: PoolClient): Promise<void> {
await client.query(`CREATE TABLE IF NOT EXISTS "SmartAppLaunch" (
"id" UUID NOT NULL PRIMARY KEY,
"content" TEXT NOT NULL,
"lastUpdated" TIMESTAMP WITH TIME ZONE NOT NULL,
"deleted" BOOLEAN NOT NULL DEFAULT FALSE,
"compartments" UUID[] NOT NULL
)`);
await client.query(`CREATE TABLE IF NOT EXISTS "SmartAppLaunch_History" (
"versionId" UUID NOT NULL PRIMARY KEY,
"id" UUID NOT NULL,
"content" TEXT NOT NULL,
"lastUpdated" TIMESTAMP WITH TIME ZONE NOT NULL
)`);
await client.query('CREATE INDEX ON "SmartAppLaunch" ("lastUpdated")');
await client.query('CREATE INDEX ON "SmartAppLaunch" USING GIN("compartments")');
await client.query('CREATE INDEX ON "SmartAppLaunch_History" ("id")');
await client.query('CREATE INDEX ON "SmartAppLaunch_History" ("lastUpdated")');
}