mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
parent
a71cd2bbb9
commit
bba35b5096
2 changed files with 23 additions and 12 deletions
|
|
@ -2,16 +2,26 @@ import { type MigrationExecutor } from '../pg-migrator';
|
|||
|
||||
export default {
|
||||
name: '2025.11.25T00-00-00.members-search.ts',
|
||||
run: ({ sql }) => sql`
|
||||
-- The order was wrong. This was sorting by org_id, user_id, then created_at...
|
||||
DROP INDEX IF EXISTS "organization_member_pagination_idx";
|
||||
|
||||
-- Replace "organization_member_pagination_idx" with a new index in the correct order
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS "organization_member_pagination"
|
||||
ON "organization_member" (
|
||||
"organization_id" DESC
|
||||
, "created_at" DESC
|
||||
, "user_id" DESC
|
||||
);
|
||||
`,
|
||||
noTransaction: true,
|
||||
run: ({ sql }) => [
|
||||
{
|
||||
name: 'Drop old "organization_member_pagination_idx" index',
|
||||
query: sql`
|
||||
-- The order was wrong. This was sorting by org_id, user_id, then created_at...
|
||||
DROP INDEX IF EXISTS "organization_member_pagination_idx";
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'Create new "organization_member_pagination" index with correct order',
|
||||
query: sql`
|
||||
-- Replace "organization_member_pagination_idx" with a new index in the correct order
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS "organization_member_pagination"
|
||||
ON "organization_member" (
|
||||
"organization_id" DESC
|
||||
, "created_at" DESC
|
||||
, "user_id" DESC
|
||||
);
|
||||
`,
|
||||
},
|
||||
],
|
||||
} satisfies MigrationExecutor;
|
||||
|
|
|
|||
|
|
@ -170,5 +170,6 @@ export const runPGMigrations = async (args: { slonik: DatabasePool; runTo?: stri
|
|||
await import('./actions/2025.10.16T00-00-00.schema-log-by-commit-ordered'),
|
||||
await import('./actions/2025.10.17T00-00-00.project-access-tokens'),
|
||||
await import('./actions/2025.11.12T00-00-00.granular-oidc-role-permissions'),
|
||||
await import('./actions/2025.11.25T00-00-00.members-search'),
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue