-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration generation improvements (#5589)
* Match indexes on entire definition * _security is a gin index * Match non btree/gin, e.g. gist, indexes * Add opt-in logging of unmatched indexes * [autofix.ci] apply automated fixes * No need to require unique --------- Co-authored-by: autofix-ci[bot] <114827586 autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
09345c7
commit dfb83f6
Showing
3 changed files
with
84 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
/* | ||
* Generated by @medplum/generator | ||
* Do not edit manually. | ||
*/ | ||
|
||
import { PoolClient } from 'pg'; | ||
|
||
export async function run(client: PoolClient): Promise<void> { | ||
await client.query( | ||
'CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubscriptionStatus__security_idx" ON "SubscriptionStatus" USING gin ("_security")' | ||
); | ||
await client.query( | ||
'CREATE INDEX CONCURRENTLY IF NOT EXISTS "UserSecurityRequest__security_idx" ON "UserSecurityRequest" USING gin ("_security")' | ||
); | ||
|
||
// Drop the old btree indexes | ||
await client.query('DROP INDEX IF EXISTS "usersecurityrequest__security_idx"'); | ||
await client.query('DROP INDEX IF EXISTS "subscriptionstatus__security_idx"'); | ||
} |