import { type Kysely } from 'kysely';
/**
 * Org-scope `org_settings` and qualify each glob entry by source.
 *
 * `org_settings` was keyed by `routing_key`, meaning each webhook
 * source had its own independent global-workflow configuration. With multi-
 * source orgs, the dashboard's per-org settings page only ever showed the
 * first source it found and silently hid the rest.
 *
 * This migration:
 *
 *   1. Adds a `customer_id text` column.
 *   2. Backfills `customer_id` from `sources` / `generic_webhook_sources` by
 *      `routing_key`. Rows whose `routing_key` cannot be resolved (orphans
 *      from deleted sources) are dropped — they were already unreachable.
 *   3. Converts the three repo-list `text[]` columns to `jsonb` arrays of
 *      `{routingKey?: string, pattern: string}` entries. Each existing entry
 *      is qualified with its original `routing_key` so semantics are preserved
 *      verbatim — a glob that previously only saw events on `github:42` still
 *      only sees events on `github:42`.
 *   4. Merges rows by `customer_id`. `global_workflows_enabled` collapses with
 *      logical OR; the three list columns concatenate.
 *   5. Drops the old `routing_key` column and PK; new PK is `customer_id`.
 *
 * Idempotent: a re-run on an already-migrated DB sees `customer_id` exists
 * and the list columns are already jsonb, so it is a no-op.
 */
export declare function up(db: Kysely<unknown>): Promise<void>;
export declare function down(db: Kysely<unknown>): Promise<void>;
//# sourceMappingURL=015_org_settings_customer_scoped.d.ts.map