// 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(`ALTER TABLE "Project" ADD COLUMN "recaptchaSiteKey" TEXT[]`);
await client.query(`ALTER TABLE "User" ADD COLUMN "project" TEXT`);
// Drop the existing unique constraint on "User.email"
await client.query('DROP INDEX IF EXISTS "User_email_idx"');
// Add a new unique constraint on "User.project and User.email"
// User.project may be null
// User.email must not be null
await client.query('CREATE UNIQUE INDEX ON "User" ("project", "email")');
}