From e8a3f1f6f2494307223e2a774b990dab4bafa767 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:06:32 -0600 Subject: [PATCH] feat(recovery): prove a replaced container's records gone through a fenced controller epoch (#20054) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - After a restart, the control plane settles in-progress records (leases, claims, intents) only once it proves their owner process is gone > - The proof compares host and PID space, so a stamp from a replaced container or a rebooted machine stays unprovable forever, and its records never settle > - Self-hosted users on Docker, Kubernetes and Fly hit this on every redeploy; a Railway deployment with an exclusive volume is covered by `deployment_replaced` (#20026) > - This pull request adds a fenced controller epoch: each boot holds a database lease, and an expired boot is fenced so its records can be proven gone > - The benefit is that work stranded by a replaced container is recovered, without keeping an idle database awake ## Linked Issues or Issue Description Follow-up to #20026 and the Phase 2 durable-ownership data. Related: #19965 (owner stamps), #19883 (process space). No duplicate PR was found. **What happened?** A record stamped by a server process in another container reports `different_process_space`. A dead PID elsewhere is never proof, so the record stays `unprovable` and is never settled. Every redeploy of a self-hosted container leaves such records behind. **Expected behavior** A record owned by a server boot that was replaced (stopped cleanly, or lost its lease and was fenced) is proven gone and settled exactly once. A live boot's records stay with it. An idle server issues no recurring queries. **Steps to reproduce** 1. Run Paperclip in a container and start work, so an environment lease is stamped by that boot. 2. Replace the container. The new container has a new PID namespace. 3. The ownership reconciler reports `different_process_space` (unprovable) for the old lease, forever. **Paperclip version or commit** `master` before this PR. ## What Changed - New `controller_instances` table (migration 0449): boot id, epoch (bigserial), process space, pid, a lease on the database clock, `fenced_at` / `fenced_by_epoch`, `stopped_at`. - `controller-instance-lease.ts`, registered with the shared delivery-work coordinator (`controller-instance-lease` queue, runs during drain): - **Holds work → renews; idle → silent.** One upsert creates the row on first use and extends the lease only if the boot holds work: a stamp within the last 90 s, or a stamp whose ownership write may still be pending (held until the server's tracked work settles, capped at 10 minutes; a renewal that sees some other held record does not clear it, so a slow ownership write cannot be outlived), or an in-progress record held by its boot id. Those records are active environment leases, in-flight cleanup claims, sandbox creation intents, workspace finalize attempts, agent lifecycle steps, native finalizer and cleanup leases (`lease_holder` bound to the token), open native coordinator claims, and running legacy runs. Renewal runs every 30 s while the boot holds work. When it finds none, the lease lapses and the worker sleeps until the next stamp (`onControllerStamp`). - **No idle trailing statements.** When the server's last tracked work settles, the worker re-checks holdings at once, at most every 5 s (the rate limit also absorbs the worker's own run). So the last check happens with the work, not 30 s later. - **Quiesce, don't crash.** Each renewal has a 10 s bound. A failed or timed-out renewal applies an internal task drain, so no new work is dispatched. A recovered renewal resumes. The boot exits only after 60 s of failure (counted from the first failed attempt's start) while it still holds work, or at once when it finds itself fenced. - **Fence on demand, by a newer epoch.** For a stamp from another host or PID space, the prover reads that boot's row: - `stopped` or `fenced`: gone. - live lease: alive. - otherwise, the boot's last sign of life is the later of its lease expiry and the record's last write plus the TTL. Within 30 s of that, the owner stays `alive` (`controller_lease_grace`), so the settle watch keeps rechecking. After that, the prover fences the boot, but only with a lease row of its own (created on demand) and only an older epoch. - A graceful shutdown records `stopped_at`. - A reconciliation pass that settles nothing (`record: false` or `settle: false`) never fences and never creates the boot's row. - `owner-proof.ts`: these proofs apply only to server-held records. A stamp with a recorded process group stays unprovable, because agent processes can outlive their server. The reconciler passes each record's `updatedAt` to the proof. - `task-admission.ts`: - the quiesce drain never replaces an operator's drain, and has no idle owner, so HTTP stays open; - a `subscribeIdleWorkSettled` hook fires when the last tracked work finishes. - Off on a Railway deployment with an exclusive volume (it has its own replacement proof). `PAPERCLIP_CONTROLLER_INSTANCE_LEASE=on|off` overrides this. A stateless Railway service keeps the lease. A server without its own lease row never fences. - `maintenance-server-routes.test.ts`: in the post-run quiet window, the lease may check once more that the run's records were released. The test now excludes those statements, then asserts that the lease issues nothing in a further window. - Docs: `doc/execution-semantics.md`; the Phase 2 data doc records the two known gaps. ## Verification - `controller-instance-lease.test.ts` (15 cases): - a replaced container with all Railway variables empty is fenced and settled exactly once over two passes; - a live lease is alive; - an owner in grace, and work written after an idle lapse, stay alive and watched; - an older epoch never fences a newer one; - no fencing without its own lease row (off or unregistered), and an idle prover creates its row on demand; - a stopped boot is gone; - process-group stamps stay unprovable; - idle issues zero statements, and one upsert renews only while records are held; - **a 45 s outage:** quiesced, no exit, resumes; - **a renewal that never answers:** bounded, and the boot exits on time; - **a 70 s outage:** exits at 60–65 s, and the successor recovers the work exactly once; - fenced: stops; - the settle re-check; - graceful stop; off on a volume-exclusive Railway deployment, on for a stateless one, and the on/off override; - a running legacy run keeps the lease live. - Red, with the proof's instance check removed: the replaced-container, live, stopped and successor cases fail. - Wider: task-drain, idle-sleep, idle-local-work, owner-proof and ownership suites, plus the maintenance quiet-window tests. Server low-memory typecheck is clean. ## Risks - **Clock skew.** The proof compares a record's `updatedAt` (often the writer's clock) with the lease (database clock). The 30 s grace absorbs ordinary skew. - **A new exit path exists.** A server whose database is unreachable for more than 60 s while it holds work now exits, after first quiescing. This is the intended safety backstop. - **Bounded trailing activity.** A lease that holds work issues one statement every 30 s, plus at most one check when its work settles. An idle server issues none. - **Boots from before this release** have no row, and their records stay unprovable. The board "mark owner gone" action for those follows in a separate PR. ## Model Used - Anthropic Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with tool use. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 --- doc/execution-semantics.md | 38 + .../2026-11-07-phase2-reconciler-data.md | 5 +- .../migrations/0449_controller_instances.sql | 15 + ...{0443_snapshot.json => 0449_snapshot.json} | 10210 ++++++++-------- packages/db/src/migrations/meta/_journal.json | 7 + .../db/src/schema/controller_instances.ts | 28 + packages/db/src/schema/index.ts | 1 + .../controller-instance-lease.test.ts | 418 + .../maintenance-server-routes.test.ts | 7 +- server/src/index.ts | 13 +- .../src/services/controller-instance-lease.ts | 298 + .../services/controller-process-identity.ts | 14 + .../services/delivery-work-notifications.ts | 1 + server/src/services/owner-proof.ts | 33 + .../recovery/ownership-invariant-report.ts | 13 +- server/src/services/task-admission.ts | 23 +- 16 files changed, 6106 insertions(+), 5018 deletions(-) create mode 100644 packages/db/src/migrations/0449_controller_instances.sql rename packages/db/src/migrations/meta/{0443_snapshot.json => 0449_snapshot.json} (93%) create mode 100644 packages/db/src/schema/controller_instances.ts create mode 100644 server/src/__tests__/controller-instance-lease.test.ts create mode 100644 server/src/services/controller-instance-lease.ts diff --git a/doc/execution-semantics.md b/doc/execution-semantics.md index bca2cb3d3fa..6feaf0177f2 100644 --- a/doc/execution-semantics.md +++ b/doc/execution-semantics.md @@ -1877,6 +1877,44 @@ processes with no recorded host are left to the run's Stop control. The next release removes the fallback and treats every row with no recorded host as unprovable. +A server boot that holds work keeps a controller instance lease +(`controller_instances`): a row named by its boot id, with an epoch and a lease +on the database clock (90 s TTL). + +- **Renewal.** The shared delivery-work coordinator schedules it every 30 s, + only while the boot holds work. A single upsert both creates the row on first + use and extends the lease, but only if the boot stamped ownership in the last + 90 s or still has an in-progress record stamped with its boot id: an + environment lease or cleanup claim, a sandbox creation intent, a workspace + finalize attempt, or an agent lifecycle step. Otherwise the lease lapses and + the worker issues no statements until the next stamp, so an idle server's + database can sleep. +- **Renewal failure.** Each renewal has a 10 s bound. A failed or timed-out + renewal quiesces the boot: it reports a task drain and dispatches no new work. + If it renews again before anyone fences it, it resumes. It exits only if + renewal has kept failing for 60 s, counted from the first failed attempt's + start, while it still holds work. + +A record owned by the server process itself (a lease, claim or intent with no +recorded process group) that names a boot in another host or PID space is +judged through that boot's row: + +- `stopped`: the boot shut down cleanly, so the record's owner is gone. +- live lease: the owner is alive. +- otherwise, the boot's last sign of life is the later of its lease expiry and + the record's last write plus the TTL. A boot that resumes after an idle lapse + renews on its first stamp. + - Within 30 s after that, the owner still counts as alive, so the settle watch + re-checks it. + - After that, the prover fences the boot (only a newer epoch may), and the + owner is gone. A boot that held work has exited by then. +- no row (a boot from before the lease): the record stays unprovable. + +A record with a recorded process group stays unprovable across hosts, because +agent processes may outlive their server. The lease is off on Railway, which +proves a replaced deployment from its own identity, and when +`PAPERCLIP_CONTROLLER_INSTANCE_LEASE=off`. + The stranded-work pass closes the gap where issue state survives a crash but the wake/run path does not. The silent-run scan covers the separate case where a live process exists but has stopped producing observable output. Native finalization reconciliation (part of native recovery and the orphan diff --git a/doc/plans/2026-11-07-phase2-reconciler-data.md b/doc/plans/2026-11-07-phase2-reconciler-data.md index 8124091f5ee..753ade1cdeb 100644 --- a/doc/plans/2026-11-07-phase2-reconciler-data.md +++ b/doc/plans/2026-11-07-phase2-reconciler-data.md @@ -235,7 +235,10 @@ Phase 3 is not started. It needs a separate go-ahead. - **Daytona** is covered by one wave only (see "Daytona wave"). The first apparent content-ID mismatch was a misreading: CI run 42422571919 built target commit `a37a2e4`, not master. Local content IDs reproduce CI's for the same commit. - The remote, workspace-operation, sandbox and accounting kinds (see "Per-kind data"). -- **Follow-up: `environment.stop_retain.after_claim_before_stop` has no live coverage.** No chaos workload creates a stop-and-retain intent (a native workspace export resume on a sandbox), so the crash point is never reached. A workload that forces an export resume on Daytona would cover it. `environment.lease_release.after_provider_before_lease` is also unreached by native runs, which release through teardown. +- `environment.stop_retain.after_claim_before_stop` is covered since #20049 (`--daytona-reuse-lease`; passed in `cp-20261108T133351`). +- **Known gap: `environment.lease_release.after_provider_before_lease` is unreached on Daytona.** Native runs release their sandbox through teardown, not this path. Recorded, not pursued. +- **Known gap: orphans confirmed stopped while `canary/v2026.1108.0-canary.6` or `canary.7` ran.** #19964 shipped without #19976 for about three hours, and those orphans kept no durable marker, so they cannot be told apart from an intentional stop-and-retain. The provider's auto-delete bounds them. A stop still pending at upgrade is covered by #20043. Recorded, not pursued. +- A replaced container's stamp (Docker, Kubernetes, Fly, a rebooted host) is now provable through the controller instance lease (see `doc/execution-semantics.md`). Boots from before the lease remain unprovable. - Crash points that sit between two durable writes. Random waves hit 20 ms–1 s windows only by luck. The crash-point suite (Phase 5) is the tool for those. ## Reproduce diff --git a/packages/db/src/migrations/0449_controller_instances.sql b/packages/db/src/migrations/0449_controller_instances.sql new file mode 100644 index 00000000000..e202e7fcb06 --- /dev/null +++ b/packages/db/src/migrations/0449_controller_instances.sql @@ -0,0 +1,15 @@ +CREATE TABLE "controller_instances" ( + "boot_id" text PRIMARY KEY NOT NULL, + "epoch" bigserial NOT NULL, + "process_space" text NOT NULL, + "pid" integer NOT NULL, + "started_at" timestamp with time zone DEFAULT now() NOT NULL, + "renewed_at" timestamp with time zone DEFAULT now() NOT NULL, + "lease_expires_at" timestamp with time zone NOT NULL, + "fenced_at" timestamp with time zone, + "fenced_by_epoch" bigint, + "stopped_at" timestamp with time zone +); +--> statement-breakpoint +CREATE UNIQUE INDEX "controller_instances_epoch_idx" ON "controller_instances" USING btree ("epoch");--> statement-breakpoint +CREATE INDEX "controller_instances_lease_idx" ON "controller_instances" USING btree ("lease_expires_at"); \ No newline at end of file diff --git a/packages/db/src/migrations/meta/0443_snapshot.json b/packages/db/src/migrations/meta/0449_snapshot.json similarity index 93% rename from packages/db/src/migrations/meta/0443_snapshot.json rename to packages/db/src/migrations/meta/0449_snapshot.json index 432bdc6bb83..115776e68c6 100644 --- a/packages/db/src/migrations/meta/0443_snapshot.json +++ b/packages/db/src/migrations/meta/0449_snapshot.json @@ -1,6 +1,6 @@ { - "id": "93cbf124-1264-4bc3-a27d-b651ce9640e7", - "prevId": "b3f3d712-65da-4b5a-bbf5-3c22fe8aae40", + "id": "4bd9d289-9cb8-4262-9dd7-04ce2b6020c4", + "prevId": "360fef2e-1ac3-4ae8-92a2-245e544b61da", "version": "7", "dialect": "postgresql", "tables": { @@ -64,37 +64,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "accounting_runtime_baselines_agent_id_agents_id_fk": { "name": "accounting_runtime_baselines_agent_id_agents_id_fk", "tableFrom": "accounting_runtime_baselines", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "accounting_runtime_baselines_company_id_companies_id_fk": { "name": "accounting_runtime_baselines_company_id_companies_id_fk", "tableFrom": "accounting_runtime_baselines", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -200,9 +200,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "billing_invoice_lines_company_idx": { "name": "billing_invoice_lines_company_idx", @@ -221,50 +221,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "billing_invoice_lines_company_id_companies_id_fk": { "name": "billing_invoice_lines_company_id_companies_id_fk", "tableFrom": "billing_invoice_lines", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "billing_invoice_lines_invoice_id_billing_invoices_id_fk": { "name": "billing_invoice_lines_invoice_id_billing_invoices_id_fk", "tableFrom": "billing_invoice_lines", + "tableTo": "billing_invoices", "columnsFrom": [ "invoice_id" ], - "tableTo": "billing_invoices", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "billing_invoice_lines_cost_event_id_cost_events_id_fk": { "name": "billing_invoice_lines_cost_event_id_cost_events_id_fk", "tableFrom": "billing_invoice_lines", + "tableTo": "cost_events", "columnsFrom": [ "cost_event_id" ], - "tableTo": "cost_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -361,24 +361,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "billing_invoices_company_id_companies_id_fk": { "name": "billing_invoices_company_id_companies_id_fk", "tableFrom": "billing_invoices", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -491,9 +491,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_reservations_prompt_injection_idx": { "name": "budget_reservations_prompt_injection_idx", @@ -512,9 +512,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_reservations_decision_idx": { "name": "budget_reservations_decision_idx", @@ -533,9 +533,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_reservations_run_idx": { "name": "budget_reservations_run_idx", @@ -554,9 +554,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_reservations_active_idx": { "name": "budget_reservations_active_idx", @@ -581,51 +581,51 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"budget_reservations\".\"state\" = 'held'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "budget_reservations_company_id_companies_id_fk": { "name": "budget_reservations_company_id_companies_id_fk", "tableFrom": "budget_reservations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "budget_reservations_run_id_heartbeat_runs_id_fk": { "name": "budget_reservations_run_id_heartbeat_runs_id_fk", "tableFrom": "budget_reservations", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "budget_reservations_agent_id_agents_id_fk": { "name": "budget_reservations_agent_id_agents_id_fk", "tableFrom": "budget_reservations", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -764,9 +764,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_adjustments_event_idx": { "name": "cost_adjustments_event_idx", @@ -791,9 +791,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_adjustments_invoice_line_idx": { "name": "cost_adjustments_invoice_line_idx", @@ -812,50 +812,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "cost_adjustments_company_id_companies_id_fk": { "name": "cost_adjustments_company_id_companies_id_fk", "tableFrom": "cost_adjustments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "cost_adjustments_cost_event_id_cost_events_id_fk": { "name": "cost_adjustments_cost_event_id_cost_events_id_fk", "tableFrom": "cost_adjustments", + "tableTo": "cost_events", "columnsFrom": [ "cost_event_id" ], - "tableTo": "cost_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "cost_adjustments_invoice_line_id_billing_invoice_lines_id_fk": { "name": "cost_adjustments_invoice_line_id_billing_invoice_lines_id_fk", "tableFrom": "cost_adjustments", + "tableTo": "billing_invoice_lines", "columnsFrom": [ "invoice_line_id" ], - "tableTo": "billing_invoice_lines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -967,24 +967,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "provider_billing_snapshots_company_id_companies_id_fk": { "name": "provider_billing_snapshots_company_id_companies_id_fk", "tableFrom": "provider_billing_snapshots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -1094,9 +1094,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "run_usage_receipts_run_latest_idx": { "name": "run_usage_receipts_run_latest_idx", @@ -1121,37 +1121,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "run_usage_receipts_company_id_companies_id_fk": { "name": "run_usage_receipts_company_id_companies_id_fk", "tableFrom": "run_usage_receipts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "run_usage_receipts_run_id_heartbeat_runs_id_fk": { "name": "run_usage_receipts_run_id_heartbeat_runs_id_fk", "tableFrom": "run_usage_receipts", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -1263,9 +1263,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_company_agent_created_idx": { "name": "activity_log_company_agent_created_idx", @@ -1290,9 +1290,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_company_responsible_user_created_idx": { "name": "activity_log_company_responsible_user_created_idx", @@ -1317,9 +1317,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_run_id_idx": { "name": "activity_log_run_id_idx", @@ -1332,9 +1332,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_entity_type_id_idx": { "name": "activity_log_entity_type_id_idx", @@ -1353,9 +1353,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_company_entity_created_idx": { "name": "activity_log_company_entity_created_idx", @@ -1386,9 +1386,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_company_user_issue_actor_idx": { "name": "activity_log_company_user_issue_actor_idx", @@ -1413,51 +1413,51 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"activity_log\".\"actor_type\" = 'user' AND \"activity_log\".\"entity_type\" = 'issue'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "activity_log_company_id_companies_id_fk": { "name": "activity_log_company_id_companies_id_fk", "tableFrom": "activity_log", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "activity_log_agent_id_agents_id_fk": { "name": "activity_log_agent_id_agents_id_fk", "tableFrom": "activity_log", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "activity_log_run_id_heartbeat_runs_id_fk": { "name": "activity_log_run_id_heartbeat_runs_id_fk", "tableFrom": "activity_log", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -1613,9 +1613,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_company_owner_adapter_active_uq": { "name": "adapter_auth_sessions_company_owner_adapter_active_uq", @@ -1640,10 +1640,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"adapter_auth_sessions\".\"status\" IN ('starting', 'waiting_for_user', 'promoting', 'awaiting_code', 'submitting')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "adapter_auth_sessions_public_session_id_uq": { "name": "adapter_auth_sessions_public_session_id_uq", @@ -1656,9 +1656,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_environment_idx": { "name": "adapter_auth_sessions_environment_idx", @@ -1671,9 +1671,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_expires_idx": { "name": "adapter_auth_sessions_expires_idx", @@ -1686,9 +1686,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_provider_lease_idx": { "name": "adapter_auth_sessions_provider_lease_idx", @@ -1701,37 +1701,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "adapter_auth_sessions_company_id_companies_id_fk": { "name": "adapter_auth_sessions_company_id_companies_id_fk", "tableFrom": "adapter_auth_sessions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "adapter_auth_sessions_environment_id_environments_id_fk": { "name": "adapter_auth_sessions_environment_id_environments_id_fk", "tableFrom": "adapter_auth_sessions", + "tableTo": "environments", "columnsFrom": [ "environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -1819,9 +1819,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_api_keys_company_agent_idx": { "name": "agent_api_keys_company_agent_idx", @@ -1840,37 +1840,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_api_keys_agent_id_agents_id_fk": { "name": "agent_api_keys_agent_id_agents_id_fk", "tableFrom": "agent_api_keys", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_api_keys_company_id_companies_id_fk": { "name": "agent_api_keys_company_id_companies_id_fk", "tableFrom": "agent_api_keys", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -1970,9 +1970,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_commentary_company_kind_created_idx": { "name": "agent_commentary_company_kind_created_idx", @@ -1997,63 +1997,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_commentary_company_id_companies_id_fk": { "name": "agent_commentary_company_id_companies_id_fk", "tableFrom": "agent_commentary", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "agent_commentary_agent_id_agents_id_fk": { "name": "agent_commentary_agent_id_agents_id_fk", "tableFrom": "agent_commentary", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "agent_commentary_run_id_heartbeat_runs_id_fk": { "name": "agent_commentary_run_id_heartbeat_runs_id_fk", "tableFrom": "agent_commentary", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "agent_commentary_issue_id_issues_id_fk": { "name": "agent_commentary_issue_id_issues_id_fk", "tableFrom": "agent_commentary", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -2166,9 +2166,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_config_revisions_agent_created_idx": { "name": "agent_config_revisions_agent_created_idx", @@ -2187,50 +2187,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_config_revisions_company_id_companies_id_fk": { "name": "agent_config_revisions_company_id_companies_id_fk", "tableFrom": "agent_config_revisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_config_revisions_agent_id_agents_id_fk": { "name": "agent_config_revisions_agent_id_agents_id_fk", "tableFrom": "agent_config_revisions", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "agent_config_revisions_created_by_agent_id_agents_id_fk": { "name": "agent_config_revisions_created_by_agent_id_agents_id_fk", "tableFrom": "agent_config_revisions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -2280,17 +2280,17 @@ "agent_file_roots_company_id_agent_id_agents_company_id_id_fk": { "name": "agent_file_roots_company_id_agent_id_agents_company_id_id_fk", "tableFrom": "agent_file_roots", + "tableTo": "agents", "columnsFrom": [ "company_id", "agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -2360,17 +2360,17 @@ "agent_identity_keys_owner_fk": { "name": "agent_identity_keys_owner_fk", "tableFrom": "agent_identity_keys", + "tableTo": "agents", "columnsFrom": [ "company_id", "agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -2425,33 +2425,33 @@ "agent_instruction_heads_company_id_agent_id_entry_file_revision_id_agent_instruction_revisions_company_id_agent_id_entry_file_id_fk": { "name": "agent_instruction_heads_company_id_agent_id_entry_file_revision_id_agent_instruction_revisions_company_id_agent_id_entry_file_id_fk", "tableFrom": "agent_instruction_heads", + "tableTo": "agent_instruction_revisions", "columnsFrom": [ "company_id", "agent_id", "entry_file", "revision_id" ], - "tableTo": "agent_instruction_revisions", "columnsTo": [ "company_id", "agent_id", "entry_file", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "agent_instruction_heads_identity_uq": { "name": "agent_instruction_heads_identity_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "agent_id", "entry_file" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -2597,39 +2597,39 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_instruction_revisions_company_id_agent_id_agents_company_id_id_fk": { "name": "agent_instruction_revisions_company_id_agent_id_agents_company_id_id_fk", "tableFrom": "agent_instruction_revisions", + "tableTo": "agents", "columnsFrom": [ "company_id", "agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "agent_instruction_revisions_identity_uq": { "name": "agent_instruction_revisions_identity_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "agent_id", "entry_file", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -2789,10 +2789,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "NOT (coalesce(\"agent_instruction_working_copies\".\"receipt\", '{}'::jsonb) ? 'retainedByRunId') AND (\n (\"agent_instruction_working_copies\".\"attempts\" < 3 AND (\"agent_instruction_working_copies\".\"state\" IN ('prepared', 'pending_collection', 'unchanged_turn', 'warm_saved')\n OR (\"agent_instruction_working_copies\".\"state\" = 'preparing' AND \"agent_instruction_working_copies\".\"receipt\"->>'schema' = 'paperclip.agent-files.v1')))\n OR (\"agent_instruction_working_copies\".\"state\" = 'unavailable' AND \"agent_instruction_working_copies\".\"process_stopped_at\" IS NULL\n AND \"agent_instruction_working_copies\".\"location\" LIKE 'remote:%' AND \"agent_instruction_working_copies\".\"receipt\"->>'schema' = 'paperclip.agent-files.v1'))", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_instruction_copies_cleanup_idx": { "name": "agent_instruction_copies_cleanup_idx", @@ -2811,10 +2811,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"agent_instruction_working_copies\".\"state\" IN ('saved', 'unchanged', 'resolved', 'unavailable')\n AND \"agent_instruction_working_copies\".\"process_stopped_at\" IS NOT NULL\n AND \"agent_instruction_working_copies\".\"receipt\"->>'schema' = 'paperclip.agent-files.v1'\n AND coalesce(\"agent_instruction_working_copies\".\"receipt\"->>'retainedByRunId', '') = ''\n AND \"agent_instruction_working_copies\".\"receipt\"->>'cleanupPending' IS DISTINCT FROM 'false'\n AND (\"agent_instruction_working_copies\".\"receipt\" ? 'baseline' OR \"agent_instruction_working_copies\".\"receipt\"->>'cleanupPending' = 'true')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_instruction_copies_pending_idx": { "name": "agent_instruction_copies_pending_idx", @@ -2833,9 +2833,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_instruction_copies_agent_idx": { "name": "agent_instruction_copies_agent_idx", @@ -2860,39 +2860,39 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_instruction_working_copies_run_id_heartbeat_runs_id_fk": { "name": "agent_instruction_working_copies_run_id_heartbeat_runs_id_fk", "tableFrom": "agent_instruction_working_copies", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "agent_instruction_working_copies_company_id_agent_id_agents_company_id_id_fk": { "name": "agent_instruction_working_copies_company_id_agent_id_agents_company_id_id_fk", "tableFrom": "agent_instruction_working_copies", + "tableTo": "agents", "columnsFrom": [ "company_id", "agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -2976,9 +2976,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_memberships_company_user_starred_idx": { "name": "agent_memberships_company_user_starred_idx", @@ -3003,9 +3003,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_memberships_agent_idx": { "name": "agent_memberships_agent_idx", @@ -3018,9 +3018,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_memberships_company_user_agent_uq": { "name": "agent_memberships_company_user_agent_uq", @@ -3045,37 +3045,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_memberships_company_id_companies_id_fk": { "name": "agent_memberships_company_id_companies_id_fk", "tableFrom": "agent_memberships", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "agent_memberships_agent_id_agents_id_fk": { "name": "agent_memberships_agent_id_agents_id_fk", "tableFrom": "agent_memberships", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -3198,9 +3198,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_runtime_state_company_updated_idx": { "name": "agent_runtime_state_company_updated_idx", @@ -3219,37 +3219,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_runtime_state_agent_id_agents_id_fk": { "name": "agent_runtime_state_agent_id_agents_id_fk", "tableFrom": "agent_runtime_state", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_runtime_state_company_id_companies_id_fk": { "name": "agent_runtime_state_company_id_companies_id_fk", "tableFrom": "agent_runtime_state", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -3363,9 +3363,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_session_goal_actions_company_status_created_idx": { "name": "agent_session_goal_actions_company_status_created_idx", @@ -3390,9 +3390,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_session_goal_actions_session_created_idx": { "name": "agent_session_goal_actions_session_created_idx", @@ -3411,37 +3411,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_session_goal_actions_company_id_companies_id_fk": { "name": "agent_session_goal_actions_company_id_companies_id_fk", "tableFrom": "agent_session_goal_actions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_session_goal_actions_session_id_agent_task_sessions_id_fk": { "name": "agent_session_goal_actions_session_id_agent_task_sessions_id_fk", "tableFrom": "agent_session_goal_actions", + "tableTo": "agent_task_sessions", "columnsFrom": [ "session_id" ], - "tableTo": "agent_task_sessions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -3603,9 +3603,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_task_sessions_company_agent_updated_idx": { "name": "agent_task_sessions_company_agent_updated_idx", @@ -3630,9 +3630,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_task_sessions_company_task_updated_idx": { "name": "agent_task_sessions_company_task_updated_idx", @@ -3657,50 +3657,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_task_sessions_company_id_companies_id_fk": { "name": "agent_task_sessions_company_id_companies_id_fk", "tableFrom": "agent_task_sessions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_task_sessions_agent_id_agents_id_fk": { "name": "agent_task_sessions_agent_id_agents_id_fk", "tableFrom": "agent_task_sessions", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_task_sessions_last_run_id_heartbeat_runs_id_fk": { "name": "agent_task_sessions_last_run_id_heartbeat_runs_id_fk", "tableFrom": "agent_task_sessions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "last_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -3852,10 +3852,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'task-retry:%'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_company_agent_status_idx": { "name": "agent_wakeup_requests_company_agent_status_idx", @@ -3880,9 +3880,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_wakeup_requests_company_requested_idx": { "name": "agent_wakeup_requests_company_requested_idx", @@ -3901,9 +3901,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_wakeup_requests_agent_requested_idx": { "name": "agent_wakeup_requests_agent_requested_idx", @@ -3922,9 +3922,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_wakeup_requests_review_path_recovery_idempotency_uq": { "name": "agent_wakeup_requests_review_path_recovery_idempotency_uq", @@ -3943,10 +3943,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'issue_review_path_lost:%' AND \"agent_wakeup_requests\".\"status\" <> 'skipped'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_disposition_repair_idempotency_uq": { "name": "agent_wakeup_requests_disposition_repair_idempotency_uq", @@ -3965,10 +3965,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'issue_disposition_repair:%' AND \"agent_wakeup_requests\".\"status\" <> 'skipped'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_question_response_delivery_idempotency_uq": { "name": "agent_wakeup_requests_question_response_delivery_idempotency_uq", @@ -3987,10 +3987,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "(\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'question-response:%' OR \"agent_wakeup_requests\".\"idempotency_key\" LIKE 'interaction:%') AND \"agent_wakeup_requests\".\"status\" NOT IN ('skipped', 'failed', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_question_response_history_idx": { "name": "agent_wakeup_requests_question_response_history_idx", @@ -4009,10 +4009,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'question-response:%'", - "concurrently": true + "concurrently": true, + "method": "btree", + "with": {} }, "agent_wakeup_requests_connection_intent_delivery_idempotency_uq": { "name": "agent_wakeup_requests_connection_intent_delivery_idempotency_uq", @@ -4031,10 +4031,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'connection-intent:%' AND \"agent_wakeup_requests\".\"status\" NOT IN ('skipped', 'failed', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_tool_action_delivery_uq": { "name": "agent_wakeup_requests_tool_action_delivery_uq", @@ -4053,10 +4053,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'tool-action-response:%' AND \"agent_wakeup_requests\".\"status\" NOT IN ('skipped', 'failed', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_tree_hold_resume_uq": { "name": "agent_wakeup_requests_tree_hold_resume_uq", @@ -4075,10 +4075,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'tree-hold-resume:%' AND \"agent_wakeup_requests\".\"status\" <> 'skipped'", - "concurrently": true + "concurrently": true, + "method": "btree", + "with": {} }, "agent_wakeup_requests_chat_completion_uq": { "name": "agent_wakeup_requests_chat_completion_uq", @@ -4097,10 +4097,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'chat-completion:%'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "agent_wakeup_requests_company_payload_issue_idx": { "name": "agent_wakeup_requests_company_payload_issue_idx", @@ -4113,43 +4113,43 @@ }, { "expression": "(\"payload\" ->> 'issueId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agent_wakeup_requests_company_id_companies_id_fk": { "name": "agent_wakeup_requests_company_id_companies_id_fk", "tableFrom": "agent_wakeup_requests", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agent_wakeup_requests_agent_id_agents_id_fk": { "name": "agent_wakeup_requests_agent_id_agents_id_fk", "tableFrom": "agent_wakeup_requests", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -4252,6 +4252,18 @@ "primaryKey": false, "notNull": false }, + "harness_verified_digest": { + "name": "harness_verified_digest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "harness_verified_at": { + "name": "harness_verified_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, "reports_to": { "name": "reports_to", "type": "uuid", @@ -4393,9 +4405,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agents_company_status_idx": { "name": "agents_company_status_idx", @@ -4414,9 +4426,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agents_company_reports_to_idx": { "name": "agents_company_reports_to_idx", @@ -4435,9 +4447,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agents_company_default_environment_idx": { "name": "agents_company_default_environment_idx", @@ -4456,61 +4468,61 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "agents_company_id_companies_id_fk": { "name": "agents_company_id_companies_id_fk", "tableFrom": "agents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agents_reports_to_agents_id_fk": { "name": "agents_reports_to_agents_id_fk", "tableFrom": "agents", + "tableTo": "agents", "columnsFrom": [ "reports_to" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "agents_default_environment_id_environments_id_fk": { "name": "agents_default_environment_id_environments_id_fk", "tableFrom": "agents", + "tableTo": "environments", "columnsFrom": [ "default_environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "agents_company_id_uq": { "name": "agents_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -4596,39 +4608,39 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "ai_connection_defaults_company_id_companies_id_fk": { "name": "ai_connection_defaults_company_id_companies_id_fk", "tableFrom": "ai_connection_defaults", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_defaults_company_grant_fk": { "name": "ai_connection_defaults_company_grant_fk", "tableFrom": "ai_connection_defaults", + "tableTo": "connection_grants", "columnsFrom": [ "company_id", "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -4701,54 +4713,54 @@ "ai_connection_pools_id_tool_connections_id_fk": { "name": "ai_connection_pools_id_tool_connections_id_fk", "tableFrom": "ai_connection_pools", + "tableTo": "tool_connections", "columnsFrom": [ "id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_pools_company_id_companies_id_fk": { "name": "ai_connection_pools_company_id_companies_id_fk", "tableFrom": "ai_connection_pools", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_pools_company_connection_fk": { "name": "ai_connection_pools_company_connection_fk", "tableFrom": "ai_connection_pools", + "tableTo": "tool_connections", "columnsFrom": [ "company_id", "id" ], - "tableTo": "tool_connections", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "ai_connection_pools_company_id_uq": { "name": "ai_connection_pools_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -4790,43 +4802,43 @@ "ai_connection_router_cursors_pool_id_ai_connection_pools_id_fk": { "name": "ai_connection_router_cursors_pool_id_ai_connection_pools_id_fk", "tableFrom": "ai_connection_router_cursors", + "tableTo": "ai_connection_pools", "columnsFrom": [ "pool_id" ], - "tableTo": "ai_connection_pools", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_router_cursors_company_id_companies_id_fk": { "name": "ai_connection_router_cursors_company_id_companies_id_fk", "tableFrom": "ai_connection_router_cursors", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_router_cursors_company_pool_fk": { "name": "ai_connection_router_cursors_company_pool_fk", "tableFrom": "ai_connection_router_cursors", + "tableTo": "ai_connection_pools", "columnsFrom": [ "company_id", "pool_id" ], - "tableTo": "ai_connection_pools", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -4920,80 +4932,80 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "ai_connection_task_pins_company_id_companies_id_fk": { "name": "ai_connection_task_pins_company_id_companies_id_fk", "tableFrom": "ai_connection_task_pins", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_task_pins_pool_id_ai_connection_pools_id_fk": { "name": "ai_connection_task_pins_pool_id_ai_connection_pools_id_fk", "tableFrom": "ai_connection_task_pins", + "tableTo": "ai_connection_pools", "columnsFrom": [ "pool_id" ], - "tableTo": "ai_connection_pools", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_task_pins_agent_id_agents_id_fk": { "name": "ai_connection_task_pins_agent_id_agents_id_fk", "tableFrom": "ai_connection_task_pins", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_task_pins_company_pool_fk": { "name": "ai_connection_task_pins_company_pool_fk", "tableFrom": "ai_connection_task_pins", + "tableTo": "ai_connection_pools", "columnsFrom": [ "company_id", "pool_id" ], - "tableTo": "ai_connection_pools", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_connection_task_pins_company_agent_fk": { "name": "ai_connection_task_pins_company_agent_fk", "tableFrom": "ai_connection_task_pins", + "tableTo": "agents", "columnsFrom": [ "company_id", "agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5069,39 +5081,39 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "ai_provider_defaults_company_id_companies_id_fk": { "name": "ai_provider_defaults_company_id_companies_id_fk", "tableFrom": "ai_provider_defaults", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_provider_defaults_company_grant_fk": { "name": "ai_provider_defaults_company_grant_fk", "tableFrom": "ai_provider_defaults", + "tableTo": "connection_grants", "columnsFrom": [ "company_id", "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5175,9 +5187,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscription_connections_credential_idx": { "name": "ai_subscription_connections_credential_idx", @@ -5196,9 +5208,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscription_connections_account_idx": { "name": "ai_subscription_connections_account_idx", @@ -5217,63 +5229,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "ai_subscription_connections_company_id_companies_id_fk": { "name": "ai_subscription_connections_company_id_companies_id_fk", "tableFrom": "ai_subscription_connections", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_subscription_connections_connection_id_tool_connections_id_fk": { "name": "ai_subscription_connections_connection_id_tool_connections_id_fk", "tableFrom": "ai_subscription_connections", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_subscription_connections_grant_id_connection_grants_id_fk": { "name": "ai_subscription_connections_grant_id_connection_grants_id_fk", "tableFrom": "ai_subscription_connections", + "tableTo": "connection_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_subscription_connections_subscription_id_ai_subscriptions_id_fk": { "name": "ai_subscription_connections_subscription_id_ai_subscriptions_id_fk", "tableFrom": "ai_subscription_connections", + "tableTo": "ai_subscriptions", "columnsFrom": [ "subscription_id" ], - "tableTo": "ai_subscriptions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5382,9 +5394,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscription_prices_company_idx": { "name": "ai_subscription_prices_company_idx", @@ -5397,37 +5409,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "ai_subscription_prices_company_id_companies_id_fk": { "name": "ai_subscription_prices_company_id_companies_id_fk", "tableFrom": "ai_subscription_prices", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_subscription_prices_subscription_id_ai_subscriptions_id_fk": { "name": "ai_subscription_prices_subscription_id_ai_subscriptions_id_fk", "tableFrom": "ai_subscription_prices", + "tableTo": "ai_subscriptions", "columnsFrom": [ "subscription_id" ], - "tableTo": "ai_subscriptions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5566,9 +5578,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscriptions_company_idx": { "name": "ai_subscriptions_company_idx", @@ -5581,37 +5593,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "ai_subscriptions_company_id_companies_id_fk": { "name": "ai_subscriptions_company_id_companies_id_fk", "tableFrom": "ai_subscriptions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "ai_subscriptions_merged_into_id_ai_subscriptions_id_fk": { "name": "ai_subscriptions_merged_into_id_ai_subscriptions_id_fk", "tableFrom": "ai_subscriptions", + "tableTo": "ai_subscriptions", "columnsFrom": [ "merged_into_id" ], - "tableTo": "ai_subscriptions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5752,9 +5764,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "approval_comments_approval_idx": { "name": "approval_comments_approval_idx", @@ -5767,9 +5779,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "approval_comments_approval_created_idx": { "name": "approval_comments_approval_created_idx", @@ -5788,50 +5800,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "approval_comments_company_id_companies_id_fk": { "name": "approval_comments_company_id_companies_id_fk", "tableFrom": "approval_comments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "approval_comments_approval_id_approvals_id_fk": { "name": "approval_comments_approval_id_approvals_id_fk", "tableFrom": "approval_comments", + "tableTo": "approvals", "columnsFrom": [ "approval_id" ], - "tableTo": "approvals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "approval_comments_author_agent_id_agents_id_fk": { "name": "approval_comments_author_agent_id_agents_id_fk", "tableFrom": "approval_comments", + "tableTo": "agents", "columnsFrom": [ "author_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5939,10 +5951,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"approvals\".\"status\" = 'pending'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "approvals_company_status_type_idx": { "name": "approvals_company_status_type_idx", @@ -5967,37 +5979,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "approvals_company_id_companies_id_fk": { "name": "approvals_company_id_companies_id_fk", "tableFrom": "approvals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "approvals_requested_by_agent_id_agents_id_fk": { "name": "approvals_requested_by_agent_id_agents_id_fk", "tableFrom": "approvals", + "tableTo": "agents", "columnsFrom": [ "requested_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -6104,9 +6116,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "assets_company_provider_idx": { "name": "assets_company_provider_idx", @@ -6125,9 +6137,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "assets_company_object_key_uq": { "name": "assets_company_object_key_uq", @@ -6146,37 +6158,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "assets_company_id_companies_id_fk": { "name": "assets_company_id_companies_id_fk", "tableFrom": "assets", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "assets_created_by_agent_id_agents_id_fk": { "name": "assets_created_by_agent_id_agents_id_fk", "tableFrom": "assets", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -6292,24 +6304,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "account_user_id_user_id_fk": { "name": "account_user_id_user_id_fk", "tableFrom": "account", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -6376,15 +6388,15 @@ "session_user_id_user_id_fk": { "name": "session_user_id_user_id_fk", "tableFrom": "session", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -6565,9 +6577,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "board_api_keys_user_idx": { "name": "board_api_keys_user_idx", @@ -6580,24 +6592,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "board_api_keys_user_id_user_id_fk": { "name": "board_api_keys_user_id_user_id_fk", "tableFrom": "board_api_keys", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -6668,9 +6680,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_browsers_session_idx": { "name": "browser_use_browsers_session_idx", @@ -6683,37 +6695,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "browser_use_browsers_company_id_companies_id_fk": { "name": "browser_use_browsers_company_id_companies_id_fk", "tableFrom": "browser_use_browsers", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_browsers_session_id_browser_use_sessions_id_fk": { "name": "browser_use_browsers_session_id_browser_use_sessions_id_fk", "tableFrom": "browser_use_browsers", + "tableTo": "browser_use_sessions", "columnsFrom": [ "session_id" ], - "tableTo": "browser_use_sessions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -6835,9 +6847,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_runs_provider_uq": { "name": "browser_use_runs_provider_uq", @@ -6850,9 +6862,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_runs_session_idx": { "name": "browser_use_runs_session_idx", @@ -6865,50 +6877,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "browser_use_runs_company_id_companies_id_fk": { "name": "browser_use_runs_company_id_companies_id_fk", "tableFrom": "browser_use_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_runs_session_id_browser_use_sessions_id_fk": { "name": "browser_use_runs_session_id_browser_use_sessions_id_fk", "tableFrom": "browser_use_runs", + "tableTo": "browser_use_sessions", "columnsFrom": [ "session_id" ], - "tableTo": "browser_use_sessions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_runs_heartbeat_run_id_heartbeat_runs_id_fk": { "name": "browser_use_runs_heartbeat_run_id_heartbeat_runs_id_fk", "tableFrom": "browser_use_runs", + "tableTo": "heartbeat_runs", "columnsFrom": [ "heartbeat_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -7041,9 +7053,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_sessions_provider_uq": { "name": "browser_use_sessions_provider_uq", @@ -7056,76 +7068,76 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "browser_use_sessions_company_id_companies_id_fk": { "name": "browser_use_sessions_company_id_companies_id_fk", "tableFrom": "browser_use_sessions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_sessions_issue_id_issues_id_fk": { "name": "browser_use_sessions_issue_id_issues_id_fk", "tableFrom": "browser_use_sessions", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_sessions_agent_id_agents_id_fk": { "name": "browser_use_sessions_agent_id_agents_id_fk", "tableFrom": "browser_use_sessions", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_sessions_connection_id_tool_connections_id_fk": { "name": "browser_use_sessions_connection_id_tool_connections_id_fk", "tableFrom": "browser_use_sessions", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_sessions_grant_id_connection_grants_id_fk": { "name": "browser_use_sessions_grant_id_connection_grants_id_fk", "tableFrom": "browser_use_sessions", + "tableTo": "connection_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -7169,28 +7181,28 @@ "browser_use_settings_grant_id_connection_grants_id_fk": { "name": "browser_use_settings_grant_id_connection_grants_id_fk", "tableFrom": "browser_use_settings", + "tableTo": "connection_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "browser_use_settings_company_id_companies_id_fk": { "name": "browser_use_settings_company_id_companies_id_fk", "tableFrom": "browser_use_settings", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -7260,9 +7272,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_evaluation_work_agent_pending_idx": { "name": "budget_evaluation_work_agent_pending_idx", @@ -7287,9 +7299,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_evaluation_work_project_pending_idx": { "name": "budget_evaluation_work_project_pending_idx", @@ -7314,24 +7326,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "budget_evaluation_work_company_id_companies_id_fk": { "name": "budget_evaluation_work_company_id_companies_id_fk", "tableFrom": "budget_evaluation_work", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -7469,9 +7481,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_incidents_company_scope_idx": { "name": "budget_incidents_company_scope_idx", @@ -7502,9 +7514,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_incidents_policy_window_threshold_idx": { "name": "budget_incidents_policy_window_threshold_idx", @@ -7529,51 +7541,51 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"budget_incidents\".\"status\" = 'open'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "budget_incidents_company_id_companies_id_fk": { "name": "budget_incidents_company_id_companies_id_fk", "tableFrom": "budget_incidents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "budget_incidents_policy_id_budget_policies_id_fk": { "name": "budget_incidents_policy_id_budget_policies_id_fk", "tableFrom": "budget_incidents", + "tableTo": "budget_policies", "columnsFrom": [ "policy_id" ], - "tableTo": "budget_policies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "budget_incidents_approval_id_approvals_id_fk": { "name": "budget_incidents_approval_id_approvals_id_fk", "tableFrom": "budget_incidents", + "tableTo": "approvals", "columnsFrom": [ "approval_id" ], - "tableTo": "approvals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -7751,9 +7763,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_policies_company_window_idx": { "name": "budget_policies_company_window_idx", @@ -7778,9 +7790,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_policies_company_scope_metric_unique_idx": { "name": "budget_policies_company_scope_metric_unique_idx", @@ -7817,24 +7829,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "budget_policies_company_id_companies_id_fk": { "name": "budget_policies_company_id_companies_id_fk", "tableFrom": "budget_policies", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -7935,9 +7947,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "built_in_managed_resources_resource_idx": { "name": "built_in_managed_resources_resource_idx", @@ -7956,9 +7968,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "built_in_managed_resources_company_bundle_resource_uq": { "name": "built_in_managed_resources_company_bundle_resource_uq", @@ -7989,24 +8001,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "built_in_managed_resources_company_id_companies_id_fk": { "name": "built_in_managed_resources_company_id_companies_id_fk", "tableFrom": "built_in_managed_resources", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -8082,9 +8094,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_access_sources_company_case_idx": { "name": "case_access_sources_company_case_idx", @@ -8103,37 +8115,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_access_sources_company_id_companies_id_fk": { "name": "case_access_sources_company_id_companies_id_fk", "tableFrom": "case_access_sources", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_access_sources_case_id_cases_id_fk": { "name": "case_access_sources_case_id_cases_id_fk", "tableFrom": "case_access_sources", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -8209,9 +8221,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_attachments_asset_uq": { "name": "case_attachments_asset_uq", @@ -8224,50 +8236,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_attachments_company_id_companies_id_fk": { "name": "case_attachments_company_id_companies_id_fk", "tableFrom": "case_attachments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_attachments_case_id_cases_id_fk": { "name": "case_attachments_case_id_cases_id_fk", "tableFrom": "case_attachments", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_attachments_asset_id_assets_id_fk": { "name": "case_attachments_asset_id_assets_id_fk", "tableFrom": "case_attachments", + "tableTo": "assets", "columnsFrom": [ "asset_id" ], - "tableTo": "assets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -8350,9 +8362,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_documents_document_uq": { "name": "case_documents_document_uq", @@ -8365,9 +8377,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_documents_company_case_updated_idx": { "name": "case_documents_company_case_updated_idx", @@ -8392,50 +8404,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_documents_company_id_companies_id_fk": { "name": "case_documents_company_id_companies_id_fk", "tableFrom": "case_documents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_documents_case_id_cases_id_fk": { "name": "case_documents_case_id_cases_id_fk", "tableFrom": "case_documents", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_documents_document_id_documents_id_fk": { "name": "case_documents_document_id_documents_id_fk", "tableFrom": "case_documents", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -8537,9 +8549,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_events_company_case_idx": { "name": "case_events_company_case_idx", @@ -8558,50 +8570,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_events_company_id_companies_id_fk": { "name": "case_events_company_id_companies_id_fk", "tableFrom": "case_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_events_case_id_cases_id_fk": { "name": "case_events_case_id_cases_id_fk", "tableFrom": "case_events", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_events_actor_agent_id_agents_id_fk": { "name": "case_events_actor_agent_id_agents_id_fk", "tableFrom": "case_events", + "tableTo": "agents", "columnsFrom": [ "actor_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -8870,9 +8882,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_handoffs_actor_idempotency_uq": { "name": "case_handoffs_actor_idempotency_uq", @@ -8903,9 +8915,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_handoffs_pending_case_uq": { "name": "case_handoffs_pending_case_uq", @@ -8918,10 +8930,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"case_handoffs\".\"state\" in ('awaiting_release', 'pending_dispatch', 'awaiting_completion')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "case_handoffs_pending_issue_uq": { "name": "case_handoffs_pending_issue_uq", @@ -8934,10 +8946,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"case_handoffs\".\"state\" in ('awaiting_release', 'pending_dispatch', 'awaiting_completion')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "case_handoffs_pending_attempt_idx": { "name": "case_handoffs_pending_attempt_idx", @@ -8950,10 +8962,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"case_handoffs\".\"state\" in ('awaiting_release', 'pending_dispatch')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "case_handoffs_case_created_idx": { "name": "case_handoffs_case_created_idx", @@ -8972,9 +8984,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_handoffs_source_run_idx": { "name": "case_handoffs_source_run_idx", @@ -8993,10 +9005,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"case_handoffs\".\"source_run_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "case_handoffs_wakeup_request_uq": { "name": "case_handoffs_wakeup_request_uq", @@ -9009,76 +9021,76 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_handoffs_company_id_companies_id_fk": { "name": "case_handoffs_company_id_companies_id_fk", "tableFrom": "case_handoffs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_handoffs_case_id_cases_id_fk": { "name": "case_handoffs_case_id_cases_id_fk", "tableFrom": "case_handoffs", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_handoffs_issue_id_issues_id_fk": { "name": "case_handoffs_issue_id_issues_id_fk", "tableFrom": "case_handoffs", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "case_handoffs_from_agent_id_agents_id_fk": { "name": "case_handoffs_from_agent_id_agents_id_fk", "tableFrom": "case_handoffs", + "tableTo": "agents", "columnsFrom": [ "from_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "case_handoffs_to_agent_id_agents_id_fk": { "name": "case_handoffs_to_agent_id_agents_id_fk", "tableFrom": "case_handoffs", + "tableTo": "agents", "columnsFrom": [ "to_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -9178,9 +9190,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_issue_links_company_case_idx": { "name": "case_issue_links_company_case_idx", @@ -9199,9 +9211,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_issue_links_issue_idx": { "name": "case_issue_links_issue_idx", @@ -9214,50 +9226,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_issue_links_company_id_companies_id_fk": { "name": "case_issue_links_company_id_companies_id_fk", "tableFrom": "case_issue_links", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_issue_links_case_id_cases_id_fk": { "name": "case_issue_links_case_id_cases_id_fk", "tableFrom": "case_issue_links", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_issue_links_issue_id_issues_id_fk": { "name": "case_issue_links_issue_id_issues_id_fk", "tableFrom": "case_issue_links", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -9333,9 +9345,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_labels_company_case_idx": { "name": "case_labels_company_case_idx", @@ -9354,9 +9366,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_labels_label_idx": { "name": "case_labels_label_idx", @@ -9369,50 +9381,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "case_labels_company_id_companies_id_fk": { "name": "case_labels_company_id_companies_id_fk", "tableFrom": "case_labels", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_labels_case_id_cases_id_fk": { "name": "case_labels_case_id_cases_id_fk", "tableFrom": "case_labels", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "case_labels_label_id_labels_id_fk": { "name": "case_labels_label_id_labels_id_fk", "tableFrom": "case_labels", + "tableTo": "labels", "columnsFrom": [ "label_id" ], - "tableTo": "labels", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -9576,9 +9588,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_identifier_uq": { "name": "cases_identifier_uq", @@ -9591,9 +9603,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_work_issue_uq": { "name": "cases_work_issue_uq", @@ -9606,10 +9618,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"cases\".\"work_issue_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "cases_company_type_key_uq": { "name": "cases_company_type_key_uq", @@ -9634,9 +9646,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_company_status_idx": { "name": "cases_company_status_idx", @@ -9655,9 +9667,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_company_type_idx": { "name": "cases_company_type_idx", @@ -9676,9 +9688,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_company_project_idx": { "name": "cases_company_project_idx", @@ -9697,9 +9709,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_parent_idx": { "name": "cases_parent_idx", @@ -9712,9 +9724,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_title_search_idx": { "name": "cases_title_search_idx", @@ -9728,9 +9740,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "cases_identifier_search_idx": { "name": "cases_identifier_search_idx", @@ -9744,9 +9756,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "cases_summary_search_idx": { "name": "cases_summary_search_idx", @@ -9760,89 +9772,89 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} } }, "foreignKeys": { "cases_company_id_companies_id_fk": { "name": "cases_company_id_companies_id_fk", "tableFrom": "cases", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "cases_project_id_projects_id_fk": { "name": "cases_project_id_projects_id_fk", "tableFrom": "cases", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "cases_work_issue_id_issues_id_fk": { "name": "cases_work_issue_id_issues_id_fk", "tableFrom": "cases", + "tableTo": "issues", "columnsFrom": [ "work_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "cases_workflow_id_workflows_id_fk": { "name": "cases_workflow_id_workflows_id_fk", "tableFrom": "cases", + "tableTo": "workflows", "columnsFrom": [ "workflow_id" ], - "tableTo": "workflows", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "cases_parent_case_id_cases_id_fk": { "name": "cases_parent_case_id_cases_id_fk", "tableFrom": "cases", + "tableTo": "cases", "columnsFrom": [ "parent_case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "cases_created_by_agent_id_agents_id_fk": { "name": "cases_created_by_agent_id_agents_id_fk", "tableFrom": "cases", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -9962,10 +9974,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_actions\".\"kind\" = 'interaction_wakeup' AND \"chat_actions\".\"status\" IN ('issued', 'processing')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_actions_confirmation_recovery_idx": { "name": "chat_actions_confirmation_recovery_idx", @@ -9984,10 +9996,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_actions\".\"kind\" = 'confirmation_response' AND \"chat_actions\".\"status\" = 'processing'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_actions_provider_action_uq": { "name": "chat_actions_provider_action_uq", @@ -10006,9 +10018,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_actions_github_stale_head_idx": { "name": "chat_actions_github_stale_head_idx", @@ -10027,16 +10039,16 @@ }, { "expression": "(\"payload\"->'event'->>'deliveryId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_actions\".\"kind\" = 'github_review_check'\n and \"chat_actions\".\"status\" = 'cancelled' and \"chat_actions\".\"result\"->>'code' = 'stale_head'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_actions_github_check_work_idx": { "name": "chat_actions_github_check_work_idx", @@ -10049,10 +10061,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_actions\".\"kind\" = 'github_review_check'\n and (\"chat_actions\".\"status\" = 'received' or (\"chat_actions\".\"status\" = 'failed' and \"chat_actions\".\"result\"->>'retryable' = 'true'))", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_actions_github_terminal_work_idx": { "name": "chat_actions_github_terminal_work_idx", @@ -10065,10 +10077,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_actions\".\"kind\" = 'github_response_comment'\n and \"chat_actions\".\"status\" = 'processed' and \"chat_actions\".\"delivery_id\" is not null\n and coalesce(\"chat_actions\".\"result\"->>'final', 'false') <> 'true'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_actions_github_ack_work_idx": { "name": "chat_actions_github_ack_work_idx", @@ -10081,98 +10093,98 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_actions\".\"kind\" = 'github_response_comment'\n and \"chat_actions\".\"delivery_id\" is not null and coalesce(\"chat_actions\".\"result\"->>'final', 'false') <> 'true'\n and (\"chat_actions\".\"status\" = 'received' or (\"chat_actions\".\"status\" = 'failed' and \"chat_actions\".\"result\"->>'retryable' = 'true'))", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "chat_actions_company_id_companies_id_fk": { "name": "chat_actions_company_id_companies_id_fk", "tableFrom": "chat_actions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_actions_delivery_id_chat_deliveries_id_fk": { "name": "chat_actions_delivery_id_chat_deliveries_id_fk", "tableFrom": "chat_actions", + "tableTo": "chat_deliveries", "columnsFrom": [ "delivery_id" ], - "tableTo": "chat_deliveries", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_actions_company_delivery_fk": { "name": "chat_actions_company_delivery_fk", "tableFrom": "chat_actions", + "tableTo": "chat_deliveries", "columnsFrom": [ "company_id", "delivery_id" ], - "tableTo": "chat_deliveries", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_actions_company_conversation_fk": { "name": "chat_actions_company_conversation_fk", "tableFrom": "chat_actions", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_actions_company_principal_fk": { "name": "chat_actions_company_principal_fk", "tableFrom": "chat_actions", + "tableTo": "chat_external_principals", "columnsFrom": [ "company_id", "principal_id" ], - "tableTo": "chat_external_principals", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_actions_company_endpoint_fk": { "name": "chat_actions_company_endpoint_fk", "tableFrom": "chat_actions", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -10270,54 +10282,54 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_agent_routes_company_id_companies_id_fk": { "name": "chat_agent_routes_company_id_companies_id_fk", "tableFrom": "chat_agent_routes", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_agent_routes_company_source_fk": { "name": "chat_agent_routes_company_source_fk", "tableFrom": "chat_agent_routes", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "source_endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_agent_routes_company_destination_fk": { "name": "chat_agent_routes_company_destination_fk", "tableFrom": "chat_agent_routes", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "destination_endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -10457,9 +10469,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_conversations_thread_uq": { "name": "chat_conversations_thread_uq", @@ -10490,106 +10502,106 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_conversations_company_id_companies_id_fk": { "name": "chat_conversations_company_id_companies_id_fk", "tableFrom": "chat_conversations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_conversations_resource_id_chat_endpoint_resources_id_fk": { "name": "chat_conversations_resource_id_chat_endpoint_resources_id_fk", "tableFrom": "chat_conversations", + "tableTo": "chat_endpoint_resources", "columnsFrom": [ "resource_id" ], - "tableTo": "chat_endpoint_resources", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_conversations_issue_id_issues_id_fk": { "name": "chat_conversations_issue_id_issues_id_fk", "tableFrom": "chat_conversations", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "chat_conversations_company_issue_fk": { "name": "chat_conversations_company_issue_fk", "tableFrom": "chat_conversations", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_conversations_company_endpoint_fk": { "name": "chat_conversations_company_endpoint_fk", "tableFrom": "chat_conversations", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_conversations_company_resource_fk": { "name": "chat_conversations_company_resource_fk", "tableFrom": "chat_conversations", + "tableTo": "chat_endpoint_resources", "columnsFrom": [ "company_id", "resource_id" ], - "tableTo": "chat_endpoint_resources", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_conversations_company_id_uq": { "name": "chat_conversations_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -10732,9 +10744,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_deliveries_event_uq": { "name": "chat_deliveries_event_uq", @@ -10753,9 +10765,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_deliveries_dedupe_uq": { "name": "chat_deliveries_dedupe_uq", @@ -10774,106 +10786,106 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_deliveries_company_id_companies_id_fk": { "name": "chat_deliveries_company_id_companies_id_fk", "tableFrom": "chat_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_deliveries_conversation_id_chat_conversations_id_fk": { "name": "chat_deliveries_conversation_id_chat_conversations_id_fk", "tableFrom": "chat_deliveries", + "tableTo": "chat_conversations", "columnsFrom": [ "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_deliveries_principal_id_chat_external_principals_id_fk": { "name": "chat_deliveries_principal_id_chat_external_principals_id_fk", "tableFrom": "chat_deliveries", + "tableTo": "chat_external_principals", "columnsFrom": [ "principal_id" ], - "tableTo": "chat_external_principals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_deliveries_company_endpoint_fk": { "name": "chat_deliveries_company_endpoint_fk", "tableFrom": "chat_deliveries", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_deliveries_company_conversation_fk": { "name": "chat_deliveries_company_conversation_fk", "tableFrom": "chat_deliveries", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_deliveries_company_principal_fk": { "name": "chat_deliveries_company_principal_fk", "tableFrom": "chat_deliveries", + "tableTo": "chat_external_principals", "columnsFrom": [ "company_id", "principal_id" ], - "tableTo": "chat_external_principals", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_deliveries_company_id_uq": { "name": "chat_deliveries_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -10959,9 +10971,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoint_leases_expiry_idx": { "name": "chat_endpoint_leases_expiry_idx", @@ -10974,39 +10986,39 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_endpoint_leases_company_id_companies_id_fk": { "name": "chat_endpoint_leases_company_id_companies_id_fk", "tableFrom": "chat_endpoint_leases", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_endpoint_leases_company_endpoint_fk": { "name": "chat_endpoint_leases_company_endpoint_fk", "tableFrom": "chat_endpoint_leases", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -11134,9 +11146,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoint_resources_external_uq": { "name": "chat_endpoint_resources_external_uq", @@ -11161,50 +11173,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_endpoint_resources_company_id_companies_id_fk": { "name": "chat_endpoint_resources_company_id_companies_id_fk", "tableFrom": "chat_endpoint_resources", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_endpoint_resources_company_endpoint_fk": { "name": "chat_endpoint_resources_company_endpoint_fk", "tableFrom": "chat_endpoint_resources", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_endpoint_resources_company_id_uq": { "name": "chat_endpoint_resources_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -11452,9 +11464,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_agent_idx": { "name": "chat_endpoints_agent_idx", @@ -11473,9 +11485,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_status_idx": { "name": "chat_endpoints_status_idx", @@ -11494,9 +11506,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_public_id_uq": { "name": "chat_endpoints_public_id_uq", @@ -11509,9 +11521,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_agentmail_inbox_uq": { "name": "chat_endpoints_agentmail_inbox_uq", @@ -11524,10 +11536,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_endpoints\".\"provider\" = 'agentmail' and \"chat_endpoints\".\"status\" != 'archived' and \"chat_endpoints\".\"bot_external_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_endpoints_connection_uq": { "name": "chat_endpoints_connection_uq", @@ -11540,9 +11552,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_live_bot_external_uq": { "name": "chat_endpoints_live_bot_external_uq", @@ -11567,10 +11579,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_endpoints\".\"status\" in ('verifying', 'active', 'paused', 'attention')\n and \"chat_endpoints\".\"provider_account_id\" is not null\n and \"chat_endpoints\".\"bot_external_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_endpoints_photon_number_uq": { "name": "chat_endpoints_photon_number_uq", @@ -11583,10 +11595,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_endpoints\".\"provider\" = 'imessage-photon' and \"chat_endpoints\".\"status\" <> 'archived' and \"chat_endpoints\".\"bot_external_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_endpoints_live_discord_bot_external_uq": { "name": "chat_endpoints_live_discord_bot_external_uq", @@ -11605,10 +11617,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_endpoints\".\"provider\" = 'discord'\n and \"chat_endpoints\".\"status\" in ('verifying', 'active', 'paused', 'attention')\n and \"chat_endpoints\".\"bot_external_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_endpoints_live_global_app_bot_external_uq": { "name": "chat_endpoints_live_global_app_bot_external_uq", @@ -11627,10 +11639,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_endpoints\".\"provider\" in ('github', 'microsoft-teams')\n and \"chat_endpoints\".\"status\" in ('verifying', 'active', 'paused', 'attention')\n and \"chat_endpoints\".\"bot_external_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_endpoints_live_bot_username_uq": { "name": "chat_endpoints_live_bot_username_uq", @@ -11655,79 +11667,79 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_endpoints\".\"status\" in ('verifying', 'active', 'paused', 'attention')\n and \"chat_endpoints\".\"provider_account_id\" is not null\n and \"chat_endpoints\".\"bot_username\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "chat_endpoints_company_id_companies_id_fk": { "name": "chat_endpoints_company_id_companies_id_fk", "tableFrom": "chat_endpoints", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_endpoints_assigned_agent_id_agents_id_fk": { "name": "chat_endpoints_assigned_agent_id_agents_id_fk", "tableFrom": "chat_endpoints", + "tableTo": "agents", "columnsFrom": [ "assigned_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "chat_endpoints_company_agent_fk": { "name": "chat_endpoints_company_agent_fk", "tableFrom": "chat_endpoints", + "tableTo": "agents", "columnsFrom": [ "company_id", "assigned_agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_endpoints_company_connection_fk": { "name": "chat_endpoints_company_connection_fk", "tableFrom": "chat_endpoints", + "tableTo": "tool_connections", "columnsFrom": [ "company_id", "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_endpoints_company_id_uq": { "name": "chat_endpoints_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -11863,9 +11875,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_external_principals_external_uq": { "name": "chat_external_principals_external_uq", @@ -11896,35 +11908,35 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_external_principals_company_id_companies_id_fk": { "name": "chat_external_principals_company_id_companies_id_fk", "tableFrom": "chat_external_principals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_external_principals_company_id_uq": { "name": "chat_external_principals_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -12039,9 +12051,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_identity_links_endpoint_principal_uq": { "name": "chat_identity_links_endpoint_principal_uq", @@ -12060,54 +12072,54 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_identity_links_company_id_companies_id_fk": { "name": "chat_identity_links_company_id_companies_id_fk", "tableFrom": "chat_identity_links", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_identity_links_company_endpoint_fk": { "name": "chat_identity_links_company_endpoint_fk", "tableFrom": "chat_identity_links", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_identity_links_company_principal_fk": { "name": "chat_identity_links_company_principal_fk", "tableFrom": "chat_identity_links", + "tableTo": "chat_external_principals", "columnsFrom": [ "company_id", "principal_id" ], - "tableTo": "chat_external_principals", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -12212,138 +12224,138 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_message_links_company_id_companies_id_fk": { "name": "chat_message_links_company_id_companies_id_fk", "tableFrom": "chat_message_links", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_message_links_delivery_id_chat_deliveries_id_fk": { "name": "chat_message_links_delivery_id_chat_deliveries_id_fk", "tableFrom": "chat_message_links", + "tableTo": "chat_deliveries", "columnsFrom": [ "delivery_id" ], - "tableTo": "chat_deliveries", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_message_links_publication_id_chat_publications_id_fk": { "name": "chat_message_links_publication_id_chat_publications_id_fk", "tableFrom": "chat_message_links", + "tableTo": "chat_publications", "columnsFrom": [ "publication_id" ], - "tableTo": "chat_publications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_message_links_comment_id_issue_comments_id_fk": { "name": "chat_message_links_comment_id_issue_comments_id_fk", "tableFrom": "chat_message_links", + "tableTo": "issue_comments", "columnsFrom": [ "comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_message_links_company_endpoint_fk": { "name": "chat_message_links_company_endpoint_fk", "tableFrom": "chat_message_links", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_message_links_company_delivery_fk": { "name": "chat_message_links_company_delivery_fk", "tableFrom": "chat_message_links", + "tableTo": "chat_deliveries", "columnsFrom": [ "company_id", "delivery_id" ], - "tableTo": "chat_deliveries", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_message_links_company_publication_fk": { "name": "chat_message_links_company_publication_fk", "tableFrom": "chat_message_links", + "tableTo": "chat_publications", "columnsFrom": [ "company_id", "publication_id" ], - "tableTo": "chat_publications", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_message_links_company_comment_fk": { "name": "chat_message_links_company_comment_fk", "tableFrom": "chat_message_links", + "tableTo": "issue_comments", "columnsFrom": [ "company_id", "comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_message_links_company_conversation_fk": { "name": "chat_message_links_company_conversation_fk", "tableFrom": "chat_message_links", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -12487,9 +12499,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_publications_work_idx": { "name": "chat_publications_work_idx", @@ -12508,9 +12520,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_publications_comment_destination_idx": { "name": "chat_publications_comment_destination_idx", @@ -12541,10 +12553,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_publications\".\"comment_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_publications_idempotency_uq": { "name": "chat_publications_idempotency_uq", @@ -12563,110 +12575,110 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_publications_company_id_companies_id_fk": { "name": "chat_publications_company_id_companies_id_fk", "tableFrom": "chat_publications", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_publications_issue_id_issues_id_fk": { "name": "chat_publications_issue_id_issues_id_fk", "tableFrom": "chat_publications", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "chat_publications_comment_id_issue_comments_id_fk": { "name": "chat_publications_comment_id_issue_comments_id_fk", "tableFrom": "chat_publications", + "tableTo": "issue_comments", "columnsFrom": [ "comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_publications_company_issue_fk": { "name": "chat_publications_company_issue_fk", "tableFrom": "chat_publications", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_publications_company_comment_fk": { "name": "chat_publications_company_comment_fk", "tableFrom": "chat_publications", + "tableTo": "issue_comments", "columnsFrom": [ "company_id", "comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_publications_company_endpoint_fk": { "name": "chat_publications_company_endpoint_fk", "tableFrom": "chat_publications", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_publications_company_conversation_fk": { "name": "chat_publications_company_conversation_fk", "tableFrom": "chat_publications", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -12761,9 +12773,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_sdk_state_expiry_idx": { "name": "chat_sdk_state_expiry_idx", @@ -12776,39 +12788,39 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_sdk_state_company_id_companies_id_fk": { "name": "chat_sdk_state_company_id_companies_id_fk", "tableFrom": "chat_sdk_state", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_sdk_state_company_endpoint_fk": { "name": "chat_sdk_state_company_endpoint_fk", "tableFrom": "chat_sdk_state", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -12911,9 +12923,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_completion_deliveries_pending_idx": { "name": "chat_completion_deliveries_pending_idx", @@ -12932,63 +12944,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_completion_deliveries_company_id_companies_id_fk": { "name": "chat_completion_deliveries_company_id_companies_id_fk", "tableFrom": "chat_completion_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_completion_deliveries_task_id_chat_task_handoffs_task_id_fk": { "name": "chat_completion_deliveries_task_id_chat_task_handoffs_task_id_fk", "tableFrom": "chat_completion_deliveries", + "tableTo": "chat_task_handoffs", "columnsFrom": [ "task_id" ], - "tableTo": "chat_task_handoffs", "columnsTo": [ "task_id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_completion_deliveries_target_run_id_heartbeat_runs_id_fk": { "name": "chat_completion_deliveries_target_run_id_heartbeat_runs_id_fk", "tableFrom": "chat_completion_deliveries", + "tableTo": "heartbeat_runs", "columnsFrom": [ "target_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_completion_deliveries_response_comment_id_issue_comments_id_fk": { "name": "chat_completion_deliveries_response_comment_id_issue_comments_id_fk", "tableFrom": "chat_completion_deliveries", + "tableTo": "issue_comments", "columnsFrom": [ "response_comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -13057,63 +13069,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_task_handoffs_task_id_issues_id_fk": { "name": "chat_task_handoffs_task_id_issues_id_fk", "tableFrom": "chat_task_handoffs", + "tableTo": "issues", "columnsFrom": [ "task_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_task_handoffs_company_id_companies_id_fk": { "name": "chat_task_handoffs_company_id_companies_id_fk", "tableFrom": "chat_task_handoffs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_task_handoffs_conversation_id_issues_id_fk": { "name": "chat_task_handoffs_conversation_id_issues_id_fk", "tableFrom": "chat_task_handoffs", + "tableTo": "issues", "columnsFrom": [ "conversation_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_task_handoffs_agent_id_agents_id_fk": { "name": "chat_task_handoffs_agent_id_agents_id_fk", "tableFrom": "chat_task_handoffs", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -13226,17 +13238,17 @@ "chat_github_configurations_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "chat_github_configurations_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "chat_github_configurations", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -13355,9 +13367,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_github_registration_endpoint_idx": { "name": "chat_github_registration_endpoint_idx", @@ -13376,26 +13388,26 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_github_registrations_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "chat_github_registrations_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "chat_github_registrations", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -13569,10 +13581,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_github_reviews\".\"state\" in ('queued', 'running')\n and \"chat_github_reviews\".\"assessment\" is null\n and \"chat_github_reviews\".\"delivery_id\" ~ '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_github_reviews_delivery_uq": { "name": "chat_github_reviews_delivery_uq", @@ -13591,9 +13603,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_github_reviews_pull_idx": { "name": "chat_github_reviews_pull_idx", @@ -13624,9 +13636,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_github_reviews_task_idx": { "name": "chat_github_reviews_task_idx", @@ -13651,65 +13663,65 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_github_reviews_run_id_heartbeat_runs_id_fk": { "name": "chat_github_reviews_run_id_heartbeat_runs_id_fk", "tableFrom": "chat_github_reviews", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "chat_github_reviews_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "chat_github_reviews_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "chat_github_reviews", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_github_reviews_company_id_issue_id_issues_company_id_id_fk": { "name": "chat_github_reviews_company_id_issue_id_issues_company_id_id_fk", "tableFrom": "chat_github_reviews", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_github_reviews_company_id_uq": { "name": "chat_github_reviews_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -13844,9 +13856,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_slack_manager_grants_owner_idx": { "name": "chat_slack_manager_grants_owner_idx", @@ -13877,24 +13889,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_slack_manager_grants_company_id_companies_id_fk": { "name": "chat_slack_manager_grants_company_id_companies_id_fk", "tableFrom": "chat_slack_manager_grants", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -14023,32 +14035,32 @@ "chat_slack_registrations_company_id_manager_grant_id_chat_slack_manager_grants_company_id_id_fk": { "name": "chat_slack_registrations_company_id_manager_grant_id_chat_slack_manager_grants_company_id_id_fk", "tableFrom": "chat_slack_registrations", + "tableTo": "chat_slack_manager_grants", "columnsFrom": [ "company_id", "manager_grant_id" ], - "tableTo": "chat_slack_manager_grants", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_slack_registrations_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "chat_slack_registrations_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "chat_slack_registrations", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -14312,9 +14324,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_teams_file_transfers_token_uq": { "name": "chat_teams_file_transfers_token_uq", @@ -14333,9 +14345,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_teams_file_transfers_work_idx": { "name": "chat_teams_file_transfers_work_idx", @@ -14360,97 +14372,97 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_teams_file_transfers_company_id_companies_id_fk": { "name": "chat_teams_file_transfers_company_id_companies_id_fk", "tableFrom": "chat_teams_file_transfers", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_teams_file_transfers_issue_id_issues_id_fk": { "name": "chat_teams_file_transfers_issue_id_issues_id_fk", "tableFrom": "chat_teams_file_transfers", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "chat_teams_file_transfers_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "chat_teams_file_transfers_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "chat_teams_file_transfers", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_teams_file_transfers_company_id_publication_id_chat_publications_company_id_id_fk": { "name": "chat_teams_file_transfers_company_id_publication_id_chat_publications_company_id_id_fk", "tableFrom": "chat_teams_file_transfers", + "tableTo": "chat_publications", "columnsFrom": [ "company_id", "publication_id" ], - "tableTo": "chat_publications", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_teams_file_transfers_company_id_conversation_id_chat_conversations_company_id_id_fk": { "name": "chat_teams_file_transfers_company_id_conversation_id_chat_conversations_company_id_id_fk", "tableFrom": "chat_teams_file_transfers", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_teams_file_transfers_company_id_principal_id_chat_external_principals_company_id_id_fk": { "name": "chat_teams_file_transfers_company_id_principal_id_chat_external_principals_company_id_id_fk", "tableFrom": "chat_teams_file_transfers", + "tableTo": "chat_external_principals", "columnsFrom": [ "company_id", "principal_id" ], - "tableTo": "chat_external_principals", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -14550,26 +14562,26 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_voice_callbacks_endpoint_fk": { "name": "chat_voice_callbacks_endpoint_fk", "tableFrom": "chat_voice_callbacks", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -14730,10 +14742,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_voice_inbound_calls\".\"cleanup_confirmed_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_voice_inbound_expiry_idx": { "name": "chat_voice_inbound_expiry_idx", @@ -14752,81 +14764,81 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_voice_inbound_endpoint_fk": { "name": "chat_voice_inbound_endpoint_fk", "tableFrom": "chat_voice_inbound_calls", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_voice_inbound_session_fk": { "name": "chat_voice_inbound_session_fk", "tableFrom": "chat_voice_inbound_calls", + "tableTo": "chat_voice_sessions", "columnsFrom": [ "company_id", "session_id" ], - "tableTo": "chat_voice_sessions", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_inbound_intake_fk": { "name": "chat_voice_inbound_intake_fk", "tableFrom": "chat_voice_inbound_calls", + "tableTo": "issues", "columnsFrom": [ "company_id", "intake_issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_inbound_requested_issue_fk": { "name": "chat_voice_inbound_requested_issue_fk", "tableFrom": "chat_voice_inbound_calls", + "tableTo": "issues", "columnsFrom": [ "company_id", "requested_issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_voice_inbound_provider_uq": { "name": "chat_voice_inbound_provider_uq", + "nullsNotDistinct": false, "columns": [ "provider_session_id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -14911,40 +14923,40 @@ "chat_voice_phone_lines_low_trust_environment_id_environments_id_fk": { "name": "chat_voice_phone_lines_low_trust_environment_id_environments_id_fk", "tableFrom": "chat_voice_phone_lines", + "tableTo": "environments", "columnsFrom": [ "low_trust_environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_phone_lines_endpoint_fk": { "name": "chat_voice_phone_lines_endpoint_fk", "tableFrom": "chat_voice_phone_lines", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_voice_phone_lines_number_uq": { "name": "chat_voice_phone_lines_number_uq", + "nullsNotDistinct": false, "columns": [ "provider_number_id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -15044,26 +15056,26 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_voice_reports_session_fk": { "name": "chat_voice_reports_session_fk", "tableFrom": "chat_voice_reports", + "tableTo": "chat_voice_sessions", "columnsFrom": [ "company_id", "session_id" ], - "tableTo": "chat_voice_sessions", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -15162,9 +15174,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_replies_cursor_uq": { "name": "chat_voice_replies_cursor_uq", @@ -15183,54 +15195,54 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_voice_replies_company_id_companies_id_fk": { "name": "chat_voice_replies_company_id_companies_id_fk", "tableFrom": "chat_voice_replies", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_voice_replies_session_fk": { "name": "chat_voice_replies_session_fk", "tableFrom": "chat_voice_replies", + "tableTo": "chat_voice_sessions", "columnsFrom": [ "company_id", "session_id" ], - "tableTo": "chat_voice_sessions", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_replies_publication_fk": { "name": "chat_voice_replies_publication_fk", "tableFrom": "chat_voice_replies", + "tableTo": "chat_publications", "columnsFrom": [ "company_id", "publication_id" ], - "tableTo": "chat_publications", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -15408,9 +15420,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_sessions_request_uq": { "name": "chat_voice_sessions_request_uq", @@ -15435,9 +15447,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_sessions_live_caller_task_uq": { "name": "chat_voice_sessions_live_caller_task_uq", @@ -15462,10 +15474,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"chat_voice_sessions\".\"state\" not in ('ended', 'failed', 'expired')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "chat_voice_sessions_expiry_idx": { "name": "chat_voice_sessions_expiry_idx", @@ -15484,9 +15496,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_sessions_report_window_idx": { "name": "chat_voice_sessions_report_window_idx", @@ -15505,96 +15517,96 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"chat_voice_sessions\".\"state\" in ('ended', 'failed', 'expired') and \"chat_voice_sessions\".\"provider_session_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "chat_voice_sessions_company_id_companies_id_fk": { "name": "chat_voice_sessions_company_id_companies_id_fk", "tableFrom": "chat_voice_sessions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_voice_sessions_endpoint_fk": { "name": "chat_voice_sessions_endpoint_fk", "tableFrom": "chat_voice_sessions", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_sessions_conversation_fk": { "name": "chat_voice_sessions_conversation_fk", "tableFrom": "chat_voice_sessions", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_sessions_issue_fk": { "name": "chat_voice_sessions_issue_fk", "tableFrom": "chat_voice_sessions", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_sessions_agent_fk": { "name": "chat_voice_sessions_agent_fk", "tableFrom": "chat_voice_sessions", + "tableTo": "agents", "columnsFrom": [ "company_id", "assigned_agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "chat_voice_sessions_company_id_uq": { "name": "chat_voice_sessions_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -15711,9 +15723,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_tool_calls_webhook_uq": { "name": "chat_voice_tool_calls_webhook_uq", @@ -15732,54 +15744,54 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "chat_voice_tool_calls_company_id_companies_id_fk": { "name": "chat_voice_tool_calls_company_id_companies_id_fk", "tableFrom": "chat_voice_tool_calls", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "chat_voice_tool_calls_session_fk": { "name": "chat_voice_tool_calls_session_fk", "tableFrom": "chat_voice_tool_calls", + "tableTo": "chat_voice_sessions", "columnsFrom": [ "company_id", "session_id" ], - "tableTo": "chat_voice_sessions", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "chat_voice_tool_calls_delivery_fk": { "name": "chat_voice_tool_calls_delivery_fk", "tableFrom": "chat_voice_tool_calls", + "tableTo": "chat_deliveries", "columnsFrom": [ "company_id", "delivery_id" ], - "tableTo": "chat_deliveries", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -15904,9 +15916,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cli_auth_challenges_approved_by_idx": { "name": "cli_auth_challenges_approved_by_idx", @@ -15919,9 +15931,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cli_auth_challenges_requested_company_idx": { "name": "cli_auth_challenges_requested_company_idx", @@ -15934,50 +15946,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "cli_auth_challenges_requested_company_id_companies_id_fk": { "name": "cli_auth_challenges_requested_company_id_companies_id_fk", "tableFrom": "cli_auth_challenges", + "tableTo": "companies", "columnsFrom": [ "requested_company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "cli_auth_challenges_approved_by_user_id_user_id_fk": { "name": "cli_auth_challenges_approved_by_user_id_user_id_fk", "tableFrom": "cli_auth_challenges", + "tableTo": "user", "columnsFrom": [ "approved_by_user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "cli_auth_challenges_board_api_key_id_board_api_keys_id_fk": { "name": "cli_auth_challenges_board_api_key_id_board_api_keys_id_fk", "tableFrom": "cli_auth_challenges", + "tableTo": "board_api_keys", "columnsFrom": [ "board_api_key_id" ], - "tableTo": "board_api_keys", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -16134,9 +16146,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -16196,9 +16208,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_logos_asset_uq": { "name": "company_logos_asset_uq", @@ -16211,37 +16223,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_logos_company_id_companies_id_fk": { "name": "company_logos_company_id_companies_id_fk", "tableFrom": "company_logos", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_logos_asset_id_assets_id_fk": { "name": "company_logos_asset_id_assets_id_fk", "tableFrom": "company_logos", + "tableTo": "assets", "columnsFrom": [ "asset_id" ], - "tableTo": "assets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -16331,9 +16343,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_memberships_principal_status_idx": { "name": "company_memberships_principal_status_idx", @@ -16358,9 +16370,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_memberships_company_status_idx": { "name": "company_memberships_company_status_idx", @@ -16379,24 +16391,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_memberships_company_id_companies_id_fk": { "name": "company_memberships_company_id_companies_id_fk", "tableFrom": "company_memberships", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -16479,28 +16491,28 @@ "company_observability_company_id_companies_id_fk": { "name": "company_observability_company_id_companies_id_fk", "tableFrom": "company_observability", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_observability_credentials_secret_id_company_secrets_id_fk": { "name": "company_observability_credentials_secret_id_company_secrets_id_fk", "tableFrom": "company_observability", + "tableTo": "company_secrets", "columnsFrom": [ "credentials_secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -16614,63 +16626,63 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_onboarding_seeds_company_id_companies_id_fk": { "name": "company_onboarding_seeds_company_id_companies_id_fk", "tableFrom": "company_onboarding_seeds", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_onboarding_seeds_goal_id_goals_id_fk": { "name": "company_onboarding_seeds_goal_id_goals_id_fk", "tableFrom": "company_onboarding_seeds", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_onboarding_seeds_agent_id_agents_id_fk": { "name": "company_onboarding_seeds_agent_id_agents_id_fk", "tableFrom": "company_onboarding_seeds", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_onboarding_seeds_issue_id_issues_id_fk": { "name": "company_onboarding_seeds_issue_id_issues_id_fk", "tableFrom": "company_onboarding_seeds", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -16780,9 +16792,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_bindings_secret_idx": { "name": "company_secret_bindings_secret_idx", @@ -16795,9 +16807,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_bindings_target_idx": { "name": "company_secret_bindings_target_idx", @@ -16822,9 +16834,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_bindings_target_path_uq": { "name": "company_secret_bindings_target_path_uq", @@ -16855,37 +16867,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_secret_bindings_company_id_companies_id_fk": { "name": "company_secret_bindings_company_id_companies_id_fk", "tableFrom": "company_secret_bindings", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "company_secret_bindings_secret_id_company_secrets_id_fk": { "name": "company_secret_bindings_secret_id_company_secrets_id_fk", "tableFrom": "company_secret_bindings", + "tableTo": "company_secrets", "columnsFrom": [ "secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -17120,9 +17132,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_proposer_status_idx": { "name": "company_secret_proposals_proposer_status_idx", @@ -17141,9 +17153,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_expiry_idx": { "name": "company_secret_proposals_expiry_idx", @@ -17162,9 +17174,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_secret_proposal_idx": { "name": "company_secret_proposals_secret_proposal_idx", @@ -17177,9 +17189,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_interaction_idx": { "name": "company_secret_proposals_interaction_idx", @@ -17192,128 +17204,128 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_secret_proposals_company_id_companies_id_fk": { "name": "company_secret_proposals_company_id_companies_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "company_secret_proposals_secret_id_company_secrets_id_fk": { "name": "company_secret_proposals_secret_id_company_secrets_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "company_secrets", "columnsFrom": [ "secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_secret_proposals_secret_proposal_id_company_secret_proposals_id_fk": { "name": "company_secret_proposals_secret_proposal_id_company_secret_proposals_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "company_secret_proposals", "columnsFrom": [ "secret_proposal_id" ], - "tableTo": "company_secret_proposals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secret_proposals_target_id_agents_id_fk": { "name": "company_secret_proposals_target_id_agents_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "agents", "columnsFrom": [ "target_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secret_proposals_proposed_by_agent_id_agents_id_fk": { "name": "company_secret_proposals_proposed_by_agent_id_agents_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "agents", "columnsFrom": [ "proposed_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secret_proposals_origin_issue_id_issues_id_fk": { "name": "company_secret_proposals_origin_issue_id_issues_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "issues", "columnsFrom": [ "origin_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_secret_proposals_origin_run_id_heartbeat_runs_id_fk": { "name": "company_secret_proposals_origin_run_id_heartbeat_runs_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "heartbeat_runs", "columnsFrom": [ "origin_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secret_proposals_interaction_id_issue_thread_interactions_id_fk": { "name": "company_secret_proposals_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_secret_proposals_created_secret_id_company_secrets_id_fk": { "name": "company_secret_proposals_created_secret_id_company_secrets_id_fk", "tableFrom": "company_secret_proposals", + "tableTo": "company_secrets", "columnsFrom": [ "created_secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -17458,9 +17470,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_provider_configs_company_provider_idx": { "name": "company_secret_provider_configs_company_provider_idx", @@ -17479,9 +17491,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_provider_configs_default_uq": { "name": "company_secret_provider_configs_default_uq", @@ -17500,38 +17512,38 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_secret_provider_configs\".\"is_default\" = true", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "company_secret_provider_configs_company_id_companies_id_fk": { "name": "company_secret_provider_configs_company_id_companies_id_fk", "tableFrom": "company_secret_provider_configs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secret_provider_configs_created_by_agent_id_agents_id_fk": { "name": "company_secret_provider_configs_created_by_agent_id_agents_id_fk", "tableFrom": "company_secret_provider_configs", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -17644,9 +17656,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_versions_value_sha256_idx": { "name": "company_secret_versions_value_sha256_idx", @@ -17659,9 +17671,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_versions_fingerprint_idx": { "name": "company_secret_versions_fingerprint_idx", @@ -17674,9 +17686,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_versions_secret_version_uq": { "name": "company_secret_versions_secret_version_uq", @@ -17695,37 +17707,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_secret_versions_secret_id_company_secrets_id_fk": { "name": "company_secret_versions_secret_id_company_secrets_id_fk", "tableFrom": "company_secret_versions", + "tableTo": "company_secrets", "columnsFrom": [ "secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secret_versions_created_by_agent_id_agents_id_fk": { "name": "company_secret_versions_created_by_agent_id_agents_id_fk", "tableFrom": "company_secret_versions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -17916,9 +17928,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_scope_idx": { "name": "company_secrets_company_scope_idx", @@ -17937,9 +17949,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_owner_idx": { "name": "company_secrets_company_owner_idx", @@ -17958,9 +17970,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_user_definition_owner_idx": { "name": "company_secrets_user_definition_owner_idx", @@ -17985,9 +17997,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_provider_idx": { "name": "company_secrets_company_provider_idx", @@ -18006,9 +18018,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_project_instance_owner_key_uq": { "name": "company_secrets_project_instance_owner_key_uq", @@ -18039,10 +18051,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_secrets\".\"scope\" = 'instance' and \"company_secrets\".\"deleted_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_secrets_instance_owner_key_uq": { "name": "company_secrets_instance_owner_key_uq", @@ -18073,10 +18085,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_secrets\".\"scope\" = 'instance' and \"company_secrets\".\"deleted_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_secrets_provider_config_idx": { "name": "company_secrets_provider_config_idx", @@ -18089,9 +18101,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_name_uq": { "name": "company_secrets_company_name_uq", @@ -18110,10 +18122,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_secrets\".\"scope\" = 'company' and \"company_secrets\".\"deleted_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_secrets_company_key_uq": { "name": "company_secrets_company_key_uq", @@ -18132,10 +18144,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_secrets\".\"scope\" = 'company' and \"company_secrets\".\"deleted_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_secrets_user_definition_owner_uq": { "name": "company_secrets_user_definition_owner_uq", @@ -18160,107 +18172,107 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_secrets\".\"scope\" = 'user' and \"company_secrets\".\"deleted_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "company_secrets_company_id_companies_id_fk": { "name": "company_secrets_company_id_companies_id_fk", "tableFrom": "company_secrets", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "company_secrets_owner_plugin_id_plugins_id_fk": { "name": "company_secrets_owner_plugin_id_plugins_id_fk", "tableFrom": "company_secrets", + "tableTo": "plugins", "columnsFrom": [ "owner_plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secrets_user_secret_definition_id_user_secret_definitions_id_fk": { "name": "company_secrets_user_secret_definition_id_user_secret_definitions_id_fk", "tableFrom": "company_secrets", + "tableTo": "user_secret_definitions", "columnsFrom": [ "user_secret_definition_id" ], - "tableTo": "user_secret_definitions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_secrets_provider_config_id_company_secret_provider_configs_id_fk": { "name": "company_secrets_provider_config_id_company_secret_provider_configs_id_fk", "tableFrom": "company_secrets", + "tableTo": "company_secret_provider_configs", "columnsFrom": [ "provider_config_id" ], - "tableTo": "company_secret_provider_configs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_secrets_created_by_agent_id_agents_id_fk": { "name": "company_secrets_created_by_agent_id_agents_id_fk", "tableFrom": "company_secrets", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_secrets_company_id_owner_agent_id_agents_company_id_id_fk": { "name": "company_secrets_company_id_owner_agent_id_agents_company_id_id_fk", "tableFrom": "company_secrets", + "tableTo": "agents", "columnsFrom": [ "company_id", "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_secrets_company_id_owner_project_id_projects_company_id_id_fk": { "name": "company_secrets_company_id_owner_project_id_projects_company_id_id_fk", "tableFrom": "company_secrets", + "tableTo": "projects", "columnsFrom": [ "company_id", "owner_project_id" ], - "tableTo": "projects", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -18330,15 +18342,15 @@ "company_skill_policies_company_id_companies_id_fk": { "name": "company_skill_policies_company_id_companies_id_fk", "tableFrom": "company_skill_policies", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -18377,15 +18389,15 @@ "company_skill_import_budgets_company_id_companies_id_fk": { "name": "company_skill_import_budgets_company_id_companies_id_fk", "tableFrom": "company_skill_import_budgets", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -18486,9 +18498,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_source_entries_company_skill_idx": { "name": "company_skill_source_entries_company_skill_idx", @@ -18507,50 +18519,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_source_entries_company_id_companies_id_fk": { "name": "company_skill_source_entries_company_id_companies_id_fk", "tableFrom": "company_skill_source_entries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_source_entries_source_id_company_skill_sources_id_fk": { "name": "company_skill_source_entries_source_id_company_skill_sources_id_fk", "tableFrom": "company_skill_source_entries", + "tableTo": "company_skill_sources", "columnsFrom": [ "source_id" ], - "tableTo": "company_skill_sources", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_source_entries_skill_id_company_skills_id_fk": { "name": "company_skill_source_entries_skill_id_company_skills_id_fk", "tableFrom": "company_skill_source_entries", + "tableTo": "company_skills", "columnsFrom": [ "skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -18794,10 +18806,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_skill_sources\".\"removed_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_skill_sources_identity_ref_idx": { "name": "company_skill_sources_identity_ref_idx", @@ -18822,25 +18834,25 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_skill_sources\".\"removed_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "company_skill_sources_company_id_companies_id_fk": { "name": "company_skill_sources_company_id_companies_id_fk", "tableFrom": "company_skill_sources", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19005,9 +19017,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_skill_sources_source_project_idx": { "name": "project_skill_sources_source_project_idx", @@ -19032,9 +19044,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_skill_sources_sync_idx": { "name": "project_skill_sources_sync_idx", @@ -19059,63 +19071,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "project_skill_sources_company_id_companies_id_fk": { "name": "project_skill_sources_company_id_companies_id_fk", "tableFrom": "project_skill_sources", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "project_skill_sources_project_id_projects_id_fk": { "name": "project_skill_sources_project_id_projects_id_fk", "tableFrom": "project_skill_sources", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "project_skill_sources_workspace_id_project_workspaces_id_fk": { "name": "project_skill_sources_workspace_id_project_workspaces_id_fk", "tableFrom": "project_skill_sources", + "tableTo": "project_workspaces", "columnsFrom": [ "workspace_id" ], - "tableTo": "project_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "project_skill_sources_source_id_company_skill_sources_id_fk": { "name": "project_skill_sources_source_id_company_skill_sources_id_fk", "tableFrom": "project_skill_sources", + "tableTo": "company_skill_sources", "columnsFrom": [ "source_id" ], - "tableTo": "company_skill_sources", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19216,9 +19228,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_comments_parent_idx": { "name": "company_skill_comments_parent_idx", @@ -19231,63 +19243,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_comments_company_id_companies_id_fk": { "name": "company_skill_comments_company_id_companies_id_fk", "tableFrom": "company_skill_comments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_comments_company_skill_id_company_skills_id_fk": { "name": "company_skill_comments_company_skill_id_company_skills_id_fk", "tableFrom": "company_skill_comments", + "tableTo": "company_skills", "columnsFrom": [ "company_skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_comments_parent_comment_id_company_skill_comments_id_fk": { "name": "company_skill_comments_parent_comment_id_company_skill_comments_id_fk", "tableFrom": "company_skill_comments", + "tableTo": "company_skill_comments", "columnsFrom": [ "parent_comment_id" ], - "tableTo": "company_skill_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_skill_comments_author_agent_id_agents_id_fk": { "name": "company_skill_comments_author_agent_id_agents_id_fk", "tableFrom": "company_skill_comments", + "tableTo": "agents", "columnsFrom": [ "author_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19362,24 +19374,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_mutation_receipts_company_id_companies_id_fk": { "name": "company_skill_mutation_receipts_company_id_companies_id_fk", "tableFrom": "company_skill_mutation_receipts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19482,9 +19494,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_snapshots_migration_idx": { "name": "company_skill_snapshots_migration_idx", @@ -19497,10 +19509,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"company_skill_repository_snapshots\".\"migration_at\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_skill_snapshots_maintenance_idx": { "name": "company_skill_snapshots_maintenance_idx", @@ -19513,25 +19525,25 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"company_skill_repository_snapshots\".\"maintenance_at\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "company_skill_repository_snapshots_company_id_companies_id_fk": { "name": "company_skill_repository_snapshots_company_id_companies_id_fk", "tableFrom": "company_skill_repository_snapshots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19601,9 +19613,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_stars_skill_user_idx": { "name": "company_skill_stars_skill_user_idx", @@ -19622,9 +19634,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_stars_company_skill_created_idx": { "name": "company_skill_stars_company_skill_created_idx", @@ -19649,50 +19661,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_stars_company_id_companies_id_fk": { "name": "company_skill_stars_company_id_companies_id_fk", "tableFrom": "company_skill_stars", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_stars_company_skill_id_company_skills_id_fk": { "name": "company_skill_stars_company_skill_id_company_skills_id_fk", "tableFrom": "company_skill_stars", + "tableTo": "company_skills", "columnsFrom": [ "company_skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_stars_agent_id_agents_id_fk": { "name": "company_skill_stars_agent_id_agents_id_fk", "tableFrom": "company_skill_stars", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19787,9 +19799,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_test_inputs_company_skill_active_idx": { "name": "company_skill_test_inputs_company_skill_active_idx", @@ -19814,37 +19826,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_test_inputs_company_id_companies_id_fk": { "name": "company_skill_test_inputs_company_id_companies_id_fk", "tableFrom": "company_skill_test_inputs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_test_inputs_skill_id_company_skills_id_fk": { "name": "company_skill_test_inputs_skill_id_company_skills_id_fk", "tableFrom": "company_skill_test_inputs", + "tableTo": "company_skills", "columnsFrom": [ "skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -19957,50 +19969,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_test_run_templates_company_id_companies_id_fk": { "name": "company_skill_test_run_templates_company_id_companies_id_fk", "tableFrom": "company_skill_test_run_templates", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_test_run_templates_created_by_agent_id_agents_id_fk": { "name": "company_skill_test_run_templates_created_by_agent_id_agents_id_fk", "tableFrom": "company_skill_test_run_templates", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_skill_test_run_templates_updated_by_agent_id_agents_id_fk": { "name": "company_skill_test_run_templates_updated_by_agent_id_agents_id_fk", "tableFrom": "company_skill_test_run_templates", + "tableTo": "agents", "columnsFrom": [ "updated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -20190,9 +20202,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_test_runs_company_issue_idx": { "name": "company_skill_test_runs_company_issue_idx", @@ -20211,9 +20223,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_test_runs_company_input_created_idx": { "name": "company_skill_test_runs_company_input_created_idx", @@ -20238,9 +20250,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_test_runs_company_status_idx": { "name": "company_skill_test_runs_company_status_idx", @@ -20259,9 +20271,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_test_runs_company_harness_expires_idx": { "name": "company_skill_test_runs_company_harness_expires_idx", @@ -20280,89 +20292,89 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_test_runs_company_id_companies_id_fk": { "name": "company_skill_test_runs_company_id_companies_id_fk", "tableFrom": "company_skill_test_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_test_runs_skill_id_company_skills_id_fk": { "name": "company_skill_test_runs_skill_id_company_skills_id_fk", "tableFrom": "company_skill_test_runs", + "tableTo": "company_skills", "columnsFrom": [ "skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_test_runs_input_id_company_skill_test_inputs_id_fk": { "name": "company_skill_test_runs_input_id_company_skill_test_inputs_id_fk", "tableFrom": "company_skill_test_runs", + "tableTo": "company_skill_test_inputs", "columnsFrom": [ "input_id" ], - "tableTo": "company_skill_test_inputs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_skill_test_runs_skill_version_id_company_skill_versions_id_fk": { "name": "company_skill_test_runs_skill_version_id_company_skill_versions_id_fk", "tableFrom": "company_skill_test_runs", + "tableTo": "company_skill_versions", "columnsFrom": [ "skill_version_id" ], - "tableTo": "company_skill_versions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "company_skill_test_runs_agent_id_agents_id_fk": { "name": "company_skill_test_runs_agent_id_agents_id_fk", "tableFrom": "company_skill_test_runs", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "company_skill_test_runs_issue_id_issues_id_fk": { "name": "company_skill_test_runs_issue_id_issues_id_fk", "tableFrom": "company_skill_test_runs", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -20494,10 +20506,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"company_skill_versions\".\"migration_at\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_skill_versions_package_snapshot_idx": { "name": "company_skill_versions_package_snapshot_idx", @@ -20510,9 +20522,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_versions_repository_snapshot_idx": { "name": "company_skill_versions_repository_snapshot_idx", @@ -20525,9 +20537,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_versions_skill_revision_idx": { "name": "company_skill_versions_skill_revision_idx", @@ -20546,9 +20558,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_versions_skill_release_idx": { "name": "company_skill_versions_skill_release_idx", @@ -20567,10 +20579,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"company_skill_versions\".\"release_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "company_skill_versions_company_skill_created_idx": { "name": "company_skill_versions_company_skill_created_idx", @@ -20595,76 +20607,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skill_versions_company_id_companies_id_fk": { "name": "company_skill_versions_company_id_companies_id_fk", "tableFrom": "company_skill_versions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_versions_company_skill_id_company_skills_id_fk": { "name": "company_skill_versions_company_skill_id_company_skills_id_fk", "tableFrom": "company_skill_versions", + "tableTo": "company_skills", "columnsFrom": [ "company_skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "company_skill_versions_repository_snapshot_id_company_skill_repository_snapshots_id_fk": { "name": "company_skill_versions_repository_snapshot_id_company_skill_repository_snapshots_id_fk", "tableFrom": "company_skill_versions", + "tableTo": "company_skill_repository_snapshots", "columnsFrom": [ "repository_snapshot_id" ], - "tableTo": "company_skill_repository_snapshots", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "company_skill_versions_package_snapshot_id_company_skill_repository_snapshots_id_fk": { "name": "company_skill_versions_package_snapshot_id_company_skill_repository_snapshots_id_fk", "tableFrom": "company_skill_versions", + "tableTo": "company_skill_repository_snapshots", "columnsFrom": [ "package_snapshot_id" ], - "tableTo": "company_skill_repository_snapshots", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "company_skill_versions_author_agent_id_agents_id_fk": { "name": "company_skill_versions_author_agent_id_agents_id_fk", "tableFrom": "company_skill_versions", + "tableTo": "agents", "columnsFrom": [ "author_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -20900,9 +20912,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_name_idx": { "name": "company_skills_company_name_idx", @@ -20921,9 +20933,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_folder_idx": { "name": "company_skills_company_folder_idx", @@ -20942,9 +20954,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_categories_idx": { "name": "company_skills_company_categories_idx", @@ -20957,9 +20969,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "company_skills_company_sharing_scope_idx": { "name": "company_skills_company_sharing_scope_idx", @@ -20978,9 +20990,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_current_version_idx": { "name": "company_skills_company_current_version_idx", @@ -20999,9 +21011,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_forked_from_idx": { "name": "company_skills_company_forked_from_idx", @@ -21020,76 +21032,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_skills_company_id_companies_id_fk": { "name": "company_skills_company_id_companies_id_fk", "tableFrom": "company_skills", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "company_skills_folder_id_folders_id_fk": { "name": "company_skills_folder_id_folders_id_fk", "tableFrom": "company_skills", + "tableTo": "folders", "columnsFrom": [ "folder_id" ], - "tableTo": "folders", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_skills_forked_from_skill_id_company_skills_id_fk": { "name": "company_skills_forked_from_skill_id_company_skills_id_fk", "tableFrom": "company_skills", + "tableTo": "company_skills", "columnsFrom": [ "forked_from_skill_id" ], - "tableTo": "company_skills", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_skills_forked_from_company_id_companies_id_fk": { "name": "company_skills_forked_from_company_id_companies_id_fk", "tableFrom": "company_skills", + "tableTo": "companies", "columnsFrom": [ "forked_from_company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "company_skills_current_version_id_company_skill_versions_id_fk": { "name": "company_skills_current_version_id_company_skill_versions_id_fk", "tableFrom": "company_skills", + "tableTo": "company_skill_versions", "columnsFrom": [ "current_version_id" ], - "tableTo": "company_skill_versions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -21158,9 +21170,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -21296,9 +21308,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_transfer_runs_idempotency_direction_idx": { "name": "company_transfer_runs_idempotency_direction_idx", @@ -21317,9 +21329,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_transfer_runs_actor_status_idx": { "name": "company_transfer_runs_actor_status_idx", @@ -21338,24 +21350,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_transfer_runs_company_id_companies_id_fk": { "name": "company_transfer_runs_company_id_companies_id_fk", "tableFrom": "company_transfer_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -21421,9 +21433,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_user_sidebar_preferences_user_idx": { "name": "company_user_sidebar_preferences_user_idx", @@ -21436,9 +21448,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_user_sidebar_preferences_company_user_uq": { "name": "company_user_sidebar_preferences_company_user_uq", @@ -21457,24 +21469,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "company_user_sidebar_preferences_company_id_companies_id_fk": { "name": "company_user_sidebar_preferences_company_id_companies_id_fk", "tableFrom": "company_user_sidebar_preferences", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -21598,9 +21610,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "completion_contracts_issue_hash_uq": { "name": "completion_contracts_issue_hash_uq", @@ -21619,68 +21631,68 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "completion_contracts_company_id_companies_id_fk": { "name": "completion_contracts_company_id_companies_id_fk", "tableFrom": "completion_contracts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "completion_contracts_issue_company_fk": { "name": "completion_contracts_issue_company_fk", "tableFrom": "completion_contracts", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "completion_contracts_supersedes_owner_fk": { "name": "completion_contracts_supersedes_owner_fk", "tableFrom": "completion_contracts", + "tableTo": "completion_contracts", "columnsFrom": [ "company_id", "issue_id", "supersedes_contract_id" ], - "tableTo": "completion_contracts", "columnsTo": [ "company_id", "issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "completion_contracts_company_issue_id_uq": { "name": "completion_contracts_company_issue_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "issue_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -21818,9 +21830,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_event_deliveries_company_status_idx": { "name": "connection_event_deliveries_company_status_idx", @@ -21845,24 +21857,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "connection_event_deliveries_company_id_companies_id_fk": { "name": "connection_event_deliveries_company_id_companies_id_fk", "tableFrom": "connection_event_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -21926,37 +21938,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "connection_intent_deliveries_interaction_id_issue_thread_interactions_id_fk": { "name": "connection_intent_deliveries_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "connection_intent_deliveries", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_intent_deliveries_company_id_companies_id_fk": { "name": "connection_intent_deliveries_company_id_companies_id_fk", "tableFrom": "connection_intent_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -21965,6 +21977,112 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "public.controller_instances": { + "name": "controller_instances", + "schema": "", + "columns": { + "boot_id": { + "name": "boot_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "epoch": { + "name": "epoch", + "type": "bigserial", + "primaryKey": false, + "notNull": true + }, + "process_space": { + "name": "process_space", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pid": { + "name": "pid", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "renewed_at": { + "name": "renewed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "lease_expires_at": { + "name": "lease_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "fenced_at": { + "name": "fenced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "fenced_by_epoch": { + "name": "fenced_by_epoch", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "stopped_at": { + "name": "stopped_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "controller_instances_epoch_idx": { + "name": "controller_instances_epoch_idx", + "columns": [ + { + "expression": "epoch", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "controller_instances_lease_idx": { + "name": "controller_instances_lease_idx", + "columns": [ + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "public.cost_events": { "name": "cost_events", "schema": "", @@ -22165,9 +22283,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_provider_request_idx": { "name": "cost_events_provider_request_idx", @@ -22192,9 +22310,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_project_occurred_idx": { "name": "cost_events_company_project_occurred_idx", @@ -22219,9 +22337,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_unpriced_idx": { "name": "cost_events_unpriced_idx", @@ -22246,10 +22364,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"cost_events\".\"cost_status\" = 'unpriced' and \"cost_events\".\"billing_type\" <> 'subscription_included'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "cost_events_data_quality_idx": { "name": "cost_events_data_quality_idx", @@ -22274,10 +22392,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"cost_events\".\"billing_type\" = 'unknown' or (\"cost_events\".\"cost_status\" = 'unpriced' and \"cost_events\".\"billing_type\" <> 'subscription_included')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "cost_events_company_occurred_idx": { "name": "cost_events_company_occurred_idx", @@ -22296,9 +22414,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_subscription_occurred_idx": { "name": "cost_events_company_subscription_occurred_idx", @@ -22323,9 +22441,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_agent_occurred_idx": { "name": "cost_events_company_agent_occurred_idx", @@ -22350,9 +22468,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_provider_occurred_idx": { "name": "cost_events_company_provider_occurred_idx", @@ -22377,9 +22495,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_biller_occurred_idx": { "name": "cost_events_company_biller_occurred_idx", @@ -22404,9 +22522,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_heartbeat_run_idx": { "name": "cost_events_company_heartbeat_run_idx", @@ -22425,102 +22543,102 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "cost_events_company_id_companies_id_fk": { "name": "cost_events_company_id_companies_id_fk", "tableFrom": "cost_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "cost_events_agent_id_agents_id_fk": { "name": "cost_events_agent_id_agents_id_fk", "tableFrom": "cost_events", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "cost_events_issue_id_issues_id_fk": { "name": "cost_events_issue_id_issues_id_fk", "tableFrom": "cost_events", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "cost_events_project_id_projects_id_fk": { "name": "cost_events_project_id_projects_id_fk", "tableFrom": "cost_events", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "cost_events_goal_id_goals_id_fk": { "name": "cost_events_goal_id_goals_id_fk", "tableFrom": "cost_events", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "cost_events_heartbeat_run_id_heartbeat_runs_id_fk": { "name": "cost_events_heartbeat_run_id_heartbeat_runs_id_fk", "tableFrom": "cost_events", + "tableTo": "heartbeat_runs", "columnsFrom": [ "heartbeat_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "cost_events_subscription_id_ai_subscriptions_id_fk": { "name": "cost_events_subscription_id_ai_subscriptions_id_fk", "tableFrom": "cost_events", + "tableTo": "ai_subscriptions", "columnsFrom": [ "subscription_id" ], - "tableTo": "ai_subscriptions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -22599,15 +22717,15 @@ "company_decision_models_company_id_companies_id_fk": { "name": "company_decision_models_company_id_companies_id_fk", "tableFrom": "company_decision_models", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -22803,9 +22921,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_invocations_pending_idx": { "name": "decision_invocations_pending_idx", @@ -22818,10 +22936,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"decision_invocations\".\"status\" = 'running'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "decision_invocations_cost_idx": { "name": "decision_invocations_cost_idx", @@ -22834,37 +22952,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_invocations_company_id_companies_id_fk": { "name": "decision_invocations_company_id_companies_id_fk", "tableFrom": "decision_invocations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_invocations_cost_event_id_cost_events_id_fk": { "name": "decision_invocations_cost_event_id_cost_events_id_fk", "tableFrom": "decision_invocations", + "tableTo": "cost_events", "columnsFrom": [ "cost_event_id" ], - "tableTo": "cost_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -23002,9 +23120,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_archive_notification_outbox_pending_idx": { "name": "decision_archive_notification_outbox_pending_idx", @@ -23023,9 +23141,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_archive_notification_outbox_delivery_idx": { "name": "decision_archive_notification_outbox_delivery_idx", @@ -23050,38 +23168,38 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"decision_archive_notification_outbox\".\"status\" = 'pending'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "decision_archive_notification_outbox_company_id_companies_id_fk": { "name": "decision_archive_notification_outbox_company_id_companies_id_fk", "tableFrom": "decision_archive_notification_outbox", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_archive_notification_outbox_origin_agent_id_agents_id_fk": { "name": "decision_archive_notification_outbox_origin_agent_id_agents_id_fk", "tableFrom": "decision_archive_notification_outbox", + "tableTo": "agents", "columnsFrom": [ "origin_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -23198,9 +23316,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_queue_items_company_source_idx": { "name": "decision_queue_items_company_source_idx", @@ -23225,78 +23343,78 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_queue_items_company_id_companies_id_fk": { "name": "decision_queue_items_company_id_companies_id_fk", "tableFrom": "decision_queue_items", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_queue_items_added_by_agent_id_agents_id_fk": { "name": "decision_queue_items_added_by_agent_id_agents_id_fk", "tableFrom": "decision_queue_items", + "tableTo": "agents", "columnsFrom": [ "added_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_queue_items_added_by_run_id_heartbeat_runs_id_fk": { "name": "decision_queue_items_added_by_run_id_heartbeat_runs_id_fk", "tableFrom": "decision_queue_items", + "tableTo": "heartbeat_runs", "columnsFrom": [ "added_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_queue_items_added_by_agent_api_key_id_agent_api_keys_id_fk": { "name": "decision_queue_items_added_by_agent_api_key_id_agent_api_keys_id_fk", "tableFrom": "decision_queue_items", + "tableTo": "agent_api_keys", "columnsFrom": [ "added_by_agent_api_key_id" ], - "tableTo": "agent_api_keys", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_queue_items_queue_company_fk": { "name": "decision_queue_items_queue_company_fk", "tableFrom": "decision_queue_items", + "tableTo": "decision_queues", "columnsFrom": [ "queue_id", "company_id" ], - "tableTo": "decision_queues", "columnsTo": [ "id", "company_id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -23428,9 +23546,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_queues_company_updated_idx": { "name": "decision_queues_company_updated_idx", @@ -23449,74 +23567,74 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_queues_company_id_companies_id_fk": { "name": "decision_queues_company_id_companies_id_fk", "tableFrom": "decision_queues", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_queues_created_by_agent_id_agents_id_fk": { "name": "decision_queues_created_by_agent_id_agents_id_fk", "tableFrom": "decision_queues", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_queues_created_by_run_id_heartbeat_runs_id_fk": { "name": "decision_queues_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "decision_queues", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_queues_created_by_agent_api_key_id_agent_api_keys_id_fk": { "name": "decision_queues_created_by_agent_api_key_id_agent_api_keys_id_fk", "tableFrom": "decision_queues", + "tableTo": "agent_api_keys", "columnsFrom": [ "created_by_agent_api_key_id" ], - "tableTo": "agent_api_keys", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "decision_queues_id_company_uq": { "name": "decision_queues_id_company_uq", + "nullsNotDistinct": false, "columns": [ "id", "company_id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -23663,9 +23781,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_retention_company_archived_idx": { "name": "decision_retention_company_archived_idx", @@ -23684,50 +23802,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_retention_company_id_companies_id_fk": { "name": "decision_retention_company_id_companies_id_fk", "tableFrom": "decision_retention", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_retention_archived_by_agent_id_agents_id_fk": { "name": "decision_retention_archived_by_agent_id_agents_id_fk", "tableFrom": "decision_retention", + "tableTo": "agents", "columnsFrom": [ "archived_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_retention_archived_by_run_id_heartbeat_runs_id_fk": { "name": "decision_retention_archived_by_run_id_heartbeat_runs_id_fk", "tableFrom": "decision_retention", + "tableTo": "heartbeat_runs", "columnsFrom": [ "archived_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -23870,9 +23988,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_triage_company_decide_by_idx": { "name": "decision_triage_company_decide_by_idx", @@ -23891,63 +24009,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_triage_company_id_companies_id_fk": { "name": "decision_triage_company_id_companies_id_fk", "tableFrom": "decision_triage", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_triage_set_by_agent_id_agents_id_fk": { "name": "decision_triage_set_by_agent_id_agents_id_fk", "tableFrom": "decision_triage", + "tableTo": "agents", "columnsFrom": [ "set_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_triage_set_by_run_id_heartbeat_runs_id_fk": { "name": "decision_triage_set_by_run_id_heartbeat_runs_id_fk", "tableFrom": "decision_triage", + "tableTo": "heartbeat_runs", "columnsFrom": [ "set_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_triage_set_by_agent_api_key_id_agent_api_keys_id_fk": { "name": "decision_triage_set_by_agent_api_key_id_agent_api_keys_id_fk", "tableFrom": "decision_triage", + "tableTo": "agent_api_keys", "columnsFrom": [ "set_by_agent_api_key_id" ], - "tableTo": "agent_api_keys", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -24087,9 +24205,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_triage_events_queue_created_idx": { "name": "decision_triage_events_queue_created_idx", @@ -24108,76 +24226,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_triage_events_company_id_companies_id_fk": { "name": "decision_triage_events_company_id_companies_id_fk", "tableFrom": "decision_triage_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_triage_events_queue_id_decision_queues_id_fk": { "name": "decision_triage_events_queue_id_decision_queues_id_fk", "tableFrom": "decision_triage_events", + "tableTo": "decision_queues", "columnsFrom": [ "queue_id" ], - "tableTo": "decision_queues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_triage_events_actor_agent_id_agents_id_fk": { "name": "decision_triage_events_actor_agent_id_agents_id_fk", "tableFrom": "decision_triage_events", + "tableTo": "agents", "columnsFrom": [ "actor_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_triage_events_actor_run_id_heartbeat_runs_id_fk": { "name": "decision_triage_events_actor_run_id_heartbeat_runs_id_fk", "tableFrom": "decision_triage_events", + "tableTo": "heartbeat_runs", "columnsFrom": [ "actor_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_triage_events_agent_api_key_id_agent_api_keys_id_fk": { "name": "decision_triage_events_agent_api_key_id_agent_api_keys_id_fk", "tableFrom": "decision_triage_events", + "tableTo": "agent_api_keys", "columnsFrom": [ "agent_api_key_id" ], - "tableTo": "agent_api_keys", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -24304,9 +24422,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_training_examples_issue_idx": { "name": "decision_training_examples_issue_idx", @@ -24319,9 +24437,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_training_examples_source_author_uq": { "name": "decision_training_examples_source_author_uq", @@ -24346,37 +24464,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_training_examples_company_id_companies_id_fk": { "name": "decision_training_examples_company_id_companies_id_fk", "tableFrom": "decision_training_examples", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_training_examples_issue_id_issues_id_fk": { "name": "decision_training_examples_issue_id_issues_id_fk", "tableFrom": "decision_training_examples", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -24458,63 +24576,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_bundles_company_id_companies_id_fk": { "name": "decision_bundles_company_id_companies_id_fk", "tableFrom": "decision_bundles", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_bundles_origin_agent_id_agents_id_fk": { "name": "decision_bundles_origin_agent_id_agents_id_fk", "tableFrom": "decision_bundles", + "tableTo": "agents", "columnsFrom": [ "origin_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_bundles_origin_issue_id_issues_id_fk": { "name": "decision_bundles_origin_issue_id_issues_id_fk", "tableFrom": "decision_bundles", + "tableTo": "issues", "columnsFrom": [ "origin_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_bundles_origin_run_id_heartbeat_runs_id_fk": { "name": "decision_bundles_origin_run_id_heartbeat_runs_id_fk", "tableFrom": "decision_bundles", + "tableTo": "heartbeat_runs", "columnsFrom": [ "origin_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -24608,9 +24726,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_effect_executions_target_issue_idx": { "name": "decision_effect_executions_target_issue_idx", @@ -24623,50 +24741,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_effect_executions_decision_id_decisions_id_fk": { "name": "decision_effect_executions_decision_id_decisions_id_fk", "tableFrom": "decision_effect_executions", + "tableTo": "decisions", "columnsFrom": [ "decision_id" ], - "tableTo": "decisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_effect_executions_target_issue_id_issues_id_fk": { "name": "decision_effect_executions_target_issue_id_issues_id_fk", "tableFrom": "decision_effect_executions", + "tableTo": "issues", "columnsFrom": [ "target_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decision_effect_executions_activity_log_id_activity_log_id_fk": { "name": "decision_effect_executions_activity_log_id_activity_log_id_fk", "tableFrom": "decision_effect_executions", + "tableTo": "activity_log", "columnsFrom": [ "activity_log_id" ], - "tableTo": "activity_log", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -24710,9 +24828,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_target_issues_issue_idx": { "name": "decision_target_issues_issue_idx", @@ -24725,50 +24843,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "decision_target_issues_decision_id_decisions_id_fk": { "name": "decision_target_issues_decision_id_decisions_id_fk", "tableFrom": "decision_target_issues", + "tableTo": "decisions", "columnsFrom": [ "decision_id" ], - "tableTo": "decisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_target_issues_issue_id_issues_id_fk": { "name": "decision_target_issues_issue_id_issues_id_fk", "tableFrom": "decision_target_issues", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "decision_target_issues_company_id_companies_id_fk": { "name": "decision_target_issues_company_id_companies_id_fk", "tableFrom": "decision_target_issues", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -24970,9 +25088,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decisions_running_recovery_idx": { "name": "decisions_running_recovery_idx", @@ -24991,10 +25109,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"decisions\".\"status\" = 'decided' AND \"decisions\".\"execution_status\" = 'running'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "decisions_open_expiry_idx": { "name": "decisions_open_expiry_idx", @@ -25013,10 +25131,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"decisions\".\"status\" = 'open'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "decisions_pending_continuation_idx": { "name": "decisions_pending_continuation_idx", @@ -25029,10 +25147,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"decisions\".\"continuation_policy\" = 'wake_origin_agent' AND \"decisions\".\"metadata\" ->> 'continuationPending' = 'true' AND (\"decisions\".\"status\" IN ('expired', 'cancelled') OR (\"decisions\".\"status\" = 'decided' AND \"decisions\".\"execution_status\" IN ('succeeded', 'partial', 'failed')))", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "decisions_bundle_idx": { "name": "decisions_bundle_idx", @@ -25045,9 +25163,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decisions_origin_issue_idx": { "name": "decisions_origin_issue_idx", @@ -25060,9 +25178,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decisions_company_idempotency_uq": { "name": "decisions_company_idempotency_uq", @@ -25081,77 +25199,77 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"decisions\".\"idempotency_key\" IS NOT NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "decisions_company_id_companies_id_fk": { "name": "decisions_company_id_companies_id_fk", "tableFrom": "decisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decisions_bundle_id_decision_bundles_id_fk": { "name": "decisions_bundle_id_decision_bundles_id_fk", "tableFrom": "decisions", + "tableTo": "decision_bundles", "columnsFrom": [ "bundle_id" ], - "tableTo": "decision_bundles", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "decisions_origin_agent_id_agents_id_fk": { "name": "decisions_origin_agent_id_agents_id_fk", "tableFrom": "decisions", + "tableTo": "agents", "columnsFrom": [ "origin_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decisions_origin_issue_id_issues_id_fk": { "name": "decisions_origin_issue_id_issues_id_fk", "tableFrom": "decisions", + "tableTo": "issues", "columnsFrom": [ "origin_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "decisions_origin_run_id_heartbeat_runs_id_fk": { "name": "decisions_origin_run_id_heartbeat_runs_id_fk", "tableFrom": "decisions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "origin_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -25275,9 +25393,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_anchor_snapshots_company_document_revision_idx": { "name": "document_annotation_anchor_snapshots_company_document_revision_idx", @@ -25302,76 +25420,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "document_annotation_anchor_snapshots_company_id_companies_id_fk": { "name": "document_annotation_anchor_snapshots_company_id_companies_id_fk", "tableFrom": "document_annotation_anchor_snapshots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "document_annotation_anchor_snapshots_thread_id_document_annotation_threads_id_fk": { "name": "document_annotation_anchor_snapshots_thread_id_document_annotation_threads_id_fk", "tableFrom": "document_annotation_anchor_snapshots", + "tableTo": "document_annotation_threads", "columnsFrom": [ "thread_id" ], - "tableTo": "document_annotation_threads", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_anchor_snapshots_document_id_documents_id_fk": { "name": "document_annotation_anchor_snapshots_document_id_documents_id_fk", "tableFrom": "document_annotation_anchor_snapshots", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_anchor_snapshots_from_revision_id_document_revisions_id_fk": { "name": "document_annotation_anchor_snapshots_from_revision_id_document_revisions_id_fk", "tableFrom": "document_annotation_anchor_snapshots", + "tableTo": "document_revisions", "columnsFrom": [ "from_revision_id" ], - "tableTo": "document_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_annotation_anchor_snapshots_to_revision_id_document_revisions_id_fk": { "name": "document_annotation_anchor_snapshots_to_revision_id_document_revisions_id_fk", "tableFrom": "document_annotation_anchor_snapshots", + "tableTo": "document_revisions", "columnsFrom": [ "to_revision_id" ], - "tableTo": "document_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -25508,9 +25626,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_company_issue_created_at_idx": { "name": "document_annotation_comments_company_issue_created_at_idx", @@ -25535,9 +25653,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_company_routine_created_at_idx": { "name": "document_annotation_comments_company_routine_created_at_idx", @@ -25562,9 +25680,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_company_case_created_at_idx": { "name": "document_annotation_comments_company_case_created_at_idx", @@ -25589,9 +25707,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_company_document_created_at_idx": { "name": "document_annotation_comments_company_document_created_at_idx", @@ -25616,9 +25734,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_issue_comment_idx": { "name": "document_annotation_comments_issue_comment_idx", @@ -25631,9 +25749,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_body_search_idx": { "name": "document_annotation_comments_body_search_idx", @@ -25647,128 +25765,128 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} } }, "foreignKeys": { "document_annotation_comments_company_id_companies_id_fk": { "name": "document_annotation_comments_company_id_companies_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "document_annotation_comments_thread_id_document_annotation_threads_id_fk": { "name": "document_annotation_comments_thread_id_document_annotation_threads_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "document_annotation_threads", "columnsFrom": [ "thread_id" ], - "tableTo": "document_annotation_threads", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_comments_issue_id_issues_id_fk": { "name": "document_annotation_comments_issue_id_issues_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_comments_routine_id_routines_id_fk": { "name": "document_annotation_comments_routine_id_routines_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_comments_case_id_cases_id_fk": { "name": "document_annotation_comments_case_id_cases_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_comments_document_id_documents_id_fk": { "name": "document_annotation_comments_document_id_documents_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_comments_author_agent_id_agents_id_fk": { "name": "document_annotation_comments_author_agent_id_agents_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "agents", "columnsFrom": [ "author_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_annotation_comments_created_by_run_id_heartbeat_runs_id_fk": { "name": "document_annotation_comments_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_annotation_comments_issue_comment_id_issue_comments_id_fk": { "name": "document_annotation_comments_issue_comment_id_issue_comments_id_fk", "tableFrom": "document_annotation_comments", + "tableTo": "issue_comments", "columnsFrom": [ "issue_comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -25993,9 +26111,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_threads_company_issue_status_idx": { "name": "document_annotation_threads_company_issue_status_idx", @@ -26020,9 +26138,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_threads_company_routine_status_idx": { "name": "document_annotation_threads_company_routine_status_idx", @@ -26047,9 +26165,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_threads_company_case_status_idx": { "name": "document_annotation_threads_company_case_status_idx", @@ -26074,9 +26192,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_threads_company_current_revision_open_idx": { "name": "document_annotation_threads_company_current_revision_open_idx", @@ -26107,9 +26225,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_threads_company_anchor_state_idx": { "name": "document_annotation_threads_company_anchor_state_idx", @@ -26128,128 +26246,128 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "document_annotation_threads_company_id_companies_id_fk": { "name": "document_annotation_threads_company_id_companies_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "document_annotation_threads_issue_id_issues_id_fk": { "name": "document_annotation_threads_issue_id_issues_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_threads_routine_id_routines_id_fk": { "name": "document_annotation_threads_routine_id_routines_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_threads_case_id_cases_id_fk": { "name": "document_annotation_threads_case_id_cases_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "cases", "columnsFrom": [ "case_id" ], - "tableTo": "cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_threads_document_id_documents_id_fk": { "name": "document_annotation_threads_document_id_documents_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_annotation_threads_original_revision_id_document_revisions_id_fk": { "name": "document_annotation_threads_original_revision_id_document_revisions_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "document_revisions", "columnsFrom": [ "original_revision_id" ], - "tableTo": "document_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_annotation_threads_current_revision_id_document_revisions_id_fk": { "name": "document_annotation_threads_current_revision_id_document_revisions_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "document_revisions", "columnsFrom": [ "current_revision_id" ], - "tableTo": "document_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_annotation_threads_created_by_agent_id_agents_id_fk": { "name": "document_annotation_threads_created_by_agent_id_agents_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_annotation_threads_resolved_by_agent_id_agents_id_fk": { "name": "document_annotation_threads_resolved_by_agent_id_agents_id_fk", "tableFrom": "document_annotation_threads", + "tableTo": "agents", "columnsFrom": [ "resolved_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -26337,9 +26455,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_memberships_company_user_document_uq": { "name": "document_memberships_company_user_document_uq", @@ -26364,37 +26482,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "document_memberships_company_id_companies_id_fk": { "name": "document_memberships_company_id_companies_id_fk", "tableFrom": "document_memberships", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_memberships_document_id_documents_id_fk": { "name": "document_memberships_document_id_documents_id_fk", "tableFrom": "document_memberships", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -26501,9 +26619,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_revisions_company_document_created_idx": { "name": "document_revisions_company_document_created_idx", @@ -26528,63 +26646,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "document_revisions_company_id_companies_id_fk": { "name": "document_revisions_company_id_companies_id_fk", "tableFrom": "document_revisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_revisions_document_id_documents_id_fk": { "name": "document_revisions_document_id_documents_id_fk", "tableFrom": "document_revisions", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "document_revisions_created_by_agent_id_agents_id_fk": { "name": "document_revisions_created_by_agent_id_agents_id_fk", "tableFrom": "document_revisions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "document_revisions_created_by_run_id_heartbeat_runs_id_fk": { "name": "document_revisions_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "document_revisions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -26723,9 +26841,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "documents_company_created_idx": { "name": "documents_company_created_idx", @@ -26744,9 +26862,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "documents_title_search_idx": { "name": "documents_title_search_idx", @@ -26760,9 +26878,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "documents_latest_body_search_idx": { "name": "documents_latest_body_search_idx", @@ -26776,63 +26894,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} } }, "foreignKeys": { "documents_company_id_companies_id_fk": { "name": "documents_company_id_companies_id_fk", "tableFrom": "documents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "documents_created_by_agent_id_agents_id_fk": { "name": "documents_created_by_agent_id_agents_id_fk", "tableFrom": "documents", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "documents_updated_by_agent_id_agents_id_fk": { "name": "documents_updated_by_agent_id_agents_id_fk", "tableFrom": "documents", + "tableTo": "agents", "columnsFrom": [ "updated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "documents_locked_by_agent_id_agents_id_fk": { "name": "documents_locked_by_agent_id_agents_id_fk", "tableFrom": "documents", + "tableTo": "agents", "columnsFrom": [ "locked_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -26972,10 +27090,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"dot_agent_bindings\".\"revoked_at\" IS NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "dot_bindings_active_grant_uq": { "name": "dot_bindings_active_grant_uq", @@ -26988,10 +27106,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"dot_agent_bindings\".\"revoked_at\" IS NULL AND \"dot_agent_bindings\".\"grant_id\" IS NOT NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "dot_bindings_pairing_code_uq": { "name": "dot_bindings_pairing_code_uq", @@ -27004,50 +27122,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "dot_agent_bindings_company_id_companies_id_fk": { "name": "dot_agent_bindings_company_id_companies_id_fk", "tableFrom": "dot_agent_bindings", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_agent_bindings_agent_id_agents_id_fk": { "name": "dot_agent_bindings_agent_id_agents_id_fk", "tableFrom": "dot_agent_bindings", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_agent_bindings_grant_id_mcp_oauth_grants_id_fk": { "name": "dot_agent_bindings_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "dot_agent_bindings", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -27140,9 +27258,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "dot_mailbox_binding_cursor_idx": { "name": "dot_mailbox_binding_cursor_idx", @@ -27167,50 +27285,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "dot_mailbox_items_company_id_companies_id_fk": { "name": "dot_mailbox_items_company_id_companies_id_fk", "tableFrom": "dot_mailbox_items", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_mailbox_items_binding_id_dot_agent_bindings_id_fk": { "name": "dot_mailbox_items_binding_id_dot_agent_bindings_id_fk", "tableFrom": "dot_mailbox_items", + "tableTo": "dot_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "dot_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_mailbox_items_assignment_id_dot_runner_assignments_id_fk": { "name": "dot_mailbox_items_assignment_id_dot_runner_assignments_id_fk", "tableFrom": "dot_mailbox_items", + "tableTo": "dot_runner_assignments", "columnsFrom": [ "assignment_id" ], - "tableTo": "dot_runner_assignments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -27360,9 +27478,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "dot_assignments_active_binding_uq": { "name": "dot_assignments_active_binding_uq", @@ -27375,10 +27493,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"dot_runner_assignments\".\"status\" IN ('offered', 'accepted')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "dot_assignments_company_idx": { "name": "dot_assignments_company_idx", @@ -27391,63 +27509,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "dot_runner_assignments_company_id_companies_id_fk": { "name": "dot_runner_assignments_company_id_companies_id_fk", "tableFrom": "dot_runner_assignments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_runner_assignments_binding_id_dot_agent_bindings_id_fk": { "name": "dot_runner_assignments_binding_id_dot_agent_bindings_id_fk", "tableFrom": "dot_runner_assignments", + "tableTo": "dot_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "dot_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_runner_assignments_run_id_heartbeat_runs_id_fk": { "name": "dot_runner_assignments_run_id_heartbeat_runs_id_fk", "tableFrom": "dot_runner_assignments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_runner_assignments_agent_id_agents_id_fk": { "name": "dot_runner_assignments_agent_id_agents_id_fk", "tableFrom": "dot_runner_assignments", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -27561,37 +27679,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "dot_runner_operations_company_id_companies_id_fk": { "name": "dot_runner_operations_company_id_companies_id_fk", "tableFrom": "dot_runner_operations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "dot_runner_operations_assignment_id_dot_runner_assignments_id_fk": { "name": "dot_runner_operations_assignment_id_dot_runner_assignments_id_fk", "tableFrom": "dot_runner_operations", + "tableTo": "dot_runner_assignments", "columnsFrom": [ "assignment_id" ], - "tableTo": "dot_runner_assignments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -27658,17 +27776,17 @@ "email_endpoints_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "email_endpoints_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "email_endpoints", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -27781,9 +27899,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "email_messages_conversation_idx": { "name": "email_messages_conversation_idx", @@ -27808,41 +27926,41 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "email_messages_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "email_messages_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "email_messages", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "email_messages_company_id_conversation_id_chat_conversations_company_id_id_fk": { "name": "email_messages_company_id_conversation_id_chat_conversations_company_id_id_fk", "tableFrom": "email_messages", + "tableTo": "chat_conversations", "columnsFrom": [ "company_id", "conversation_id" ], - "tableTo": "chat_conversations", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -27928,42 +28046,42 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"email_sends\".\"outcome\" in ('queued', 'uncertain')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "email_sends_company_id_endpoint_id_chat_endpoints_company_id_id_fk": { "name": "email_sends_company_id_endpoint_id_chat_endpoints_company_id_id_fk", "tableFrom": "email_sends", + "tableTo": "chat_endpoints", "columnsFrom": [ "company_id", "endpoint_id" ], - "tableTo": "chat_endpoints", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "email_sends_company_id_publication_id_chat_publications_company_id_id_fk": { "name": "email_sends_company_id_publication_id_chat_publications_company_id_id_fk", "tableFrom": "email_sends", + "tableTo": "chat_publications", "columnsFrom": [ "company_id", "publication_id" ], - "tableTo": "chat_publications", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -28118,9 +28236,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_setup_sessions_environment_active_uq": { "name": "environment_custom_image_setup_sessions_environment_active_uq", @@ -28133,10 +28251,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"environment_custom_image_setup_sessions\".\"status\" IN ('starting', 'waiting_for_user', 'capturing')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "environment_custom_image_setup_sessions_template_idx": { "name": "environment_custom_image_setup_sessions_template_idx", @@ -28149,9 +28267,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_setup_sessions_promoted_template_idx": { "name": "environment_custom_image_setup_sessions_promoted_template_idx", @@ -28164,9 +28282,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_setup_sessions_expires_idx": { "name": "environment_custom_image_setup_sessions_expires_idx", @@ -28179,9 +28297,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_setup_sessions_provider_lease_idx": { "name": "environment_custom_image_setup_sessions_provider_lease_idx", @@ -28200,76 +28318,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "environment_custom_image_setup_sessions_environment_id_environments_id_fk": { "name": "environment_custom_image_setup_sessions_environment_id_environments_id_fk", "tableFrom": "environment_custom_image_setup_sessions", + "tableTo": "environments", "columnsFrom": [ "environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "environment_custom_image_setup_sessions_template_id_environment_custom_image_templates_id_fk": { "name": "environment_custom_image_setup_sessions_template_id_environment_custom_image_templates_id_fk", "tableFrom": "environment_custom_image_setup_sessions", + "tableTo": "environment_custom_image_templates", "columnsFrom": [ "template_id" ], - "tableTo": "environment_custom_image_templates", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_custom_image_setup_sessions_promoted_template_id_environment_custom_image_templates_id_fk": { "name": "environment_custom_image_setup_sessions_promoted_template_id_environment_custom_image_templates_id_fk", "tableFrom": "environment_custom_image_setup_sessions", + "tableTo": "environment_custom_image_templates", "columnsFrom": [ "promoted_template_id" ], - "tableTo": "environment_custom_image_templates", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_custom_image_setup_sessions_environment_lease_id_environment_leases_id_fk": { "name": "environment_custom_image_setup_sessions_environment_lease_id_environment_leases_id_fk", "tableFrom": "environment_custom_image_setup_sessions", + "tableTo": "environment_leases", "columnsFrom": [ "environment_lease_id" ], - "tableTo": "environment_leases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_custom_image_setup_sessions_started_by_agent_id_agents_id_fk": { "name": "environment_custom_image_setup_sessions_started_by_agent_id_agents_id_fk", "tableFrom": "environment_custom_image_setup_sessions", + "tableTo": "agents", "columnsFrom": [ "started_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -28402,9 +28520,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_templates_environment_provider_status_idx": { "name": "environment_custom_image_templates_environment_provider_status_idx", @@ -28429,9 +28547,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_templates_environment_active_uq": { "name": "environment_custom_image_templates_environment_active_uq", @@ -28444,10 +28562,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"environment_custom_image_templates\".\"status\" = 'active'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "environment_custom_image_templates_superseded_by_idx": { "name": "environment_custom_image_templates_superseded_by_idx", @@ -28460,9 +28578,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_custom_image_templates_last_used_idx": { "name": "environment_custom_image_templates_last_used_idx", @@ -28475,50 +28593,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "environment_custom_image_templates_environment_id_environments_id_fk": { "name": "environment_custom_image_templates_environment_id_environments_id_fk", "tableFrom": "environment_custom_image_templates", + "tableTo": "environments", "columnsFrom": [ "environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "environment_custom_image_templates_created_by_agent_id_agents_id_fk": { "name": "environment_custom_image_templates_created_by_agent_id_agents_id_fk", "tableFrom": "environment_custom_image_templates", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_custom_image_templates_superseded_by_template_id_environment_custom_image_templates_id_fk": { "name": "environment_custom_image_templates_superseded_by_template_id_environment_custom_image_templates_id_fk", "tableFrom": "environment_custom_image_templates", + "tableTo": "environment_custom_image_templates", "columnsFrom": [ "superseded_by_template_id" ], - "tableTo": "environment_custom_image_templates", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -28665,10 +28783,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"environment_leases\".\"lease_policy\" = 'retain_on_failure'\n and \"environment_leases\".\"heartbeat_run_id\" is not null\n and not (coalesce(\"environment_leases\".\"metadata\", '{}'::jsonb) ? 'systemRecoveryAdoption')", - "concurrently": true + "concurrently": true, + "method": "btree", + "with": {} }, "environment_leases_company_environment_status_idx": { "name": "environment_leases_company_environment_status_idx", @@ -28693,9 +28811,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_company_execution_workspace_idx": { "name": "environment_leases_company_execution_workspace_idx", @@ -28714,9 +28832,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_company_issue_idx": { "name": "environment_leases_company_issue_idx", @@ -28735,9 +28853,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_heartbeat_run_idx": { "name": "environment_leases_heartbeat_run_idx", @@ -28750,9 +28868,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_company_last_used_idx": { "name": "environment_leases_company_last_used_idx", @@ -28771,9 +28889,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_provider_lease_idx": { "name": "environment_leases_provider_lease_idx", @@ -28786,76 +28904,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "environment_leases_company_id_companies_id_fk": { "name": "environment_leases_company_id_companies_id_fk", "tableFrom": "environment_leases", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "environment_leases_environment_id_environments_id_fk": { "name": "environment_leases_environment_id_environments_id_fk", "tableFrom": "environment_leases", + "tableTo": "environments", "columnsFrom": [ "environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_leases_execution_workspace_id_execution_workspaces_id_fk": { "name": "environment_leases_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "environment_leases", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_leases_issue_id_issues_id_fk": { "name": "environment_leases_issue_id_issues_id_fk", "tableFrom": "environment_leases", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "environment_leases_heartbeat_run_id_heartbeat_runs_id_fk": { "name": "environment_leases_heartbeat_run_id_heartbeat_runs_id_fk", "tableFrom": "environment_leases", + "tableTo": "heartbeat_runs", "columnsFrom": [ "heartbeat_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -28948,9 +29066,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environments_local_driver_idx": { "name": "environments_local_driver_idx", @@ -28963,10 +29081,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"environments\".\"driver\" = 'local'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "environments_managed_sandbox_idx": { "name": "environments_managed_sandbox_idx", @@ -28979,26 +29097,26 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"environments\".\"driver\" = 'sandbox' AND (\"environments\".\"metadata\" ->> 'managedByPaperclip')::boolean = true", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "environments_managed_plugin_environment_idx": { "name": "environments_managed_plugin_environment_idx", "columns": [ { "expression": "(\"metadata\" ->> 'managedPluginEnvironment')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "jsonb_typeof(\"environments\".\"metadata\" -> 'managedPluginEnvironment') = 'string'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "environments_name_idx": { "name": "environments_name_idx", @@ -29011,9 +29129,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -29064,41 +29182,41 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "execution_admission_project_charges_company_admission_fk": { "name": "execution_admission_project_charges_company_admission_fk", "tableFrom": "execution_admission_project_charges", + "tableTo": "execution_admissions", "columnsFrom": [ "company_id", "admission_id" ], - "tableTo": "execution_admissions", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "execution_admission_project_charges_company_project_fk": { "name": "execution_admission_project_charges_company_project_fk", "tableFrom": "execution_admission_project_charges", + "tableTo": "projects", "columnsFrom": [ "company_id", "project_id" ], - "tableTo": "projects", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -29199,9 +29317,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_admissions_run_attempt_uq": { "name": "execution_admissions_run_attempt_uq", @@ -29220,9 +29338,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_admissions_live_run_uq": { "name": "execution_admissions_live_run_uq", @@ -29235,38 +29353,38 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"execution_admissions\".\"settled_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "execution_admissions_company_id_companies_id_fk": { "name": "execution_admissions_company_id_companies_id_fk", "tableFrom": "execution_admissions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "execution_admissions_run_id_heartbeat_runs_id_fk": { "name": "execution_admissions_run_id_heartbeat_runs_id_fk", "tableFrom": "execution_admissions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -29330,17 +29448,17 @@ "project_task_execution_policies_company_project_fk": { "name": "project_task_execution_policies_company_project_fk", "tableFrom": "project_task_execution_policies", + "tableTo": "projects", "columnsFrom": [ "company_id", "project_id" ], - "tableTo": "projects", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -29485,9 +29603,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_repositories_path_idx": { "name": "execution_workspace_repositories_path_idx", @@ -29506,9 +29624,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_repositories_request_idx": { "name": "execution_workspace_repositories_request_idx", @@ -29527,9 +29645,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_repositories_company_workspace_idx": { "name": "execution_workspace_repositories_company_workspace_idx", @@ -29548,50 +29666,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "execution_workspace_repositories_company_id_companies_id_fk": { "name": "execution_workspace_repositories_company_id_companies_id_fk", "tableFrom": "execution_workspace_repositories", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "execution_workspace_repositories_execution_workspace_id_execution_workspaces_id_fk": { "name": "execution_workspace_repositories_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "execution_workspace_repositories", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "execution_workspace_repositories_requested_by_issue_id_issues_id_fk": { "name": "execution_workspace_repositories_requested_by_issue_id_issues_id_fk", "tableFrom": "execution_workspace_repositories", + "tableTo": "issues", "columnsFrom": [ "requested_by_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -29704,24 +29822,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "execution_workspace_repository_access_company_id_companies_id_fk": { "name": "execution_workspace_repository_access_company_id_companies_id_fk", "tableFrom": "execution_workspace_repository_access", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -29798,24 +29916,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "execution_workspace_repository_roots_company_id_companies_id_fk": { "name": "execution_workspace_repository_roots_company_id_companies_id_fk", "tableFrom": "execution_workspace_repository_roots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -29955,9 +30073,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_restore_points_live_status_uniq": { "name": "execution_workspace_restore_points_live_status_uniq", @@ -29982,10 +30100,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"execution_workspace_restore_points\".\"status\" in ('pending', 'active', 'expiring')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "execution_workspace_restore_points_status_delete_after_idx": { "name": "execution_workspace_restore_points_status_delete_after_idx", @@ -30004,9 +30122,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_restore_points_company_idx": { "name": "execution_workspace_restore_points_company_idx", @@ -30019,9 +30137,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_restore_points_source_issue_idx": { "name": "execution_workspace_restore_points_source_issue_idx", @@ -30040,9 +30158,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_restore_points_active_source_idx": { "name": "execution_workspace_restore_points_active_source_idx", @@ -30055,10 +30173,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"execution_workspace_restore_points\".\"status\" = 'active'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": {}, @@ -30180,9 +30298,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_runtime_leases_company_owner_idx": { "name": "execution_workspace_runtime_leases_company_owner_idx", @@ -30201,9 +30319,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_runtime_leases_expires_at_idx": { "name": "execution_workspace_runtime_leases_expires_at_idx", @@ -30216,86 +30334,86 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "execution_workspace_runtime_leases_company_id_companies_id_fk": { "name": "execution_workspace_runtime_leases_company_id_companies_id_fk", "tableFrom": "execution_workspace_runtime_leases", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "execution_workspace_runtime_leases_execution_workspace_id_execution_workspaces_id_fk": { "name": "execution_workspace_runtime_leases_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "execution_workspace_runtime_leases", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "execution_workspace_runtime_leases_owner_issue_id_issues_id_fk": { "name": "execution_workspace_runtime_leases_owner_issue_id_issues_id_fk", "tableFrom": "execution_workspace_runtime_leases", + "tableTo": "issues", "columnsFrom": [ "owner_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "execution_workspace_runtime_leases_owner_run_id_heartbeat_runs_id_fk": { "name": "execution_workspace_runtime_leases_owner_run_id_heartbeat_runs_id_fk", "tableFrom": "execution_workspace_runtime_leases", + "tableTo": "heartbeat_runs", "columnsFrom": [ "owner_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "execution_workspace_runtime_leases_owner_agent_id_agents_id_fk": { "name": "execution_workspace_runtime_leases_owner_agent_id_agents_id_fk", "tableFrom": "execution_workspace_runtime_leases", + "tableTo": "agents", "columnsFrom": [ "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "execution_workspace_runtime_leases_execution_workspace_id_unique": { "name": "execution_workspace_runtime_leases_execution_workspace_id_unique", + "nullsNotDistinct": false, "columns": [ "execution_workspace_id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -30456,9 +30574,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_snapshots_generation_uniq": { "name": "execution_workspace_snapshots_generation_uniq", @@ -30483,9 +30601,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_snapshots_workspace_idx": { "name": "execution_workspace_snapshots_workspace_idx", @@ -30504,9 +30622,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_snapshots_cleanup_idx": { "name": "execution_workspace_snapshots_cleanup_idx", @@ -30525,25 +30643,25 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_snapshots_imported_children_idx": { "name": "execution_workspace_snapshots_imported_children_idx", "columns": [ { "expression": "(\"metadata\"->'importedWorkspaceChildren') jsonb_path_ops", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, - "with": {}, - "method": "gin", "where": "\"execution_workspace_snapshots\".\"metadata\" ? 'importedWorkspaceChildren'", - "concurrently": false + "concurrently": false, + "method": "gin", + "with": {} } }, "foreignKeys": {}, @@ -30733,9 +30851,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_project_workspace_status_idx": { "name": "execution_workspaces_company_project_workspace_status_idx", @@ -30760,9 +30878,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_source_issue_idx": { "name": "execution_workspaces_company_source_issue_idx", @@ -30781,9 +30899,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_last_used_idx": { "name": "execution_workspaces_company_last_used_idx", @@ -30802,9 +30920,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_branch_idx": { "name": "execution_workspaces_company_branch_idx", @@ -30823,76 +30941,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "execution_workspaces_company_id_companies_id_fk": { "name": "execution_workspaces_company_id_companies_id_fk", "tableFrom": "execution_workspaces", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "execution_workspaces_project_id_projects_id_fk": { "name": "execution_workspaces_project_id_projects_id_fk", "tableFrom": "execution_workspaces", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "execution_workspaces_project_workspace_id_project_workspaces_id_fk": { "name": "execution_workspaces_project_workspace_id_project_workspaces_id_fk", "tableFrom": "execution_workspaces", + "tableTo": "project_workspaces", "columnsFrom": [ "project_workspace_id" ], - "tableTo": "project_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "execution_workspaces_source_issue_id_issues_id_fk": { "name": "execution_workspaces_source_issue_id_issues_id_fk", "tableFrom": "execution_workspaces", + "tableTo": "issues", "columnsFrom": [ "source_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "execution_workspaces_derived_from_execution_workspace_id_execution_workspaces_id_fk": { "name": "execution_workspaces_derived_from_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "execution_workspaces", + "tableTo": "execution_workspaces", "columnsFrom": [ "derived_from_execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -31042,9 +31160,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_object_mentions_company_object_idx": { "name": "external_object_mentions_company_object_idx", @@ -31063,9 +31181,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_object_mentions_company_provider_idx": { "name": "external_object_mentions_company_provider_idx", @@ -31090,9 +31208,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_object_mentions_company_source_record_uq": { "name": "external_object_mentions_company_source_record_uq", @@ -31141,10 +31259,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"external_object_mentions\".\"source_record_id\" is not null and \"external_object_mentions\".\"canonical_identity_hash\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "external_object_mentions_company_source_null_record_uq": { "name": "external_object_mentions_company_source_null_record_uq", @@ -31187,64 +31305,64 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"external_object_mentions\".\"source_record_id\" is null and \"external_object_mentions\".\"canonical_identity_hash\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "external_object_mentions_company_id_companies_id_fk": { "name": "external_object_mentions_company_id_companies_id_fk", "tableFrom": "external_object_mentions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "external_object_mentions_source_issue_id_issues_id_fk": { "name": "external_object_mentions_source_issue_id_issues_id_fk", "tableFrom": "external_object_mentions", + "tableTo": "issues", "columnsFrom": [ "source_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "external_object_mentions_object_id_external_objects_id_fk": { "name": "external_object_mentions_object_id_external_objects_id_fk", "tableFrom": "external_object_mentions", + "tableTo": "external_objects", "columnsFrom": [ "object_id" ], - "tableTo": "external_objects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "external_object_mentions_created_by_plugin_id_plugins_id_fk": { "name": "external_object_mentions_created_by_plugin_id_plugins_id_fk", "tableFrom": "external_object_mentions", + "tableTo": "plugins", "columnsFrom": [ "created_by_plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -31476,9 +31594,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_provider_status_idx": { "name": "external_objects_company_provider_status_idx", @@ -31503,9 +31621,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_refresh_idx": { "name": "external_objects_company_refresh_idx", @@ -31524,9 +31642,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_external_id_uq": { "name": "external_objects_company_external_id_uq", @@ -31557,9 +31675,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_identity_uq": { "name": "external_objects_company_identity_uq", @@ -31590,37 +31708,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "external_objects_company_id_companies_id_fk": { "name": "external_objects_company_id_companies_id_fk", "tableFrom": "external_objects", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "external_objects_plugin_id_plugins_id_fk": { "name": "external_objects_plugin_id_plugins_id_fk", "tableFrom": "external_objects", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -31690,15 +31808,15 @@ "company_fast_responses_company_id_companies_id_fk": { "name": "company_fast_responses_company_id_companies_id_fk", "tableFrom": "company_fast_responses", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -31920,9 +32038,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "fast_response_requests_delivery_idx": { "name": "fast_response_requests_delivery_idx", @@ -31947,10 +32065,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"fast_response_requests\".\"delivery_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "fast_response_requests_history_idx": { "name": "fast_response_requests_history_idx", @@ -31969,9 +32087,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "fast_response_requests_work_idx": { "name": "fast_response_requests_work_idx", @@ -31984,38 +32102,38 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"fast_response_requests\".\"status\" in ('pending', 'running')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "fast_response_requests_company_id_companies_id_fk": { "name": "fast_response_requests_company_id_companies_id_fk", "tableFrom": "fast_response_requests", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "fast_response_requests_cost_event_id_cost_events_id_fk": { "name": "fast_response_requests_cost_event_id_cost_events_id_fk", "tableFrom": "fast_response_requests", + "tableTo": "cost_events", "columnsFrom": [ "cost_event_id" ], - "tableTo": "cost_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -32210,9 +32328,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_created_idx": { "name": "feedback_exports_company_created_idx", @@ -32231,9 +32349,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_status_idx": { "name": "feedback_exports_company_status_idx", @@ -32258,9 +32376,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_issue_idx": { "name": "feedback_exports_company_issue_idx", @@ -32285,9 +32403,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_project_idx": { "name": "feedback_exports_company_project_idx", @@ -32312,9 +32430,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_author_idx": { "name": "feedback_exports_company_author_idx", @@ -32339,63 +32457,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "feedback_exports_company_id_companies_id_fk": { "name": "feedback_exports_company_id_companies_id_fk", "tableFrom": "feedback_exports", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "feedback_exports_feedback_vote_id_feedback_votes_id_fk": { "name": "feedback_exports_feedback_vote_id_feedback_votes_id_fk", "tableFrom": "feedback_exports", + "tableTo": "feedback_votes", "columnsFrom": [ "feedback_vote_id" ], - "tableTo": "feedback_votes", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "feedback_exports_issue_id_issues_id_fk": { "name": "feedback_exports_issue_id_issues_id_fk", "tableFrom": "feedback_exports", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "feedback_exports_project_id_projects_id_fk": { "name": "feedback_exports_project_id_projects_id_fk", "tableFrom": "feedback_exports", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -32515,9 +32633,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_votes_issue_target_idx": { "name": "feedback_votes_issue_target_idx", @@ -32542,9 +32660,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_votes_author_idx": { "name": "feedback_votes_author_idx", @@ -32563,9 +32681,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_votes_company_target_author_idx": { "name": "feedback_votes_company_target_author_idx", @@ -32596,37 +32714,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "feedback_votes_company_id_companies_id_fk": { "name": "feedback_votes_company_id_companies_id_fk", "tableFrom": "feedback_votes", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "feedback_votes_issue_id_issues_id_fk": { "name": "feedback_votes_issue_id_issues_id_fk", "tableFrom": "feedback_votes", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -32837,9 +32955,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_occurred_idx": { "name": "finance_events_company_occurred_idx", @@ -32858,9 +32976,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_biller_occurred_idx": { "name": "finance_events_company_biller_occurred_idx", @@ -32885,9 +33003,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_kind_occurred_idx": { "name": "finance_events_company_kind_occurred_idx", @@ -32912,9 +33030,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_direction_occurred_idx": { "name": "finance_events_company_direction_occurred_idx", @@ -32939,9 +33057,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_heartbeat_run_idx": { "name": "finance_events_company_heartbeat_run_idx", @@ -32960,9 +33078,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_cost_event_idx": { "name": "finance_events_company_cost_event_idx", @@ -32981,102 +33099,102 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "finance_events_company_id_companies_id_fk": { "name": "finance_events_company_id_companies_id_fk", "tableFrom": "finance_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "finance_events_agent_id_agents_id_fk": { "name": "finance_events_agent_id_agents_id_fk", "tableFrom": "finance_events", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "finance_events_issue_id_issues_id_fk": { "name": "finance_events_issue_id_issues_id_fk", "tableFrom": "finance_events", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "finance_events_project_id_projects_id_fk": { "name": "finance_events_project_id_projects_id_fk", "tableFrom": "finance_events", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "finance_events_goal_id_goals_id_fk": { "name": "finance_events_goal_id_goals_id_fk", "tableFrom": "finance_events", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "finance_events_heartbeat_run_id_heartbeat_runs_id_fk": { "name": "finance_events_heartbeat_run_id_heartbeat_runs_id_fk", "tableFrom": "finance_events", + "tableTo": "heartbeat_runs", "columnsFrom": [ "heartbeat_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "finance_events_cost_event_id_cost_events_id_fk": { "name": "finance_events_cost_event_id_cost_events_id_fk", "tableFrom": "finance_events", + "tableTo": "cost_events", "columnsFrom": [ "cost_event_id" ], - "tableTo": "cost_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -33190,9 +33308,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "folders_company_kind_root_slug_uq": { "name": "folders_company_kind_root_slug_uq", @@ -33217,10 +33335,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"folders\".\"parent_id\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "folders_company_kind_parent_slug_uq": { "name": "folders_company_kind_parent_slug_uq", @@ -33251,10 +33369,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"folders\".\"parent_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "folders_company_kind_system_key_uq": { "name": "folders_company_kind_system_key_uq", @@ -33279,10 +33397,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"folders\".\"system_key\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "folders_company_kind_parent_position_idx": { "name": "folders_company_kind_parent_position_idx", @@ -33319,37 +33437,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "folders_company_id_companies_id_fk": { "name": "folders_company_id_companies_id_fk", "tableFrom": "folders", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "folders_parent_id_folders_id_fk": { "name": "folders_parent_id_folders_id_fk", "tableFrom": "folders", + "tableTo": "folders", "columnsFrom": [ "parent_id" ], - "tableTo": "folders", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -33440,50 +33558,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "goals_company_id_companies_id_fk": { "name": "goals_company_id_companies_id_fk", "tableFrom": "goals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "goals_parent_id_goals_id_fk": { "name": "goals_parent_id_goals_id_fk", "tableFrom": "goals", + "tableTo": "goals", "columnsFrom": [ "parent_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "goals_owner_agent_id_agents_id_fk": { "name": "goals_owner_agent_id_agents_id_fk", "tableFrom": "goals", + "tableTo": "agents", "columnsFrom": [ "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -33645,9 +33763,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "grok_dispatch_prepared_idx": { "name": "grok_dispatch_prepared_idx", @@ -33666,10 +33784,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"grok_bot_dispatches\".\"status\" = 'prepared'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "grok_dispatch_company_status_idx": { "name": "grok_dispatch_company_status_idx", @@ -33688,9 +33806,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "grok_dispatch_assignment_kind_idx": { "name": "grok_dispatch_assignment_kind_idx", @@ -33709,76 +33827,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "grok_bot_dispatches_company_id_companies_id_fk": { "name": "grok_bot_dispatches_company_id_companies_id_fk", "tableFrom": "grok_bot_dispatches", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_dispatches_routine_id_grok_bot_routines_id_fk": { "name": "grok_bot_dispatches_routine_id_grok_bot_routines_id_fk", "tableFrom": "grok_bot_dispatches", + "tableTo": "grok_bot_routines", "columnsFrom": [ "routine_id" ], - "tableTo": "grok_bot_routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_dispatches_binding_id_dot_agent_bindings_id_fk": { "name": "grok_bot_dispatches_binding_id_dot_agent_bindings_id_fk", "tableFrom": "grok_bot_dispatches", + "tableTo": "dot_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "dot_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_dispatches_grant_id_mcp_oauth_grants_id_fk": { "name": "grok_bot_dispatches_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "grok_bot_dispatches", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_dispatches_assignment_id_dot_runner_assignments_id_fk": { "name": "grok_bot_dispatches_assignment_id_dot_runner_assignments_id_fk", "tableFrom": "grok_bot_dispatches", + "tableTo": "dot_runner_assignments", "columnsFrom": [ "assignment_id" ], - "tableTo": "dot_runner_assignments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -33904,9 +34022,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "grok_routines_company_agent_idx": { "name": "grok_routines_company_agent_idx", @@ -33925,76 +34043,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "grok_bot_routines_company_id_companies_id_fk": { "name": "grok_bot_routines_company_id_companies_id_fk", "tableFrom": "grok_bot_routines", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_routines_agent_id_agents_id_fk": { "name": "grok_bot_routines_agent_id_agents_id_fk", "tableFrom": "grok_bot_routines", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_routines_binding_id_dot_agent_bindings_id_fk": { "name": "grok_bot_routines_binding_id_dot_agent_bindings_id_fk", "tableFrom": "grok_bot_routines", + "tableTo": "dot_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "dot_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "grok_bot_routines_secret_id_company_secrets_id_fk": { "name": "grok_bot_routines_secret_id_company_secrets_id_fk", "tableFrom": "grok_bot_routines", + "tableTo": "company_secrets", "columnsFrom": [ "secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "grok_bot_routines_verified_grant_id_mcp_oauth_grants_id_fk": { "name": "grok_bot_routines_verified_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "grok_bot_routines", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "verified_grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -34129,9 +34247,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_run_events_run_source_event_uq": { "name": "heartbeat_run_events_run_source_event_uq", @@ -34150,10 +34268,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"heartbeat_run_events\".\"source_event_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_run_events_run_source_seq_uq": { "name": "heartbeat_run_events_run_source_seq_uq", @@ -34178,10 +34296,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"heartbeat_run_events\".\"source_instance_id\" is not null and \"heartbeat_run_events\".\"source_seq\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_run_events_company_run_idx": { "name": "heartbeat_run_events_company_run_idx", @@ -34200,9 +34318,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_run_events_company_created_idx": { "name": "heartbeat_run_events_company_created_idx", @@ -34221,9 +34339,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_run_events_usage_item_run_idx": { "name": "heartbeat_run_events_usage_item_run_idx", @@ -34242,10 +34360,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_run_events\".\"event_type\" = 'item.completed' and (\"heartbeat_run_events\".\"payload\" -> 'prpEvent' -> 'payload' ->> 'kind') = 'usage'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_run_events_compaction_session_idx": { "name": "heartbeat_run_events_compaction_session_idx", @@ -34258,57 +34376,57 @@ }, { "expression": "(\"payload\" -> 'prpEvent' ->> 'normalizedSessionId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_run_events\".\"event_type\" = 'context.compacted'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "heartbeat_run_events_company_id_companies_id_fk": { "name": "heartbeat_run_events_company_id_companies_id_fk", "tableFrom": "heartbeat_run_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "heartbeat_run_events_run_id_heartbeat_runs_id_fk": { "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk", "tableFrom": "heartbeat_run_events", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "heartbeat_run_events_agent_id_agents_id_fk": { "name": "heartbeat_run_events_agent_id_agents_id_fk", "tableFrom": "heartbeat_run_events", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -34414,9 +34532,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_run_watchdog_decisions_company_run_snooze_idx": { "name": "heartbeat_run_watchdog_decisions_company_run_snooze_idx", @@ -34441,76 +34559,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "heartbeat_run_watchdog_decisions_company_id_companies_id_fk": { "name": "heartbeat_run_watchdog_decisions_company_id_companies_id_fk", "tableFrom": "heartbeat_run_watchdog_decisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "heartbeat_run_watchdog_decisions_run_id_heartbeat_runs_id_fk": { "name": "heartbeat_run_watchdog_decisions_run_id_heartbeat_runs_id_fk", "tableFrom": "heartbeat_run_watchdog_decisions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "heartbeat_run_watchdog_decisions_evaluation_issue_id_issues_id_fk": { "name": "heartbeat_run_watchdog_decisions_evaluation_issue_id_issues_id_fk", "tableFrom": "heartbeat_run_watchdog_decisions", + "tableTo": "issues", "columnsFrom": [ "evaluation_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "heartbeat_run_watchdog_decisions_created_by_agent_id_agents_id_fk": { "name": "heartbeat_run_watchdog_decisions_created_by_agent_id_agents_id_fk", "tableFrom": "heartbeat_run_watchdog_decisions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "heartbeat_run_watchdog_decisions_created_by_run_id_heartbeat_runs_id_fk": { "name": "heartbeat_run_watchdog_decisions_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "heartbeat_run_watchdog_decisions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -34856,6 +34974,12 @@ "primaryKey": false, "notNull": false }, + "controller_process": { + "name": "controller_process", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, "execution_stage": { "name": "execution_stage", "type": "text", @@ -35044,10 +35168,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"runtime_mode\" = 'native' AND \"heartbeat_runs\".\"status\" in ('succeeded', 'failed', 'timed_out') AND \"heartbeat_runs\".\"finished_at\" is not null AND jsonb_typeof(\"heartbeat_runs\".\"result_json\" #> '{presentationDecision,commentId}') is distinct from 'string'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_cancelled_workspace_preservation_idx": { "name": "heartbeat_runs_cancelled_workspace_preservation_idx", @@ -35066,10 +35190,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"runtime_mode\" = 'native' AND \"heartbeat_runs\".\"status\" = 'cancelled'\n AND \"heartbeat_runs\".\"runner_profile_json\"->'nativeWorkspaceSync'->>'state' = 'prepared'\n AND \"heartbeat_runs\".\"result_json\"->'nativeCancellation'->>'dispatchState' = 'acknowledged'\n AND (\"heartbeat_runs\".\"result_json\"->'workspaceRestoreRecovery'->>'schema' = 'paperclip.workspace-restore-recovery.v1'\n AND \"heartbeat_runs\".\"result_json\"->>'workspaceRestoreFailure' IN ('restore_permission_denied', 'restore_lock_timeout', 'restore_unsafe_archive', 'restore_invalid_metadata', 'restore_failed')) IS NOT TRUE", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_retained_recovery_adoption_idx": { "name": "heartbeat_runs_retained_recovery_adoption_idx", @@ -35082,10 +35206,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"result_json\"->'workspaceRestoreRecovery'->>'schema' = 'paperclip.workspace-restore-recovery.v1'\n and not (coalesce(\"heartbeat_runs\".\"result_json\", '{}'::jsonb) ? 'systemRecoveryAdoption')\n and \"heartbeat_runs\".\"status\" in ('failed', 'interrupted', 'timed_out', 'cancelled', 'succeeded')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_scheduled_retry_cancellation_idx": { "name": "heartbeat_runs_scheduled_retry_cancellation_idx", @@ -35098,10 +35222,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"status\" = 'scheduled_retry' and jsonb_typeof(\"heartbeat_runs\".\"result_json\"->'startupCancellation') = 'object'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_tree_hold_suppression_idx": { "name": "heartbeat_runs_tree_hold_suppression_idx", @@ -35114,16 +35238,32 @@ }, { "expression": "(\"result_json\"->'treeHoldSuppression'->>'holdId')", + "asc": true, "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"heartbeat_runs\".\"status\" = 'cancelled' and \"heartbeat_runs\".\"result_json\" ? 'treeHoldSuppression'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "heartbeat_runs_legacy_controller_lease_idx": { + "name": "heartbeat_runs_legacy_controller_lease_idx", + "columns": [ + { + "expression": "controller_lease_expires_at", + "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, - "with": {}, + "where": "\"heartbeat_runs\".\"runtime_mode\" = 'legacy' AND \"heartbeat_runs\".\"status\" = 'running' AND \"heartbeat_runs\".\"controller_boot_id\" is not null", + "concurrently": false, "method": "btree", - "where": "\"heartbeat_runs\".\"status\" = 'cancelled' and \"heartbeat_runs\".\"result_json\" ? 'treeHoldSuppression'", - "concurrently": false + "with": {} }, "heartbeat_runs_cost_accounting_pending_idx": { "name": "heartbeat_runs_cost_accounting_pending_idx", @@ -35142,10 +35282,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"cost_accounting_pending\" = true", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_cost_data_quality_idx": { "name": "heartbeat_runs_cost_data_quality_idx", @@ -35158,8 +35298,8 @@ }, { "expression": "coalesce(\"finished_at\", \"created_at\") desc", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -35170,10 +35310,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"cost_accounting_pending\" = true and \"heartbeat_runs\".\"status\" in ('succeeded','failed','timed_out','cancelled','interrupted')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_execution_status_delivery_idx": { "name": "heartbeat_runs_execution_status_delivery_idx", @@ -35186,10 +35326,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"execution_status_delivery_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_execution_control_deadline_idx": { "name": "heartbeat_runs_execution_control_deadline_idx", @@ -35202,10 +35342,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"execution_control_deadline_at\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_native_replacement_predecessor_uq": { "name": "heartbeat_runs_native_replacement_predecessor_uq", @@ -35224,10 +35364,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"heartbeat_runs\".\"scheduled_retry_reason\" = 'native_safe_replacement'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "heartbeat_runs_company_agent_started_idx": { "name": "heartbeat_runs_company_agent_started_idx", @@ -35252,9 +35392,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_issue_created_idx": { "name": "heartbeat_runs_company_issue_created_idx", @@ -35279,9 +35419,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_responsible_user_idx": { "name": "heartbeat_runs_company_responsible_user_idx", @@ -35306,9 +35446,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_liveness_idx": { "name": "heartbeat_runs_company_liveness_idx", @@ -35333,9 +35473,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_status_last_output_idx": { "name": "heartbeat_runs_company_status_last_output_idx", @@ -35360,9 +35500,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_status_process_started_idx": { "name": "heartbeat_runs_company_status_process_started_idx", @@ -35387,9 +35527,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_created_at_desc_idx": { "name": "heartbeat_runs_company_created_at_desc_idx", @@ -35408,9 +35548,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_ctx_issue_created_idx": { "name": "heartbeat_runs_company_ctx_issue_created_idx", @@ -35423,8 +35563,8 @@ }, { "expression": "(\"context_snapshot\" ->> 'issueId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -35435,9 +35575,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_ctx_task_created_idx": { "name": "heartbeat_runs_company_ctx_task_created_idx", @@ -35450,8 +35590,8 @@ }, { "expression": "(\"context_snapshot\" ->> 'taskId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -35462,9 +35602,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_ctx_taskkey_created_idx": { "name": "heartbeat_runs_company_ctx_taskkey_created_idx", @@ -35477,8 +35617,8 @@ }, { "expression": "(\"context_snapshot\" ->> 'taskKey')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -35489,9 +35629,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_ctx_paperclip_issue_created_idx": { "name": "heartbeat_runs_company_ctx_paperclip_issue_created_idx", @@ -35504,8 +35644,8 @@ }, { "expression": "(\"context_snapshot\" -> 'paperclipIssue' ->> 'id')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -35516,9 +35656,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": true, "method": "btree", - "concurrently": true + "with": {} }, "heartbeat_runs_company_origin_issue_idx": { "name": "heartbeat_runs_company_origin_issue_idx", @@ -35531,104 +35671,104 @@ }, { "expression": "coalesce(\n \"native_issue_id\"::text,\n nullif(\"context_snapshot\"->>'issueId', ''),\n nullif(\"context_snapshot\"->>'taskId', ''),\n nullif(\"context_snapshot\"->>'taskKey', '')\n )", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, - "with": {}, + "concurrently": true, "method": "btree", - "concurrently": true + "with": {} } }, "foreignKeys": { "heartbeat_runs_company_id_companies_id_fk": { "name": "heartbeat_runs_company_id_companies_id_fk", "tableFrom": "heartbeat_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "heartbeat_runs_agent_id_agents_id_fk": { "name": "heartbeat_runs_agent_id_agents_id_fk", "tableFrom": "heartbeat_runs", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "heartbeat_runs_issue_id_issues_id_fk": { "name": "heartbeat_runs_issue_id_issues_id_fk", "tableFrom": "heartbeat_runs", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": { "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk", "tableFrom": "heartbeat_runs", + "tableTo": "agent_wakeup_requests", "columnsFrom": [ "wakeup_request_id" ], - "tableTo": "agent_wakeup_requests", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk": { "name": "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk", "tableFrom": "heartbeat_runs", + "tableTo": "heartbeat_runs", "columnsFrom": [ "retry_of_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "heartbeat_runs_company_native_issue_id_uq": { "name": "heartbeat_runs_company_native_issue_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "native_issue_id", "id" - ], - "nullsNotDistinct": false + ] }, "heartbeat_runs_company_native_issue_contract_id_uq": { "name": "heartbeat_runs_company_native_issue_contract_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "native_issue_id", "id", "completion_contract_id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -35722,9 +35862,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "inbox_dismissals_company_item_idx": { "name": "inbox_dismissals_company_item_idx", @@ -35743,9 +35883,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "inbox_dismissals_company_user_item_idx": { "name": "inbox_dismissals_company_user_item_idx", @@ -35770,24 +35910,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "inbox_dismissals_company_id_companies_id_fk": { "name": "inbox_dismissals_company_id_companies_id_fk", "tableFrom": "inbox_dismissals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -35857,9 +35997,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grant_delegations_grant_agent_uq": { "name": "connection_grant_delegations_grant_agent_uq", @@ -35878,52 +36018,52 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "connection_grant_delegations_company_id_companies_id_fk": { "name": "connection_grant_delegations_company_id_companies_id_fk", "tableFrom": "connection_grant_delegations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_grant_delegations_agent_id_agents_id_fk": { "name": "connection_grant_delegations_agent_id_agents_id_fk", "tableFrom": "connection_grant_delegations", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_grant_delegations_company_grant_fk": { "name": "connection_grant_delegations_company_grant_fk", "tableFrom": "connection_grant_delegations", + "tableTo": "connection_grants", "columnsFrom": [ "company_id", "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -35999,9 +36139,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grant_members_grant_subject_uq": { "name": "connection_grant_members_grant_subject_uq", @@ -36026,39 +36166,39 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "connection_grant_members_company_id_companies_id_fk": { "name": "connection_grant_members_company_id_companies_id_fk", "tableFrom": "connection_grant_members", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_grant_members_company_grant_fk": { "name": "connection_grant_members_company_grant_fk", "tableFrom": "connection_grant_members", + "tableTo": "connection_grants", "columnsFrom": [ "company_id", "grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -36215,9 +36355,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_subject_user_idx": { "name": "connection_grants_subject_user_idx", @@ -36236,9 +36376,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_subject_agent_idx": { "name": "connection_grants_subject_agent_idx", @@ -36257,9 +36397,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_user_uq": { "name": "connection_grants_user_uq", @@ -36278,9 +36418,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_agent_uq": { "name": "connection_grants_agent_uq", @@ -36299,9 +36439,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_default_uq": { "name": "connection_grants_default_uq", @@ -36314,90 +36454,90 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"connection_grants\".\"is_default\" = true and \"connection_grants\".\"kind\" = 'organization'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "connection_grants_company_id_companies_id_fk": { "name": "connection_grants_company_id_companies_id_fk", "tableFrom": "connection_grants", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_grants_subject_agent_id_agents_id_fk": { "name": "connection_grants_subject_agent_id_agents_id_fk", "tableFrom": "connection_grants", + "tableTo": "agents", "columnsFrom": [ "subject_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_grants_created_by_agent_id_agents_id_fk": { "name": "connection_grants_created_by_agent_id_agents_id_fk", "tableFrom": "connection_grants", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "connection_grants_revoked_by_agent_id_agents_id_fk": { "name": "connection_grants_revoked_by_agent_id_agents_id_fk", "tableFrom": "connection_grants", + "tableTo": "agents", "columnsFrom": [ "revoked_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "connection_grants_company_connection_fk": { "name": "connection_grants_company_connection_fk", "tableFrom": "connection_grants", + "tableTo": "tool_connections", "columnsFrom": [ "company_id", "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "connection_grants_company_id_uq": { "name": "connection_grants_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -36567,9 +36707,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_token_issuances_connection_created_idx": { "name": "connection_token_issuances_connection_created_idx", @@ -36594,9 +36734,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_token_issuances_agent_connection_idx": { "name": "connection_token_issuances_agent_connection_idx", @@ -36627,9 +36767,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_token_issuances_run_idx": { "name": "connection_token_issuances_run_idx", @@ -36648,102 +36788,102 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "connection_token_issuances_company_id_companies_id_fk": { "name": "connection_token_issuances_company_id_companies_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_token_issuances_application_id_tool_applications_id_fk": { "name": "connection_token_issuances_application_id_tool_applications_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "connection_token_issuances_connection_id_tool_connections_id_fk": { "name": "connection_token_issuances_connection_id_tool_connections_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_token_issuances_agent_id_agents_id_fk": { "name": "connection_token_issuances_agent_id_agents_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "connection_token_issuances_run_id_heartbeat_runs_id_fk": { "name": "connection_token_issuances_run_id_heartbeat_runs_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "connection_token_issuances_issue_id_issues_id_fk": { "name": "connection_token_issuances_issue_id_issues_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "connection_token_issuances_project_id_projects_id_fk": { "name": "connection_token_issuances_project_id_projects_id_fk", "tableFrom": "connection_token_issuances", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -36817,24 +36957,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "instance_settings_default_environment_id_environments_id_fk": { "name": "instance_settings_default_environment_id_environments_id_fk", "tableFrom": "instance_settings", + "tableTo": "environments", "columnsFrom": [ "default_environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -36900,9 +37040,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "instance_user_roles_role_idx": { "name": "instance_user_roles_role_idx", @@ -36915,9 +37055,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -37021,9 +37161,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "invites_company_invite_state_idx": { "name": "invites_company_invite_state_idx", @@ -37054,24 +37194,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "invites_company_id_companies_id_fk": { "name": "invites_company_id_companies_id_fk", "tableFrom": "invites", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -37171,9 +37311,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_access_grants_issue_idx": { "name": "issue_access_grants_issue_idx", @@ -37192,37 +37332,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_access_grants_issue_id_issues_id_fk": { "name": "issue_access_grants_issue_id_issues_id_fk", "tableFrom": "issue_access_grants", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_access_grants_granted_by_agent_id_agents_id_fk": { "name": "issue_access_grants_granted_by_agent_id_agents_id_fk", "tableFrom": "issue_access_grants", + "tableTo": "agents", "columnsFrom": [ "granted_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -37294,9 +37434,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_approvals_approval_idx": { "name": "issue_approvals_approval_idx", @@ -37309,9 +37449,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_approvals_company_idx": { "name": "issue_approvals_company_idx", @@ -37324,63 +37464,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_approvals_company_id_companies_id_fk": { "name": "issue_approvals_company_id_companies_id_fk", "tableFrom": "issue_approvals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_approvals_issue_id_issues_id_fk": { "name": "issue_approvals_issue_id_issues_id_fk", "tableFrom": "issue_approvals", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_approvals_approval_id_approvals_id_fk": { "name": "issue_approvals_approval_id_approvals_id_fk", "tableFrom": "issue_approvals", + "tableTo": "approvals", "columnsFrom": [ "approval_id" ], - "tableTo": "approvals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_approvals_linked_by_agent_id_agents_id_fk": { "name": "issue_approvals_linked_by_agent_id_agents_id_fk", "tableFrom": "issue_approvals", + "tableTo": "agents", "columnsFrom": [ "linked_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -37471,9 +37611,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_attachments_issue_comment_idx": { "name": "issue_attachments_issue_comment_idx", @@ -37486,9 +37626,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_attachments_originating_run_idx": { "name": "issue_attachments_originating_run_idx", @@ -37501,9 +37641,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_attachments_asset_uq": { "name": "issue_attachments_asset_uq", @@ -37516,76 +37656,76 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_attachments_company_id_companies_id_fk": { "name": "issue_attachments_company_id_companies_id_fk", "tableFrom": "issue_attachments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_attachments_issue_id_issues_id_fk": { "name": "issue_attachments_issue_id_issues_id_fk", "tableFrom": "issue_attachments", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_attachments_asset_id_assets_id_fk": { "name": "issue_attachments_asset_id_assets_id_fk", "tableFrom": "issue_attachments", + "tableTo": "assets", "columnsFrom": [ "asset_id" ], - "tableTo": "assets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_attachments_issue_comment_id_issue_comments_id_fk": { "name": "issue_attachments_issue_comment_id_issue_comments_id_fk", "tableFrom": "issue_attachments", + "tableTo": "issue_comments", "columnsFrom": [ "issue_comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_attachments_originating_run_id_heartbeat_runs_id_fk": { "name": "issue_attachments_originating_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_attachments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "originating_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -37771,9 +37911,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_comments_review_response_receipt_idx": { "name": "issue_comments_review_response_receipt_idx", @@ -37804,10 +37944,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"issue_comments\".\"author_type\" = 'agent' AND \"issue_comments\".\"metadata\"->>'authorizationReason' = 'allow_chat_run_presentation'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_comments_company_idx": { "name": "issue_comments_company_idx", @@ -37820,9 +37960,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_comments_company_issue_created_at_idx": { "name": "issue_comments_company_issue_created_at_idx", @@ -37847,9 +37987,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_comments_company_author_issue_created_at_idx": { "name": "issue_comments_company_author_issue_created_at_idx", @@ -37880,9 +38020,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_comments_body_search_idx": { "name": "issue_comments_body_search_idx", @@ -37896,157 +38036,157 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_comments_company_id_companies_id_fk": { "name": "issue_comments_company_id_companies_id_fk", "tableFrom": "issue_comments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_comments_issue_id_issues_id_fk": { "name": "issue_comments_issue_id_issues_id_fk", "tableFrom": "issue_comments", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_comments_author_agent_id_agents_id_fk": { "name": "issue_comments_author_agent_id_agents_id_fk", "tableFrom": "issue_comments", + "tableTo": "agents", "columnsFrom": [ "author_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_comments_on_behalf_of_user_id_user_id_fk": { "name": "issue_comments_on_behalf_of_user_id_user_id_fk", "tableFrom": "issue_comments", + "tableTo": "user", "columnsFrom": [ "on_behalf_of_user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_comments_created_by_run_id_heartbeat_runs_id_fk": { "name": "issue_comments_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_comments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_comments_derived_author_agent_id_agents_id_fk": { "name": "issue_comments_derived_author_agent_id_agents_id_fk", "tableFrom": "issue_comments", + "tableTo": "agents", "columnsFrom": [ "derived_author_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_comments_derived_created_by_run_id_heartbeat_runs_id_fk": { "name": "issue_comments_derived_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_comments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "derived_created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_comments_deleted_by_agent_id_agents_id_fk": { "name": "issue_comments_deleted_by_agent_id_agents_id_fk", "tableFrom": "issue_comments", + "tableTo": "agents", "columnsFrom": [ "deleted_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_comments_deleted_by_run_id_heartbeat_runs_id_fk": { "name": "issue_comments_deleted_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_comments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "deleted_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "issue_comments_client_request_uq": { "name": "issue_comments_client_request_uq", + "nullsNotDistinct": false, "columns": [ "issue_id", "author_user_id", "client_request_id" - ], - "nullsNotDistinct": false + ] }, "issue_comments_agent_client_request_uq": { "name": "issue_comments_agent_client_request_uq", + "nullsNotDistinct": false, "columns": [ "issue_id", "author_agent_id", "client_request_id" - ], - "nullsNotDistinct": false + ] }, "issue_comments_company_id_uq": { "name": "issue_comments_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -38108,9 +38248,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_create_idempotency_keys_issue_idx": { "name": "issue_create_idempotency_keys_issue_idx", @@ -38123,9 +38263,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_create_idempotency_keys_company_created_at_idx": { "name": "issue_create_idempotency_keys_company_created_at_idx", @@ -38144,37 +38284,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_create_idempotency_keys_company_id_companies_id_fk": { "name": "issue_create_idempotency_keys_company_id_companies_id_fk", "tableFrom": "issue_create_idempotency_keys", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_create_idempotency_keys_issue_id_issues_id_fk": { "name": "issue_create_idempotency_keys_issue_id_issues_id_fk", "tableFrom": "issue_create_idempotency_keys", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -38257,9 +38397,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_documents_document_uq": { "name": "issue_documents_document_uq", @@ -38272,9 +38412,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_documents_company_issue_updated_idx": { "name": "issue_documents_company_issue_updated_idx", @@ -38299,50 +38439,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_documents_company_id_companies_id_fk": { "name": "issue_documents_company_id_companies_id_fk", "tableFrom": "issue_documents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_documents_issue_id_issues_id_fk": { "name": "issue_documents_issue_id_issues_id_fk", "tableFrom": "issue_documents", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_documents_document_id_documents_id_fk": { "name": "issue_documents_document_id_documents_id_fk", "tableFrom": "issue_documents", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -38449,9 +38589,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_execution_decisions_stage_idx": { "name": "issue_execution_decisions_stage_idx", @@ -38476,63 +38616,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_execution_decisions_company_id_companies_id_fk": { "name": "issue_execution_decisions_company_id_companies_id_fk", "tableFrom": "issue_execution_decisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_execution_decisions_issue_id_issues_id_fk": { "name": "issue_execution_decisions_issue_id_issues_id_fk", "tableFrom": "issue_execution_decisions", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_execution_decisions_actor_agent_id_agents_id_fk": { "name": "issue_execution_decisions_actor_agent_id_agents_id_fk", "tableFrom": "issue_execution_decisions", + "tableTo": "agents", "columnsFrom": [ "actor_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_execution_decisions_created_by_run_id_heartbeat_runs_id_fk": { "name": "issue_execution_decisions_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_execution_decisions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -38629,9 +38769,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_inbox_archives_company_user_idx": { "name": "issue_inbox_archives_company_user_idx", @@ -38650,9 +38790,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_inbox_archives_company_issue_user_idx": { "name": "issue_inbox_archives_company_issue_user_idx", @@ -38677,63 +38817,63 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_inbox_archives_company_id_companies_id_fk": { "name": "issue_inbox_archives_company_id_companies_id_fk", "tableFrom": "issue_inbox_archives", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_inbox_archives_issue_id_issues_id_fk": { "name": "issue_inbox_archives_issue_id_issues_id_fk", "tableFrom": "issue_inbox_archives", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_inbox_archives_archived_by_agent_id_agents_id_fk": { "name": "issue_inbox_archives_archived_by_agent_id_agents_id_fk", "tableFrom": "issue_inbox_archives", + "tableTo": "agents", "columnsFrom": [ "archived_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_inbox_archives_archived_by_run_id_heartbeat_runs_id_fk": { "name": "issue_inbox_archives_archived_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_inbox_archives", + "tableTo": "heartbeat_runs", "columnsFrom": [ "archived_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -38789,9 +38929,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_labels_label_idx": { "name": "issue_labels_label_idx", @@ -38804,9 +38944,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_labels_company_idx": { "name": "issue_labels_company_idx", @@ -38819,50 +38959,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_labels_issue_id_issues_id_fk": { "name": "issue_labels_issue_id_issues_id_fk", "tableFrom": "issue_labels", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_labels_label_id_labels_id_fk": { "name": "issue_labels_label_id_labels_id_fk", "tableFrom": "issue_labels", + "tableTo": "labels", "columnsFrom": [ "label_id" ], - "tableTo": "labels", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_labels_company_id_companies_id_fk": { "name": "issue_labels_company_id_companies_id_fk", "tableFrom": "issue_labels", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -39011,9 +39151,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_plan_decompositions_active_owner_idx": { "name": "issue_plan_decompositions_active_owner_idx", @@ -39032,10 +39172,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"issue_plan_decompositions\".\"status\" = 'in_flight'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_plan_decompositions_source_revision_uq": { "name": "issue_plan_decompositions_source_revision_uq", @@ -39060,89 +39200,89 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_plan_decompositions_company_id_companies_id_fk": { "name": "issue_plan_decompositions_company_id_companies_id_fk", "tableFrom": "issue_plan_decompositions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_plan_decompositions_source_issue_id_issues_id_fk": { "name": "issue_plan_decompositions_source_issue_id_issues_id_fk", "tableFrom": "issue_plan_decompositions", + "tableTo": "issues", "columnsFrom": [ "source_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_plan_decompositions_accepted_plan_revision_id_document_revisions_id_fk": { "name": "issue_plan_decompositions_accepted_plan_revision_id_document_revisions_id_fk", "tableFrom": "issue_plan_decompositions", + "tableTo": "document_revisions", "columnsFrom": [ "accepted_plan_revision_id" ], - "tableTo": "document_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_plan_decompositions_accepted_interaction_id_issue_thread_interactions_id_fk": { "name": "issue_plan_decompositions_accepted_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "issue_plan_decompositions", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "accepted_interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_plan_decompositions_owner_agent_id_agents_id_fk": { "name": "issue_plan_decompositions_owner_agent_id_agents_id_fk", "tableFrom": "issue_plan_decompositions", + "tableTo": "agents", "columnsFrom": [ "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_plan_decompositions_owner_run_id_heartbeat_runs_id_fk": { "name": "issue_plan_decompositions_owner_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_plan_decompositions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "owner_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -39282,9 +39422,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_question_response_deliveries_correlation_uq": { "name": "issue_question_response_deliveries_correlation_uq", @@ -39297,9 +39437,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_question_response_deliveries_pending_idx": { "name": "issue_question_response_deliveries_pending_idx", @@ -39318,9 +39458,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_question_response_deliveries_company_issue_idx": { "name": "issue_question_response_deliveries_company_issue_idx", @@ -39345,76 +39485,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_question_response_deliveries_company_id_companies_id_fk": { "name": "issue_question_response_deliveries_company_id_companies_id_fk", "tableFrom": "issue_question_response_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_question_response_deliveries_issue_id_issues_id_fk": { "name": "issue_question_response_deliveries_issue_id_issues_id_fk", "tableFrom": "issue_question_response_deliveries", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_question_response_deliveries_interaction_id_issue_thread_interactions_id_fk": { "name": "issue_question_response_deliveries_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "issue_question_response_deliveries", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_question_response_deliveries_source_run_id_heartbeat_runs_id_fk": { "name": "issue_question_response_deliveries_source_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_question_response_deliveries", + "tableTo": "heartbeat_runs", "columnsFrom": [ "source_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_question_response_deliveries_target_run_id_heartbeat_runs_id_fk": { "name": "issue_question_response_deliveries_target_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_question_response_deliveries", + "tableTo": "heartbeat_runs", "columnsFrom": [ "target_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -39501,9 +39641,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_read_states_company_user_idx": { "name": "issue_read_states_company_user_idx", @@ -39522,9 +39662,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_read_states_company_issue_user_idx": { "name": "issue_read_states_company_issue_user_idx", @@ -39549,37 +39689,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_read_states_company_id_companies_id_fk": { "name": "issue_read_states_company_id_companies_id_fk", "tableFrom": "issue_read_states", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_read_states_issue_id_issues_id_fk": { "name": "issue_read_states_issue_id_issues_id_fk", "tableFrom": "issue_read_states", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -39774,23 +39914,23 @@ }, { "expression": "(\"evidence\"->>'runId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_recovery_actions_system_recovery_due_idx": { "name": "issue_recovery_actions_system_recovery_due_idx", "columns": [ { "expression": "(\"evidence\"#>'{systemRecovery,nextAttemptAt}')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -39801,10 +39941,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"issue_recovery_actions\".\"evidence\" ? 'systemRecovery'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_recovery_actions_system_recovery_adoption_idx": { "name": "issue_recovery_actions_system_recovery_adoption_idx", @@ -39817,10 +39957,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "not (\"issue_recovery_actions\".\"evidence\" ? 'systemRecovery') and (\n \"issue_recovery_actions\".\"evidence\"->'workspaceRestoreRecovery'->>'schema' = 'paperclip.workspace-restore-recovery.v1'\n or \"issue_recovery_actions\".\"cause\" in ('native_workspace_sync_out_unrecoverable', 'native_workspace_sync_out_retry_exhausted')\n )", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_recovery_actions_retained_workspace_recovery_idx": { "name": "issue_recovery_actions_retained_workspace_recovery_idx", @@ -39833,10 +39973,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\n (\"issue_recovery_actions\".\"evidence\"->'workspaceRestoreRecovery'->>'schema' = 'paperclip.workspace-restore-recovery.v1'\n or \"issue_recovery_actions\".\"cause\" in ('native_workspace_sync_out_unrecoverable', 'native_workspace_sync_out_retry_exhausted'))\n and (\"issue_recovery_actions\".\"evidence\"->'executionReconciliation' is null\n or \"issue_recovery_actions\".\"evidence\"#>>'{workspaceRecovery,status}' = 'recovered')\n ", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_recovery_actions_company_source_status_idx": { "name": "issue_recovery_actions_company_source_status_idx", @@ -39861,9 +40001,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_recovery_actions_company_owner_status_idx": { "name": "issue_recovery_actions_company_owner_status_idx", @@ -39888,9 +40028,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_recovery_actions_company_recovery_issue_idx": { "name": "issue_recovery_actions_company_recovery_issue_idx", @@ -39909,9 +40049,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_recovery_actions_active_source_uq": { "name": "issue_recovery_actions_active_source_uq", @@ -39930,10 +40070,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issue_recovery_actions\".\"status\" in ('active', 'escalated')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_recovery_actions_active_fingerprint_uq": { "name": "issue_recovery_actions_active_fingerprint_uq", @@ -39964,90 +40104,90 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issue_recovery_actions\".\"status\" in ('active', 'escalated')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "issue_recovery_actions_company_id_companies_id_fk": { "name": "issue_recovery_actions_company_id_companies_id_fk", "tableFrom": "issue_recovery_actions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_recovery_actions_source_issue_id_issues_id_fk": { "name": "issue_recovery_actions_source_issue_id_issues_id_fk", "tableFrom": "issue_recovery_actions", + "tableTo": "issues", "columnsFrom": [ "source_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_recovery_actions_recovery_issue_id_issues_id_fk": { "name": "issue_recovery_actions_recovery_issue_id_issues_id_fk", "tableFrom": "issue_recovery_actions", + "tableTo": "issues", "columnsFrom": [ "recovery_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_recovery_actions_owner_agent_id_agents_id_fk": { "name": "issue_recovery_actions_owner_agent_id_agents_id_fk", "tableFrom": "issue_recovery_actions", + "tableTo": "agents", "columnsFrom": [ "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_recovery_actions_previous_owner_agent_id_agents_id_fk": { "name": "issue_recovery_actions_previous_owner_agent_id_agents_id_fk", "tableFrom": "issue_recovery_actions", + "tableTo": "agents", "columnsFrom": [ "previous_owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_recovery_actions_return_owner_agent_id_agents_id_fk": { "name": "issue_recovery_actions_return_owner_agent_id_agents_id_fk", "tableFrom": "issue_recovery_actions", + "tableTo": "agents", "columnsFrom": [ "return_owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -40142,9 +40282,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_reference_mentions_company_target_issue_idx": { "name": "issue_reference_mentions_company_target_issue_idx", @@ -40163,9 +40303,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_reference_mentions_company_issue_pair_idx": { "name": "issue_reference_mentions_company_issue_pair_idx", @@ -40190,9 +40330,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_reference_mentions_company_source_mention_record_uq": { "name": "issue_reference_mentions_company_source_mention_record_uq", @@ -40229,10 +40369,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issue_reference_mentions\".\"source_record_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_reference_mentions_company_source_mention_null_record_uq": { "name": "issue_reference_mentions_company_source_mention_null_record_uq", @@ -40263,51 +40403,51 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issue_reference_mentions\".\"source_record_id\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "issue_reference_mentions_company_id_companies_id_fk": { "name": "issue_reference_mentions_company_id_companies_id_fk", "tableFrom": "issue_reference_mentions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_reference_mentions_source_issue_id_issues_id_fk": { "name": "issue_reference_mentions_source_issue_id_issues_id_fk", "tableFrom": "issue_reference_mentions", + "tableTo": "issues", "columnsFrom": [ "source_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_reference_mentions_target_issue_id_issues_id_fk": { "name": "issue_reference_mentions_target_issue_id_issues_id_fk", "tableFrom": "issue_reference_mentions", + "tableTo": "issues", "columnsFrom": [ "target_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -40396,9 +40536,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_relations_company_related_issue_idx": { "name": "issue_relations_company_related_issue_idx", @@ -40417,9 +40557,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_relations_company_type_idx": { "name": "issue_relations_company_type_idx", @@ -40438,9 +40578,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_relations_company_edge_uq": { "name": "issue_relations_company_edge_uq", @@ -40471,63 +40611,63 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_relations_company_id_companies_id_fk": { "name": "issue_relations_company_id_companies_id_fk", "tableFrom": "issue_relations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_relations_issue_id_issues_id_fk": { "name": "issue_relations_issue_id_issues_id_fk", "tableFrom": "issue_relations", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_relations_related_issue_id_issues_id_fk": { "name": "issue_relations_related_issue_id_issues_id_fk", "tableFrom": "issue_relations", + "tableTo": "issues", "columnsFrom": [ "related_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_relations_created_by_agent_id_agents_id_fk": { "name": "issue_relations_created_by_agent_id_agents_id_fk", "tableFrom": "issue_relations", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -40603,9 +40743,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interaction_idempotency_keys_interaction_idx": { "name": "issue_thread_interaction_idempotency_keys_interaction_idx", @@ -40618,50 +40758,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_thread_interaction_idempotency_keys_company_id_companies_id_fk": { "name": "issue_thread_interaction_idempotency_keys_company_id_companies_id_fk", "tableFrom": "issue_thread_interaction_idempotency_keys", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_thread_interaction_idempotency_keys_issue_id_issues_id_fk": { "name": "issue_thread_interaction_idempotency_keys_issue_id_issues_id_fk", "tableFrom": "issue_thread_interaction_idempotency_keys", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_thread_interaction_idempotency_keys_interaction_id_issue_thread_interactions_id_fk": { "name": "issue_thread_interaction_idempotency_keys_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "issue_thread_interaction_idempotency_keys", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -40883,9 +41023,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_company_issue_created_at_idx": { "name": "issue_thread_interactions_company_issue_created_at_idx", @@ -40910,9 +41050,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_company_issue_status_idx": { "name": "issue_thread_interactions_company_issue_status_idx", @@ -40937,9 +41077,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_company_issue_idempotency_uq": { "name": "issue_thread_interactions_company_issue_idempotency_uq", @@ -40964,10 +41104,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issue_thread_interactions\".\"idempotency_key\" IS NOT NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issue_thread_interactions_source_comment_idx": { "name": "issue_thread_interactions_source_comment_idx", @@ -40980,9 +41120,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_addressee_agent_idx": { "name": "issue_thread_interactions_addressee_agent_idx", @@ -40995,9 +41135,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_addressee_user_idx": { "name": "issue_thread_interactions_addressee_user_idx", @@ -41010,115 +41150,115 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_thread_interactions_company_id_companies_id_fk": { "name": "issue_thread_interactions_company_id_companies_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_thread_interactions_issue_id_issues_id_fk": { "name": "issue_thread_interactions_issue_id_issues_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_thread_interactions_source_comment_id_issue_comments_id_fk": { "name": "issue_thread_interactions_source_comment_id_issue_comments_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "issue_comments", "columnsFrom": [ "source_comment_id" ], - "tableTo": "issue_comments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_thread_interactions_source_run_id_heartbeat_runs_id_fk": { "name": "issue_thread_interactions_source_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "source_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_thread_interactions_created_by_agent_id_agents_id_fk": { "name": "issue_thread_interactions_created_by_agent_id_agents_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_thread_interactions_addressee_agent_id_agents_id_fk": { "name": "issue_thread_interactions_addressee_agent_id_agents_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "agents", "columnsFrom": [ "addressee_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_thread_interactions_resolved_by_agent_id_agents_id_fk": { "name": "issue_thread_interactions_resolved_by_agent_id_agents_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "agents", "columnsFrom": [ "resolved_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_thread_interactions_resolved_by_run_id_heartbeat_runs_id_fk": { "name": "issue_thread_interactions_resolved_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_thread_interactions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "resolved_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -41250,9 +41390,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_tree_hold_members_company_issue_idx": { "name": "issue_tree_hold_members_company_issue_idx", @@ -41271,9 +41411,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_tree_hold_members_hold_depth_idx": { "name": "issue_tree_hold_members_hold_depth_idx", @@ -41292,89 +41432,89 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_tree_hold_members_company_id_companies_id_fk": { "name": "issue_tree_hold_members_company_id_companies_id_fk", "tableFrom": "issue_tree_hold_members", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_tree_hold_members_hold_id_issue_tree_holds_id_fk": { "name": "issue_tree_hold_members_hold_id_issue_tree_holds_id_fk", "tableFrom": "issue_tree_hold_members", + "tableTo": "issue_tree_holds", "columnsFrom": [ "hold_id" ], - "tableTo": "issue_tree_holds", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_tree_hold_members_issue_id_issues_id_fk": { "name": "issue_tree_hold_members_issue_id_issues_id_fk", "tableFrom": "issue_tree_hold_members", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_tree_hold_members_parent_issue_id_issues_id_fk": { "name": "issue_tree_hold_members_parent_issue_id_issues_id_fk", "tableFrom": "issue_tree_hold_members", + "tableTo": "issues", "columnsFrom": [ "parent_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_tree_hold_members_assignee_agent_id_agents_id_fk": { "name": "issue_tree_hold_members_assignee_agent_id_agents_id_fk", "tableFrom": "issue_tree_hold_members", + "tableTo": "agents", "columnsFrom": [ "assignee_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_tree_hold_members_active_run_id_heartbeat_runs_id_fk": { "name": "issue_tree_hold_members_active_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_tree_hold_members", + "tableTo": "heartbeat_runs", "columnsFrom": [ "active_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -41537,9 +41677,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_tree_holds_company_status_mode_idx": { "name": "issue_tree_holds_company_status_mode_idx", @@ -41564,89 +41704,89 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_tree_holds_company_id_companies_id_fk": { "name": "issue_tree_holds_company_id_companies_id_fk", "tableFrom": "issue_tree_holds", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_tree_holds_root_issue_id_issues_id_fk": { "name": "issue_tree_holds_root_issue_id_issues_id_fk", "tableFrom": "issue_tree_holds", + "tableTo": "issues", "columnsFrom": [ "root_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_tree_holds_created_by_agent_id_agents_id_fk": { "name": "issue_tree_holds_created_by_agent_id_agents_id_fk", "tableFrom": "issue_tree_holds", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_tree_holds_created_by_run_id_heartbeat_runs_id_fk": { "name": "issue_tree_holds_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_tree_holds", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_tree_holds_released_by_agent_id_agents_id_fk": { "name": "issue_tree_holds_released_by_agent_id_agents_id_fk", "tableFrom": "issue_tree_holds", + "tableTo": "agents", "columnsFrom": [ "released_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_tree_holds_released_by_run_id_heartbeat_runs_id_fk": { "name": "issue_tree_holds_released_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_tree_holds", + "tableTo": "heartbeat_runs", "columnsFrom": [ "released_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -41815,9 +41955,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_watchdogs_company_status_idx": { "name": "issue_watchdogs_company_status_idx", @@ -41836,9 +41976,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_watchdogs_company_agent_idx": { "name": "issue_watchdogs_company_agent_idx", @@ -41857,9 +41997,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_watchdogs_company_watchdog_issue_uq": { "name": "issue_watchdogs_company_watchdog_issue_uq", @@ -41878,116 +42018,116 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issue_watchdogs\".\"watchdog_issue_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "issue_watchdogs_company_id_companies_id_fk": { "name": "issue_watchdogs_company_id_companies_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_watchdogs_issue_id_issues_id_fk": { "name": "issue_watchdogs_issue_id_issues_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_watchdogs_watchdog_agent_id_agents_id_fk": { "name": "issue_watchdogs_watchdog_agent_id_agents_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "agents", "columnsFrom": [ "watchdog_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_watchdogs_watchdog_issue_id_issues_id_fk": { "name": "issue_watchdogs_watchdog_issue_id_issues_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "issues", "columnsFrom": [ "watchdog_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_watchdogs_created_by_agent_id_agents_id_fk": { "name": "issue_watchdogs_created_by_agent_id_agents_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_watchdogs_created_by_run_id_heartbeat_runs_id_fk": { "name": "issue_watchdogs_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_watchdogs_updated_by_agent_id_agents_id_fk": { "name": "issue_watchdogs_updated_by_agent_id_agents_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "agents", "columnsFrom": [ "updated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_watchdogs_updated_by_run_id_heartbeat_runs_id_fk": { "name": "issue_watchdogs_updated_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_watchdogs", + "tableTo": "heartbeat_runs", "columnsFrom": [ "updated_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -42157,9 +42297,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_work_products_company_execution_workspace_type_idx": { "name": "issue_work_products_company_execution_workspace_type_idx", @@ -42184,9 +42324,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_work_products_company_provider_external_id_idx": { "name": "issue_work_products_company_provider_external_id_idx", @@ -42211,9 +42351,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_work_products_company_updated_idx": { "name": "issue_work_products_company_updated_idx", @@ -42232,89 +42372,89 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "issue_work_products_company_id_companies_id_fk": { "name": "issue_work_products_company_id_companies_id_fk", "tableFrom": "issue_work_products", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issue_work_products_project_id_projects_id_fk": { "name": "issue_work_products_project_id_projects_id_fk", "tableFrom": "issue_work_products", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_work_products_issue_id_issues_id_fk": { "name": "issue_work_products_issue_id_issues_id_fk", "tableFrom": "issue_work_products", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "issue_work_products_execution_workspace_id_execution_workspaces_id_fk": { "name": "issue_work_products_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "issue_work_products", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_work_products_runtime_service_id_workspace_runtime_services_id_fk": { "name": "issue_work_products_runtime_service_id_workspace_runtime_services_id_fk", "tableFrom": "issue_work_products", + "tableTo": "workspace_runtime_services", "columnsFrom": [ "runtime_service_id" ], - "tableTo": "workspace_runtime_services", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issue_work_products_created_by_run_id_heartbeat_runs_id_fk": { "name": "issue_work_products_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "issue_work_products", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -42781,9 +42921,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_status_idx": { "name": "issues_company_status_idx", @@ -42802,9 +42942,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_harness_kind_idx": { "name": "issues_company_harness_kind_idx", @@ -42823,9 +42963,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_assignee_status_idx": { "name": "issues_company_assignee_status_idx", @@ -42850,9 +42990,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_assignee_user_status_idx": { "name": "issues_company_assignee_user_status_idx", @@ -42877,9 +43017,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_responsible_user_idx": { "name": "issues_company_responsible_user_idx", @@ -42898,9 +43038,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_parent_idx": { "name": "issues_company_parent_idx", @@ -42919,9 +43059,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_privacy_parent_idx": { "name": "issues_company_privacy_parent_idx", @@ -42940,9 +43080,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_privacy_root_idx": { "name": "issues_company_privacy_root_idx", @@ -42961,9 +43101,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_project_idx": { "name": "issues_company_project_idx", @@ -42982,9 +43122,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_origin_idx": { "name": "issues_company_origin_idx", @@ -43009,9 +43149,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_origin_issue_idx": { "name": "issues_company_origin_issue_idx", @@ -43030,9 +43170,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_project_workspace_idx": { "name": "issues_company_project_workspace_idx", @@ -43051,9 +43191,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_execution_workspace_idx": { "name": "issues_company_execution_workspace_idx", @@ -43072,9 +43212,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_monitor_due_idx": { "name": "issues_company_monitor_due_idx", @@ -43093,9 +43233,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_updated_idx": { "name": "issues_company_updated_idx", @@ -43114,9 +43254,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_created_idx": { "name": "issues_company_created_idx", @@ -43135,9 +43275,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_open_normalized_title_created_idx": { "name": "issues_open_normalized_title_created_idx", @@ -43156,8 +43296,8 @@ }, { "expression": "lower(regexp_replace(btrim(\"title\"), '\\s+', ' ', 'g'))", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -43168,10 +43308,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"issues\".\"hidden_at\" is null and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_company_priority_idx": { "name": "issues_company_priority_idx", @@ -43190,9 +43330,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_identifier_idx": { "name": "issues_identifier_idx", @@ -43205,9 +43345,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_title_search_idx": { "name": "issues_title_search_idx", @@ -43221,9 +43361,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "issues_identifier_search_idx": { "name": "issues_identifier_search_idx", @@ -43237,9 +43377,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "issues_description_search_idx": { "name": "issues_description_search_idx", @@ -43253,9 +43393,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "issues_open_routine_execution_uq": { "name": "issues_open_routine_execution_uq", @@ -43286,10 +43426,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'routine_execution'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"execution_run_id\" is not null\n and \"issues\".\"status\" in ('backlog', 'todo', 'in_progress', 'in_review', 'blocked')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_active_liveness_recovery_incident_uq": { "name": "issues_active_liveness_recovery_incident_uq", @@ -43314,10 +43454,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'harness_liveness_escalation'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_active_liveness_recovery_leaf_uq": { "name": "issues_active_liveness_recovery_leaf_uq", @@ -43342,10 +43482,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'harness_liveness_escalation'\n and \"issues\".\"origin_fingerprint\" <> 'default'\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_active_stale_run_evaluation_uq": { "name": "issues_active_stale_run_evaluation_uq", @@ -43370,10 +43510,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'stale_active_run_evaluation'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_active_task_watchdog_uq": { "name": "issues_active_task_watchdog_uq", @@ -43398,10 +43538,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'task_watchdog'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_active_productivity_review_uq": { "name": "issues_active_productivity_review_uq", @@ -43426,10 +43566,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'issue_productivity_review'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_active_stranded_issue_recovery_uq": { "name": "issues_active_stranded_issue_recovery_uq", @@ -43454,10 +43594,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'stranded_issue_recovery'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "issues_onboarding_first_task_uq": { "name": "issues_onboarding_first_task_uq", @@ -43470,205 +43610,205 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"issues\".\"origin_kind\" = 'onboarding_first_task'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "issues_company_id_companies_id_fk": { "name": "issues_company_id_companies_id_fk", "tableFrom": "issues", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_conversation_agent_id_agents_id_fk": { "name": "issues_conversation_agent_id_agents_id_fk", "tableFrom": "issues", + "tableTo": "agents", "columnsFrom": [ "conversation_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_project_id_projects_id_fk": { "name": "issues_project_id_projects_id_fk", "tableFrom": "issues", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_project_workspace_id_project_workspaces_id_fk": { "name": "issues_project_workspace_id_project_workspaces_id_fk", "tableFrom": "issues", + "tableTo": "project_workspaces", "columnsFrom": [ "project_workspace_id" ], - "tableTo": "project_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issues_goal_id_goals_id_fk": { "name": "issues_goal_id_goals_id_fk", "tableFrom": "issues", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_parent_id_issues_id_fk": { "name": "issues_parent_id_issues_id_fk", "tableFrom": "issues", + "tableTo": "issues", "columnsFrom": [ "parent_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_privacy_root_issue_id_issues_id_fk": { "name": "issues_privacy_root_issue_id_issues_id_fk", "tableFrom": "issues", + "tableTo": "issues", "columnsFrom": [ "privacy_root_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_privacy_parent_issue_id_issues_id_fk": { "name": "issues_privacy_parent_issue_id_issues_id_fk", "tableFrom": "issues", + "tableTo": "issues", "columnsFrom": [ "privacy_parent_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issues_assignee_agent_id_agents_id_fk": { "name": "issues_assignee_agent_id_agents_id_fk", "tableFrom": "issues", + "tableTo": "agents", "columnsFrom": [ "assignee_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_checkout_run_id_heartbeat_runs_id_fk": { "name": "issues_checkout_run_id_heartbeat_runs_id_fk", "tableFrom": "issues", + "tableTo": "heartbeat_runs", "columnsFrom": [ "checkout_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issues_execution_run_id_heartbeat_runs_id_fk": { "name": "issues_execution_run_id_heartbeat_runs_id_fk", "tableFrom": "issues", + "tableTo": "heartbeat_runs", "columnsFrom": [ "execution_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issues_created_by_agent_id_agents_id_fk": { "name": "issues_created_by_agent_id_agents_id_fk", "tableFrom": "issues", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "issues_origin_issue_id_issues_id_fk": { "name": "issues_origin_issue_id_issues_id_fk", "tableFrom": "issues", + "tableTo": "issues", "columnsFrom": [ "origin_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "issues_execution_workspace_id_execution_workspaces_id_fk": { "name": "issues_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "issues", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "issues_company_id_uq": { "name": "issues_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -43843,10 +43983,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"join_requests\".\"status\" = 'pending_approval'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "join_requests_invite_unique_idx": { "name": "join_requests_invite_unique_idx", @@ -43859,9 +43999,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "join_requests_company_status_type_created_idx": { "name": "join_requests_company_status_type_created_idx", @@ -43892,9 +44032,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "join_requests_pending_human_user_uq": { "name": "join_requests_pending_human_user_uq", @@ -43913,10 +44053,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"join_requests\".\"request_type\" = 'human' AND \"join_requests\".\"status\" = 'pending_approval' AND \"join_requests\".\"requesting_user_id\" IS NOT NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "join_requests_pending_human_email_uq": { "name": "join_requests_pending_human_email_uq", @@ -43929,57 +44069,57 @@ }, { "expression": "lower(\"request_email_snapshot\")", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"join_requests\".\"request_type\" = 'human' AND \"join_requests\".\"status\" = 'pending_approval' AND \"join_requests\".\"request_email_snapshot\" IS NOT NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "join_requests_invite_id_invites_id_fk": { "name": "join_requests_invite_id_invites_id_fk", "tableFrom": "join_requests", + "tableTo": "invites", "columnsFrom": [ "invite_id" ], - "tableTo": "invites", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "join_requests_company_id_companies_id_fk": { "name": "join_requests_company_id_companies_id_fk", "tableFrom": "join_requests", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "join_requests_created_agent_id_agents_id_fk": { "name": "join_requests_created_agent_id_agents_id_fk", "tableFrom": "join_requests", + "tableTo": "agents", "columnsFrom": [ "created_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -44044,9 +44184,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "labels_company_name_idx": { "name": "labels_company_name_idx", @@ -44065,24 +44205,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "labels_company_id_companies_id_fk": { "name": "labels_company_id_companies_id_fk", "tableFrom": "labels", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -44232,9 +44372,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "managed_agent_profiles_company_key_uq": { "name": "managed_agent_profiles_company_key_uq", @@ -44253,9 +44393,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "managed_agent_profiles_company_resource_uq": { "name": "managed_agent_profiles_company_resource_uq", @@ -44286,37 +44426,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "managed_agent_profiles_company_id_companies_id_fk": { "name": "managed_agent_profiles_company_id_companies_id_fk", "tableFrom": "managed_agent_profiles", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "managed_agent_profiles_api_key_secret_id_company_secrets_id_fk": { "name": "managed_agent_profiles_api_key_secret_id_company_secrets_id_fk", "tableFrom": "managed_agent_profiles", + "tableTo": "company_secrets", "columnsFrom": [ "api_key_secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -44429,10 +44569,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"native_harness_backups\".\"status\" = 'current'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "native_harness_backups_scope_idx": { "name": "native_harness_backups_scope_idx", @@ -44457,9 +44597,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -44530,9 +44670,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "native_provider_artifact_references_run_idx": { "name": "native_provider_artifact_references_run_idx", @@ -44557,10 +44697,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"native_provider_artifact_references\".\"backup_id\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "native_provider_artifact_references_backup_idx": { "name": "native_provider_artifact_references_backup_idx", @@ -44585,38 +44725,38 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"native_provider_artifact_references\".\"backup_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "native_provider_artifact_references_artifact_id_native_provider_artifacts_id_fk": { "name": "native_provider_artifact_references_artifact_id_native_provider_artifacts_id_fk", "tableFrom": "native_provider_artifact_references", + "tableTo": "native_provider_artifacts", "columnsFrom": [ "artifact_id" ], - "tableTo": "native_provider_artifacts", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "native_provider_artifact_references_backup_id_native_harness_backups_id_fk": { "name": "native_provider_artifact_references_backup_id_native_harness_backups_id_fk", "tableFrom": "native_provider_artifact_references", + "tableTo": "native_harness_backups", "columnsFrom": [ "backup_id" ], - "tableTo": "native_harness_backups", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -44706,10 +44846,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"native_provider_artifacts\".\"status\" = 'ready'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": {}, @@ -44766,6 +44906,12 @@ "primaryKey": false, "notNull": false }, + "lease_holder": { + "name": "lease_holder", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, "controller_boot_id": { "name": "controller_boot_id", "type": "text", @@ -44897,10 +45043,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"native_run_finalizations\".\"decision_id\" is not null AND \"native_run_finalizations\".\"result_id\" is not null AND \"native_run_finalizations\".\"phase\" <> 'terminal_failure'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "native_run_finalizations_unsafe_export_recovery_idx": { "name": "native_run_finalizations_unsafe_export_recovery_idx", @@ -44925,10 +45071,58 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"native_run_finalizations\".\"phase\" = 'terminal_failure' AND \"native_run_finalizations\".\"failure_code\" = 'native_workspace_sync_out_unsafe_archive'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} + }, + "native_run_finalizations_finalizer_lease_idx": { + "name": "native_run_finalizations_finalizer_lease_idx", + "columns": [ + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"native_run_finalizations\".\"lease_owner\" like 'native-finalizer:%'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "native_run_finalizations_cleanup_lease_idx": { + "name": "native_run_finalizations_cleanup_lease_idx", + "columns": [ + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"native_run_finalizations\".\"lease_owner\" like 'native-cleanup:%'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "native_run_finalizations_accepted_result_lease_idx": { + "name": "native_run_finalizations_accepted_result_lease_idx", + "columns": [ + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"native_run_finalizations\".\"result_id\" is not null AND \"native_run_finalizations\".\"lease_owner\" is not null AND \"native_run_finalizations\".\"phase\" not in ('committed', 'terminal_failure', 'applied')", + "concurrently": false, + "method": "btree", + "with": {} }, "native_run_finalizations_control_deadline_idx": { "name": "native_run_finalizations_control_deadline_idx", @@ -44941,99 +45135,100 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"native_run_finalizations\".\"control_deadline_at\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "native_run_finalizations_company_id_companies_id_fk": { "name": "native_run_finalizations_company_id_companies_id_fk", "tableFrom": "native_run_finalizations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_finalizations_issue_company_fk": { "name": "native_run_finalizations_issue_company_fk", "tableFrom": "native_run_finalizations", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_finalizations_run_owner_fk": { "name": "native_run_finalizations_run_owner_fk", "tableFrom": "native_run_finalizations", + "tableTo": "heartbeat_runs", "columnsFrom": [ "company_id", "issue_id", "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "company_id", "native_issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_finalizations_result_owner_fk": { "name": "native_run_finalizations_result_owner_fk", "tableFrom": "native_run_finalizations", + "tableTo": "native_run_results", "columnsFrom": [ "company_id", "issue_id", "run_id", "result_id" ], - "tableTo": "native_run_results", "columnsTo": [ "company_id", "issue_id", "run_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_finalizations_assessment_owner_fk": { "name": "native_run_finalizations_assessment_owner_fk", "tableFrom": "native_run_finalizations", + "tableTo": "work_assessments", "columnsFrom": [ "company_id", "issue_id", "run_id", "assessment_id" ], - "tableTo": "work_assessments", "columnsTo": [ "company_id", "issue_id", "run_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_finalizations_decision_owner_fk": { "name": "native_run_finalizations_decision_owner_fk", "tableFrom": "native_run_finalizations", + "tableTo": "status_decisions", "columnsFrom": [ "company_id", "issue_id", @@ -45041,7 +45236,6 @@ "assessment_id", "decision_id" ], - "tableTo": "status_decisions", "columnsTo": [ "company_id", "issue_id", @@ -45049,8 +45243,8 @@ "assessment_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -45177,9 +45371,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "native_run_results_run_caller_result_uq": { "name": "native_run_results_run_caller_result_uq", @@ -45198,9 +45392,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "native_run_results_run_caller_dedupe_uq": { "name": "native_run_results_run_caller_dedupe_uq", @@ -45219,88 +45413,88 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "native_run_results_company_id_companies_id_fk": { "name": "native_run_results_company_id_companies_id_fk", "tableFrom": "native_run_results", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_results_issue_company_fk": { "name": "native_run_results_issue_company_fk", "tableFrom": "native_run_results", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_results_run_contract_owner_fk": { "name": "native_run_results_run_contract_owner_fk", "tableFrom": "native_run_results", + "tableTo": "heartbeat_runs", "columnsFrom": [ "company_id", "issue_id", "run_id", "completion_contract_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "company_id", "native_issue_id", "id", "completion_contract_id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "native_run_results_completion_contract_owner_fk": { "name": "native_run_results_completion_contract_owner_fk", "tableFrom": "native_run_results", + "tableTo": "completion_contracts", "columnsFrom": [ "company_id", "issue_id", "completion_contract_id" ], - "tableTo": "completion_contracts", "columnsTo": [ "company_id", "issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "native_run_results_company_issue_run_id_uq": { "name": "native_run_results_company_issue_run_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "issue_id", "run_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -45361,29 +45555,29 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"native_runner_checkpoints\".\"part\" = 'header'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "native_runner_checkpoints_company_id_issue_id_run_id_heartbeat_runs_company_id_native_issue_id_id_fk": { "name": "native_runner_checkpoints_company_id_issue_id_run_id_heartbeat_runs_company_id_native_issue_id_id_fk", "tableFrom": "native_runner_checkpoints", + "tableTo": "heartbeat_runs", "columnsFrom": [ "company_id", "issue_id", "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "company_id", "native_issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -45511,9 +45705,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_company_case_idx": { "name": "pipeline_automation_executions_company_case_idx", @@ -45532,9 +45726,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_routine_idx": { "name": "pipeline_automation_executions_routine_idx", @@ -45547,9 +45741,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_execution_issue_idx": { "name": "pipeline_automation_executions_execution_issue_idx", @@ -45562,9 +45756,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_retry_of_execution_idx": { "name": "pipeline_automation_executions_retry_of_execution_idx", @@ -45577,63 +45771,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_automation_executions_company_id_companies_id_fk": { "name": "pipeline_automation_executions_company_id_companies_id_fk", "tableFrom": "pipeline_automation_executions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_automation_executions_case_id_pipeline_cases_id_fk": { "name": "pipeline_automation_executions_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_automation_executions", + "tableTo": "pipeline_cases", "columnsFrom": [ "case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_automation_executions_routine_id_routines_id_fk": { "name": "pipeline_automation_executions_routine_id_routines_id_fk", "tableFrom": "pipeline_automation_executions", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_automation_executions_execution_issue_id_issues_id_fk": { "name": "pipeline_automation_executions_execution_issue_id_issues_id_fk", "tableFrom": "pipeline_automation_executions", + "tableTo": "issues", "columnsFrom": [ "execution_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -45709,9 +45903,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_blockers_blocked_by_idx": { "name": "pipeline_case_blockers_blocked_by_idx", @@ -45724,9 +45918,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_blockers_company_case_idx": { "name": "pipeline_case_blockers_company_case_idx", @@ -45745,50 +45939,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_case_blockers_company_id_companies_id_fk": { "name": "pipeline_case_blockers_company_id_companies_id_fk", "tableFrom": "pipeline_case_blockers", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_blockers_case_id_pipeline_cases_id_fk": { "name": "pipeline_case_blockers_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_case_blockers", + "tableTo": "pipeline_cases", "columnsFrom": [ "case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_blockers_blocked_by_case_id_pipeline_cases_id_fk": { "name": "pipeline_case_blockers_blocked_by_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_case_blockers", + "tableTo": "pipeline_cases", "columnsFrom": [ "blocked_by_case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -45876,9 +46070,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_documents_document_uq": { "name": "pipeline_case_documents_document_uq", @@ -45891,9 +46085,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_documents_company_case_updated_idx": { "name": "pipeline_case_documents_company_case_updated_idx", @@ -45918,50 +46112,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_case_documents_company_id_companies_id_fk": { "name": "pipeline_case_documents_company_id_companies_id_fk", "tableFrom": "pipeline_case_documents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_documents_case_id_pipeline_cases_id_fk": { "name": "pipeline_case_documents_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_case_documents", + "tableTo": "pipeline_cases", "columnsFrom": [ "case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_documents_document_id_documents_id_fk": { "name": "pipeline_case_documents_document_id_documents_id_fk", "tableFrom": "pipeline_case_documents", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -46075,9 +46269,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_events_company_case_idx": { "name": "pipeline_case_events_company_case_idx", @@ -46096,76 +46290,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_case_events_company_id_companies_id_fk": { "name": "pipeline_case_events_company_id_companies_id_fk", "tableFrom": "pipeline_case_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_events_case_id_pipeline_cases_id_fk": { "name": "pipeline_case_events_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_case_events", + "tableTo": "pipeline_cases", "columnsFrom": [ "case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_events_actor_agent_id_agents_id_fk": { "name": "pipeline_case_events_actor_agent_id_agents_id_fk", "tableFrom": "pipeline_case_events", + "tableTo": "agents", "columnsFrom": [ "actor_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "pipeline_case_events_from_stage_id_pipeline_stages_id_fk": { "name": "pipeline_case_events_from_stage_id_pipeline_stages_id_fk", "tableFrom": "pipeline_case_events", + "tableTo": "pipeline_stages", "columnsFrom": [ "from_stage_id" ], - "tableTo": "pipeline_stages", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "pipeline_case_events_to_stage_id_pipeline_stages_id_fk": { "name": "pipeline_case_events_to_stage_id_pipeline_stages_id_fk", "tableFrom": "pipeline_case_events", + "tableTo": "pipeline_stages", "columnsFrom": [ "to_stage_id" ], - "tableTo": "pipeline_stages", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -46285,9 +46479,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_issue_links_issue_idx": { "name": "pipeline_case_issue_links_issue_idx", @@ -46300,9 +46494,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_issue_links_company_case_idx": { "name": "pipeline_case_issue_links_company_case_idx", @@ -46321,9 +46515,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_issue_links_automation_attempt_idx": { "name": "pipeline_case_issue_links_automation_attempt_idx", @@ -46336,50 +46530,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_case_issue_links_company_id_companies_id_fk": { "name": "pipeline_case_issue_links_company_id_companies_id_fk", "tableFrom": "pipeline_case_issue_links", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_issue_links_case_id_pipeline_cases_id_fk": { "name": "pipeline_case_issue_links_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_case_issue_links", + "tableTo": "pipeline_cases", "columnsFrom": [ "case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_case_issue_links_issue_id_issues_id_fk": { "name": "pipeline_case_issue_links_issue_id_issues_id_fk", "tableFrom": "pipeline_case_issue_links", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -46621,9 +46815,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_parent_request_key_uq": { "name": "pipeline_cases_parent_request_key_uq", @@ -46642,10 +46836,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"pipeline_cases\".\"request_key\" is not null and \"pipeline_cases\".\"retired_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "pipeline_cases_company_idx": { "name": "pipeline_cases_company_idx", @@ -46658,9 +46852,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_pipeline_stage_idx": { "name": "pipeline_cases_pipeline_stage_idx", @@ -46679,9 +46873,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_parent_idx": { "name": "pipeline_cases_parent_idx", @@ -46694,9 +46888,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_automation_attempt_idx": { "name": "pipeline_cases_automation_attempt_idx", @@ -46709,9 +46903,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_retired_idx": { "name": "pipeline_cases_retired_idx", @@ -46730,9 +46924,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_lease_expires_idx": { "name": "pipeline_cases_lease_expires_idx", @@ -46745,90 +46939,90 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"pipeline_cases\".\"lease_expires_at\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "pipeline_cases_company_id_companies_id_fk": { "name": "pipeline_cases_company_id_companies_id_fk", "tableFrom": "pipeline_cases", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_cases_pipeline_id_pipelines_id_fk": { "name": "pipeline_cases_pipeline_id_pipelines_id_fk", "tableFrom": "pipeline_cases", + "tableTo": "pipelines", "columnsFrom": [ "pipeline_id" ], - "tableTo": "pipelines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_cases_stage_id_pipeline_stages_id_fk": { "name": "pipeline_cases_stage_id_pipeline_stages_id_fk", "tableFrom": "pipeline_cases", + "tableTo": "pipeline_stages", "columnsFrom": [ "stage_id" ], - "tableTo": "pipeline_stages", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "pipeline_cases_parent_case_id_pipeline_cases_id_fk": { "name": "pipeline_cases_parent_case_id_pipeline_cases_id_fk", "tableFrom": "pipeline_cases", + "tableTo": "pipeline_cases", "columnsFrom": [ "parent_case_id" ], - "tableTo": "pipeline_cases", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "pipeline_cases_lease_agent_id_agents_id_fk": { "name": "pipeline_cases_lease_agent_id_agents_id_fk", "tableFrom": "pipeline_cases", + "tableTo": "agents", "columnsFrom": [ "lease_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "pipeline_cases_created_by_agent_id_agents_id_fk": { "name": "pipeline_cases_created_by_agent_id_agents_id_fk", "tableFrom": "pipeline_cases", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -46920,9 +47114,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_documents_document_uq": { "name": "pipeline_documents_document_uq", @@ -46935,9 +47129,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_documents_company_pipeline_updated_idx": { "name": "pipeline_documents_company_pipeline_updated_idx", @@ -46962,50 +47156,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_documents_company_id_companies_id_fk": { "name": "pipeline_documents_company_id_companies_id_fk", "tableFrom": "pipeline_documents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_documents_pipeline_id_pipelines_id_fk": { "name": "pipeline_documents_pipeline_id_pipelines_id_fk", "tableFrom": "pipeline_documents", + "tableTo": "pipelines", "columnsFrom": [ "pipeline_id" ], - "tableTo": "pipelines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_documents_document_id_documents_id_fk": { "name": "pipeline_documents_document_id_documents_id_fk", "tableFrom": "pipeline_documents", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47095,9 +47289,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_stages_pipeline_position_idx": { "name": "pipeline_stages_pipeline_position_idx", @@ -47116,24 +47310,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_stages_pipeline_id_pipelines_id_fk": { "name": "pipeline_stages_pipeline_id_pipelines_id_fk", "tableFrom": "pipeline_stages", + "tableTo": "pipelines", "columnsFrom": [ "pipeline_id" ], - "tableTo": "pipelines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47221,9 +47415,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_transitions_pipeline_from_idx": { "name": "pipeline_transitions_pipeline_from_idx", @@ -47242,9 +47436,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_transitions_pipeline_to_idx": { "name": "pipeline_transitions_pipeline_to_idx", @@ -47263,50 +47457,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipeline_transitions_pipeline_id_pipelines_id_fk": { "name": "pipeline_transitions_pipeline_id_pipelines_id_fk", "tableFrom": "pipeline_transitions", + "tableTo": "pipelines", "columnsFrom": [ "pipeline_id" ], - "tableTo": "pipelines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_transitions_from_stage_id_pipeline_stages_id_fk": { "name": "pipeline_transitions_from_stage_id_pipeline_stages_id_fk", "tableFrom": "pipeline_transitions", + "tableTo": "pipeline_stages", "columnsFrom": [ "from_stage_id" ], - "tableTo": "pipeline_stages", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipeline_transitions_to_stage_id_pipeline_stages_id_fk": { "name": "pipeline_transitions_to_stage_id_pipeline_stages_id_fk", "tableFrom": "pipeline_transitions", + "tableTo": "pipeline_stages", "columnsFrom": [ "to_stage_id" ], - "tableTo": "pipeline_stages", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47414,9 +47608,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipelines_company_idx": { "name": "pipelines_company_idx", @@ -47429,9 +47623,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipelines_company_project_idx": { "name": "pipelines_company_project_idx", @@ -47450,50 +47644,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "pipelines_company_id_companies_id_fk": { "name": "pipelines_company_id_companies_id_fk", "tableFrom": "pipelines", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "pipelines_project_id_projects_id_fk": { "name": "pipelines_project_id_projects_id_fk", "tableFrom": "pipelines", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "pipelines_created_by_agent_id_agents_id_fk": { "name": "pipelines_created_by_agent_id_agents_id_fk", "tableFrom": "pipelines", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47572,9 +47766,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_company_settings_plugin_idx": { "name": "plugin_company_settings_plugin_idx", @@ -47587,9 +47781,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_company_settings_company_plugin_uq": { "name": "plugin_company_settings_company_plugin_uq", @@ -47608,37 +47802,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_company_settings_company_id_companies_id_fk": { "name": "plugin_company_settings_company_id_companies_id_fk", "tableFrom": "plugin_company_settings", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_company_settings_plugin_id_plugins_id_fk": { "name": "plugin_company_settings_plugin_id_plugins_id_fk", "tableFrom": "plugin_company_settings", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47716,37 +47910,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_config_plugin_id_plugins_id_fk": { "name": "plugin_config_plugin_id_plugins_id_fk", "tableFrom": "plugin_config", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_config_company_id_companies_id_fk": { "name": "plugin_config_company_id_companies_id_fk", "tableFrom": "plugin_config", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47825,9 +48019,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_database_namespaces_namespace_idx": { "name": "plugin_database_namespaces_namespace_idx", @@ -47840,9 +48034,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_database_namespaces_status_idx": { "name": "plugin_database_namespaces_status_idx", @@ -47855,24 +48049,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_database_namespaces_plugin_id_plugins_id_fk": { "name": "plugin_database_namespaces_plugin_id_plugins_id_fk", "tableFrom": "plugin_database_namespaces", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -47974,9 +48168,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_entities_company_idx": { "name": "plugin_entities_company_idx", @@ -47989,9 +48183,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_entities_type_idx": { "name": "plugin_entities_type_idx", @@ -48004,9 +48198,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_entities_scope_idx": { "name": "plugin_entities_scope_idx", @@ -48025,50 +48219,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_entities_plugin_id_plugins_id_fk": { "name": "plugin_entities_plugin_id_plugins_id_fk", "tableFrom": "plugin_entities", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_entities_company_id_companies_id_fk": { "name": "plugin_entities_company_id_companies_id_fk", "tableFrom": "plugin_entities", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "plugin_entities_external_idx": { "name": "plugin_entities_external_idx", + "nullsNotDistinct": true, "columns": [ "company_id", "plugin_id", "entity_type", "external_id" - ], - "nullsNotDistinct": true + ] } }, "policies": {}, @@ -48168,9 +48362,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_job_runs_plugin_idx": { "name": "plugin_job_runs_plugin_idx", @@ -48183,9 +48377,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_job_runs_company_idx": { "name": "plugin_job_runs_company_idx", @@ -48198,9 +48392,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_job_runs_status_idx": { "name": "plugin_job_runs_status_idx", @@ -48213,50 +48407,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_job_runs_job_id_plugin_jobs_id_fk": { "name": "plugin_job_runs_job_id_plugin_jobs_id_fk", "tableFrom": "plugin_job_runs", + "tableTo": "plugin_jobs", "columnsFrom": [ "job_id" ], - "tableTo": "plugin_jobs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_job_runs_plugin_id_plugins_id_fk": { "name": "plugin_job_runs_plugin_id_plugins_id_fk", "tableFrom": "plugin_job_runs", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_job_runs_company_id_companies_id_fk": { "name": "plugin_job_runs_company_id_companies_id_fk", "tableFrom": "plugin_job_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -48340,9 +48534,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_jobs_next_run_idx": { "name": "plugin_jobs_next_run_idx", @@ -48355,9 +48549,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_jobs_unique_idx": { "name": "plugin_jobs_unique_idx", @@ -48376,24 +48570,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_jobs_plugin_id_plugins_id_fk": { "name": "plugin_jobs_plugin_id_plugins_id_fk", "tableFrom": "plugin_jobs", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -48438,37 +48632,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_lifecycle_acknowledgments_plugin_id_plugins_id_fk": { "name": "plugin_lifecycle_acknowledgments_plugin_id_plugins_id_fk", "tableFrom": "plugin_lifecycle_acknowledgments", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_lifecycle_acknowledgments_event_id_resource_lifecycle_events_id_fk": { "name": "plugin_lifecycle_acknowledgments_event_id_resource_lifecycle_events_id_fk", "tableFrom": "plugin_lifecycle_acknowledgments", + "tableTo": "resource_lifecycle_events", "columnsFrom": [ "event_id" ], - "tableTo": "resource_lifecycle_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -48553,9 +48747,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_logs_company_idx": { "name": "plugin_logs_company_idx", @@ -48568,9 +48762,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_logs_level_idx": { "name": "plugin_logs_level_idx", @@ -48583,37 +48777,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_logs_plugin_id_plugins_id_fk": { "name": "plugin_logs_plugin_id_plugins_id_fk", "tableFrom": "plugin_logs", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_logs_company_id_companies_id_fk": { "name": "plugin_logs_company_id_companies_id_fk", "tableFrom": "plugin_logs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -48703,9 +48897,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_managed_resources_plugin_idx": { "name": "plugin_managed_resources_plugin_idx", @@ -48718,9 +48912,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_managed_resources_resource_idx": { "name": "plugin_managed_resources_resource_idx", @@ -48739,9 +48933,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_managed_resources_company_plugin_resource_uq": { "name": "plugin_managed_resources_company_plugin_resource_uq", @@ -48772,37 +48966,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_managed_resources_company_id_companies_id_fk": { "name": "plugin_managed_resources_company_id_companies_id_fk", "tableFrom": "plugin_managed_resources", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_managed_resources_plugin_id_plugins_id_fk": { "name": "plugin_managed_resources_plugin_id_plugins_id_fk", "tableFrom": "plugin_managed_resources", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -48902,9 +49096,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_migrations_plugin_idx": { "name": "plugin_migrations_plugin_idx", @@ -48917,9 +49111,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_migrations_status_idx": { "name": "plugin_migrations_status_idx", @@ -48932,24 +49126,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_migrations_plugin_id_plugins_id_fk": { "name": "plugin_migrations_plugin_id_plugins_id_fk", "tableFrom": "plugin_migrations", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -49032,38 +49226,38 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_state_plugin_id_plugins_id_fk": { "name": "plugin_state_plugin_id_plugins_id_fk", "tableFrom": "plugin_state", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "plugin_state_unique_entry_idx": { "name": "plugin_state_unique_entry_idx", + "nullsNotDistinct": true, "columns": [ "plugin_id", "scope_kind", "scope_id", "namespace", "state_key" - ], - "nullsNotDistinct": true + ] } }, "policies": {}, @@ -49169,9 +49363,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_webhook_deliveries_company_idx": { "name": "plugin_webhook_deliveries_company_idx", @@ -49184,9 +49378,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_webhook_deliveries_status_idx": { "name": "plugin_webhook_deliveries_status_idx", @@ -49199,9 +49393,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_webhook_deliveries_key_idx": { "name": "plugin_webhook_deliveries_key_idx", @@ -49214,37 +49408,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "plugin_webhook_deliveries_plugin_id_plugins_id_fk": { "name": "plugin_webhook_deliveries_plugin_id_plugins_id_fk", "tableFrom": "plugin_webhook_deliveries", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "plugin_webhook_deliveries_company_id_companies_id_fk": { "name": "plugin_webhook_deliveries_company_id_companies_id_fk", "tableFrom": "plugin_webhook_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -49354,9 +49548,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugins_status_idx": { "name": "plugins_status_idx", @@ -49369,9 +49563,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -49473,9 +49667,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "principal_permission_grants_company_permission_idx": { "name": "principal_permission_grants_company_permission_idx", @@ -49494,24 +49688,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "principal_permission_grants_company_id_companies_id_fk": { "name": "principal_permission_grants_company_id_companies_id_fk", "tableFrom": "principal_permission_grants", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -49587,9 +49781,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_access_members_subject_lookup_idx": { "name": "project_access_members_subject_lookup_idx", @@ -49620,37 +49814,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "project_access_members_company_id_companies_id_fk": { "name": "project_access_members_company_id_companies_id_fk", "tableFrom": "project_access_members", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "project_access_members_project_id_projects_id_fk": { "name": "project_access_members_project_id_projects_id_fk", "tableFrom": "project_access_members", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -49713,9 +49907,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_goals_goal_idx": { "name": "project_goals_goal_idx", @@ -49728,9 +49922,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_goals_company_idx": { "name": "project_goals_company_idx", @@ -49743,50 +49937,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "project_goals_project_id_projects_id_fk": { "name": "project_goals_project_id_projects_id_fk", "tableFrom": "project_goals", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "project_goals_goal_id_goals_id_fk": { "name": "project_goals_goal_id_goals_id_fk", "tableFrom": "project_goals", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "project_goals_company_id_companies_id_fk": { "name": "project_goals_company_id_companies_id_fk", "tableFrom": "project_goals", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": { @@ -49878,9 +50072,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_memberships_company_user_starred_idx": { "name": "project_memberships_company_user_starred_idx", @@ -49905,9 +50099,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_memberships_project_idx": { "name": "project_memberships_project_idx", @@ -49920,9 +50114,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_memberships_company_user_project_uq": { "name": "project_memberships_company_user_project_uq", @@ -49947,37 +50141,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "project_memberships_company_id_companies_id_fk": { "name": "project_memberships_company_id_companies_id_fk", "tableFrom": "project_memberships", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "project_memberships_project_id_projects_id_fk": { "name": "project_memberships_project_id_projects_id_fk", "tableFrom": "project_memberships", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -50129,9 +50323,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_project_primary_idx": { "name": "project_workspaces_project_primary_idx", @@ -50150,9 +50344,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_project_source_type_idx": { "name": "project_workspaces_project_source_type_idx", @@ -50171,9 +50365,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_company_shared_key_idx": { "name": "project_workspaces_company_shared_key_idx", @@ -50192,9 +50386,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_project_remote_ref_idx": { "name": "project_workspaces_project_remote_ref_idx", @@ -50219,37 +50413,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "project_workspaces_company_id_companies_id_fk": { "name": "project_workspaces_company_id_companies_id_fk", "tableFrom": "project_workspaces", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "project_workspaces_project_id_projects_id_fk": { "name": "project_workspaces_project_id_projects_id_fk", "tableFrom": "project_workspaces", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -50418,9 +50612,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "projects_company_idx": { "name": "projects_company_idx", @@ -50433,9 +50627,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "projects_company_personal_owner_uq": { "name": "projects_company_personal_owner_uq", @@ -50454,64 +50648,64 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"projects\".\"personal_owner_user_id\" is not null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "projects_company_id_companies_id_fk": { "name": "projects_company_id_companies_id_fk", "tableFrom": "projects", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "projects_goal_id_goals_id_fk": { "name": "projects_goal_id_goals_id_fk", "tableFrom": "projects", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "projects_lead_agent_id_agents_id_fk": { "name": "projects_lead_agent_id_agents_id_fk", "tableFrom": "projects", + "tableTo": "agents", "columnsFrom": [ "lead_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "projects_git_authorization_grant_id_connection_grants_id_fk": { "name": "projects_git_authorization_grant_id_connection_grants_id_fk", "tableFrom": "projects", + "tableTo": "connection_grants", "columnsFrom": [ "git_authorization_grant_id" ], - "tableTo": "connection_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -50638,9 +50832,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "provider_trace_records_expiry_idx": { "name": "provider_trace_records_expiry_idx", @@ -50659,9 +50853,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "provider_trace_records_company_created_idx": { "name": "provider_trace_records_company_created_idx", @@ -50680,37 +50874,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "provider_trace_records_company_id_companies_id_fk": { "name": "provider_trace_records_company_id_companies_id_fk", "tableFrom": "provider_trace_records", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "provider_trace_records_run_id_heartbeat_runs_id_fk": { "name": "provider_trace_records_run_id_heartbeat_runs_id_fk", "tableFrom": "provider_trace_records", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -50821,9 +51015,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "remote_agent_profiles_company_key_uq": { "name": "remote_agent_profiles_company_key_uq", @@ -50842,24 +51036,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "remote_agent_profiles_company_id_companies_id_fk": { "name": "remote_agent_profiles_company_id_companies_id_fk", "tableFrom": "remote_agent_profiles", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -50887,15 +51081,15 @@ "primaryKey": true, "notNull": true, "identity": { + "type": "always", "name": "resource_lifecycle_events_id_seq", + "schema": "public", "increment": "1", + "startWith": "1", "minValue": "1", "maxValue": "9223372036854775807", - "startWith": "1", "cache": "1", - "cycle": false, - "schema": "public", - "type": "always" + "cycle": false } }, "company_id": { @@ -50954,10 +51148,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"resource_lifecycle_events\".\"action\" = 'create'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "resource_lifecycle_events_company_idx": { "name": "resource_lifecycle_events_company_idx", @@ -50976,9 +51170,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "resource_lifecycle_events_resource_order_idx": { "name": "resource_lifecycle_events_resource_order_idx", @@ -51009,24 +51203,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "resource_lifecycle_events_company_id_companies_id_fk": { "name": "resource_lifecycle_events_company_id_companies_id_fk", "tableFrom": "resource_lifecycle_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -51118,9 +51312,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_documents_document_uq": { "name": "routine_documents_document_uq", @@ -51133,9 +51327,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_documents_company_routine_updated_idx": { "name": "routine_documents_company_routine_updated_idx", @@ -51160,50 +51354,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "routine_documents_company_id_companies_id_fk": { "name": "routine_documents_company_id_companies_id_fk", "tableFrom": "routine_documents", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "routine_documents_routine_id_routines_id_fk": { "name": "routine_documents_routine_id_routines_id_fk", "tableFrom": "routine_documents", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_documents_document_id_documents_id_fk": { "name": "routine_documents_document_id_documents_id_fk", "tableFrom": "routine_documents", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -51321,9 +51515,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_revisions_company_routine_created_idx": { "name": "routine_revisions_company_routine_created_idx", @@ -51348,9 +51542,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_revisions_company_responsible_user_idx": { "name": "routine_revisions_company_responsible_user_idx", @@ -51375,76 +51569,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "routine_revisions_company_id_companies_id_fk": { "name": "routine_revisions_company_id_companies_id_fk", "tableFrom": "routine_revisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_revisions_routine_id_routines_id_fk": { "name": "routine_revisions_routine_id_routines_id_fk", "tableFrom": "routine_revisions", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_revisions_restored_from_revision_id_routine_revisions_id_fk": { "name": "routine_revisions_restored_from_revision_id_routine_revisions_id_fk", "tableFrom": "routine_revisions", + "tableTo": "routine_revisions", "columnsFrom": [ "restored_from_revision_id" ], - "tableTo": "routine_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routine_revisions_created_by_agent_id_agents_id_fk": { "name": "routine_revisions_created_by_agent_id_agents_id_fk", "tableFrom": "routine_revisions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routine_revisions_created_by_run_id_heartbeat_runs_id_fk": { "name": "routine_revisions_created_by_run_id_heartbeat_runs_id_fk", "tableFrom": "routine_revisions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "created_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -51601,9 +51795,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_revision_idx": { "name": "routine_runs_revision_idx", @@ -51616,9 +51810,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_company_responsible_user_idx": { "name": "routine_runs_company_responsible_user_idx", @@ -51643,9 +51837,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_trigger_idx": { "name": "routine_runs_trigger_idx", @@ -51664,9 +51858,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_dispatch_fingerprint_idx": { "name": "routine_runs_dispatch_fingerprint_idx", @@ -51685,9 +51879,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_linked_issue_idx": { "name": "routine_runs_linked_issue_idx", @@ -51700,9 +51894,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_trigger_idempotency_idx": { "name": "routine_runs_trigger_idempotency_idx", @@ -51721,76 +51915,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "routine_runs_company_id_companies_id_fk": { "name": "routine_runs_company_id_companies_id_fk", "tableFrom": "routine_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_runs_routine_id_routines_id_fk": { "name": "routine_runs_routine_id_routines_id_fk", "tableFrom": "routine_runs", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_runs_trigger_id_routine_triggers_id_fk": { "name": "routine_runs_trigger_id_routine_triggers_id_fk", "tableFrom": "routine_runs", + "tableTo": "routine_triggers", "columnsFrom": [ "trigger_id" ], - "tableTo": "routine_triggers", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routine_runs_routine_revision_id_routine_revisions_id_fk": { "name": "routine_runs_routine_revision_id_routine_revisions_id_fk", "tableFrom": "routine_runs", + "tableTo": "routine_revisions", "columnsFrom": [ "routine_revision_id" ], - "tableTo": "routine_revisions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routine_runs_linked_issue_id_issues_id_fk": { "name": "routine_runs_linked_issue_id_issues_id_fk", "tableFrom": "routine_runs", + "tableTo": "issues", "columnsFrom": [ "linked_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -51978,9 +52172,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_company_kind_idx": { "name": "routine_triggers_company_kind_idx", @@ -51999,9 +52193,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_next_run_idx": { "name": "routine_triggers_next_run_idx", @@ -52014,9 +52208,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_public_id_idx": { "name": "routine_triggers_public_id_idx", @@ -52029,9 +52223,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_public_id_uq": { "name": "routine_triggers_public_id_uq", @@ -52044,76 +52238,76 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "routine_triggers_company_id_companies_id_fk": { "name": "routine_triggers_company_id_companies_id_fk", "tableFrom": "routine_triggers", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_triggers_routine_id_routines_id_fk": { "name": "routine_triggers_routine_id_routines_id_fk", "tableFrom": "routine_triggers", + "tableTo": "routines", "columnsFrom": [ "routine_id" ], - "tableTo": "routines", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_triggers_secret_id_company_secrets_id_fk": { "name": "routine_triggers_secret_id_company_secrets_id_fk", "tableFrom": "routine_triggers", + "tableTo": "company_secrets", "columnsFrom": [ "secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routine_triggers_created_by_agent_id_agents_id_fk": { "name": "routine_triggers_created_by_agent_id_agents_id_fk", "tableFrom": "routine_triggers", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routine_triggers_updated_by_agent_id_agents_id_fk": { "name": "routine_triggers_updated_by_agent_id_agents_id_fk", "tableFrom": "routine_triggers", + "tableTo": "agents", "columnsFrom": [ "updated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -52177,37 +52371,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "routine_webhook_test_receipts_company_id_companies_id_fk": { "name": "routine_webhook_test_receipts_company_id_companies_id_fk", "tableFrom": "routine_webhook_test_receipts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routine_webhook_test_receipts_trigger_id_routine_triggers_id_fk": { "name": "routine_webhook_test_receipts_trigger_id_routine_triggers_id_fk", "tableFrom": "routine_webhook_test_receipts", + "tableTo": "routine_triggers", "columnsFrom": [ "trigger_id" ], - "tableTo": "routine_triggers", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -52431,9 +52625,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_assignee_idx": { "name": "routines_company_assignee_idx", @@ -52452,9 +52646,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_project_idx": { "name": "routines_company_project_idx", @@ -52473,9 +52667,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_folder_idx": { "name": "routines_company_folder_idx", @@ -52494,9 +52688,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_responsible_user_idx": { "name": "routines_company_responsible_user_idx", @@ -52515,9 +52709,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_origin_idx": { "name": "routines_company_origin_idx", @@ -52542,115 +52736,115 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "routines_company_id_companies_id_fk": { "name": "routines_company_id_companies_id_fk", "tableFrom": "routines", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routines_project_id_projects_id_fk": { "name": "routines_project_id_projects_id_fk", "tableFrom": "routines", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "routines_folder_id_folders_id_fk": { "name": "routines_folder_id_folders_id_fk", "tableFrom": "routines", + "tableTo": "folders", "columnsFrom": [ "folder_id" ], - "tableTo": "folders", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routines_goal_id_goals_id_fk": { "name": "routines_goal_id_goals_id_fk", "tableFrom": "routines", + "tableTo": "goals", "columnsFrom": [ "goal_id" ], - "tableTo": "goals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routines_parent_issue_id_issues_id_fk": { "name": "routines_parent_issue_id_issues_id_fk", "tableFrom": "routines", + "tableTo": "issues", "columnsFrom": [ "parent_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routines_assignee_agent_id_agents_id_fk": { "name": "routines_assignee_agent_id_agents_id_fk", "tableFrom": "routines", + "tableTo": "agents", "columnsFrom": [ "assignee_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "routines_created_by_agent_id_agents_id_fk": { "name": "routines_created_by_agent_id_agents_id_fk", "tableFrom": "routines", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "routines_updated_by_agent_id_agents_id_fk": { "name": "routines_updated_by_agent_id_agents_id_fk", "tableFrom": "routines", + "tableTo": "agents", "columnsFrom": [ "updated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -52763,9 +52957,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "run_identity_contexts_run_correlation_idx": { "name": "run_identity_contexts_run_correlation_idx", @@ -52784,9 +52978,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "run_identity_contexts_company_run_idx": { "name": "run_identity_contexts_company_run_idx", @@ -52805,24 +52999,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "run_identity_contexts_company_id_companies_id_fk": { "name": "run_identity_contexts_company_id_companies_id_fk", "tableFrom": "run_identity_contexts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -52886,50 +53080,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "runner_api_response_reservations_company_id_companies_id_fk": { "name": "runner_api_response_reservations_company_id_companies_id_fk", "tableFrom": "runner_api_response_reservations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "runner_api_response_reservations_run_id_heartbeat_runs_id_fk": { "name": "runner_api_response_reservations_run_id_heartbeat_runs_id_fk", "tableFrom": "runner_api_response_reservations", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "runner_api_response_reservations_asset_id_assets_id_fk": { "name": "runner_api_response_reservations_asset_id_assets_id_fk", "tableFrom": "runner_api_response_reservations", + "tableTo": "assets", "columnsFrom": [ "asset_id" ], - "tableTo": "assets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -53067,10 +53261,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"sandbox_creation_operations\".\"state\" = 'pending'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "sandbox_creation_operations_owner_idx": { "name": "sandbox_creation_operations_owner_idx", @@ -53101,24 +53295,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "sandbox_creation_operations_environment_id_environments_id_fk": { "name": "sandbox_creation_operations_environment_id_environments_id_fk", "tableFrom": "sandbox_creation_operations", + "tableTo": "environments", "columnsFrom": [ "environment_id" ], - "tableTo": "environments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -53285,9 +53479,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_secret_created_idx": { "name": "secret_access_events_secret_created_idx", @@ -53306,9 +53500,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_user_definition_created_idx": { "name": "secret_access_events_user_definition_created_idx", @@ -53327,9 +53521,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_company_credential_owner_idx": { "name": "secret_access_events_company_credential_owner_idx", @@ -53354,9 +53548,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_consumer_idx": { "name": "secret_access_events_consumer_idx", @@ -53381,9 +53575,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_run_idx": { "name": "secret_access_events_run_idx", @@ -53396,89 +53590,89 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "secret_access_events_company_id_companies_id_fk": { "name": "secret_access_events_company_id_companies_id_fk", "tableFrom": "secret_access_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "secret_access_events_secret_id_company_secrets_id_fk": { "name": "secret_access_events_secret_id_company_secrets_id_fk", "tableFrom": "secret_access_events", + "tableTo": "company_secrets", "columnsFrom": [ "secret_id" ], - "tableTo": "company_secrets", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "secret_access_events_user_secret_definition_id_user_secret_definitions_id_fk": { "name": "secret_access_events_user_secret_definition_id_user_secret_definitions_id_fk", "tableFrom": "secret_access_events", + "tableTo": "user_secret_definitions", "columnsFrom": [ "user_secret_definition_id" ], - "tableTo": "user_secret_definitions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "secret_access_events_issue_id_issues_id_fk": { "name": "secret_access_events_issue_id_issues_id_fk", "tableFrom": "secret_access_events", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "secret_access_events_heartbeat_run_id_heartbeat_runs_id_fk": { "name": "secret_access_events_heartbeat_run_id_heartbeat_runs_id_fk", "tableFrom": "secret_access_events", + "tableTo": "heartbeat_runs", "columnsFrom": [ "heartbeat_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "secret_access_events_plugin_id_plugins_id_fk": { "name": "secret_access_events_plugin_id_plugins_id_fk", "tableFrom": "secret_access_events", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -53579,9 +53773,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "smoke_run_steps_company_path_idx": { "name": "smoke_run_steps_company_path_idx", @@ -53600,37 +53794,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "smoke_run_steps_company_id_companies_id_fk": { "name": "smoke_run_steps_company_id_companies_id_fk", "tableFrom": "smoke_run_steps", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "smoke_run_steps_run_id_smoke_runs_id_fk": { "name": "smoke_run_steps_run_id_smoke_runs_id_fk", "tableFrom": "smoke_run_steps", + "tableTo": "smoke_runs", "columnsFrom": [ "run_id" ], - "tableTo": "smoke_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -53722,9 +53916,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "smoke_runs_company_status_idx": { "name": "smoke_runs_company_status_idx", @@ -53743,24 +53937,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "smoke_runs_company_id_companies_id_fk": { "name": "smoke_runs_company_id_companies_id_fk", "tableFrom": "smoke_runs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -53900,9 +54094,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_card_updates_generation_issue_idx": { "name": "status_card_updates_generation_issue_idx", @@ -53915,50 +54109,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "status_card_updates_card_id_status_cards_id_fk": { "name": "status_card_updates_card_id_status_cards_id_fk", "tableFrom": "status_card_updates", + "tableTo": "status_cards", "columnsFrom": [ "card_id" ], - "tableTo": "status_cards", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "status_card_updates_generation_issue_id_issues_id_fk": { "name": "status_card_updates_generation_issue_id_issues_id_fk", "tableFrom": "status_card_updates", + "tableTo": "issues", "columnsFrom": [ "generation_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "status_card_updates_run_id_heartbeat_runs_id_fk": { "name": "status_card_updates_run_id_heartbeat_runs_id_fk", "tableFrom": "status_card_updates", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -54197,9 +54391,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_cards_company_next_eval_idx": { "name": "status_cards_company_next_eval_idx", @@ -54218,102 +54412,102 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "status_cards_company_id_companies_id_fk": { "name": "status_cards_company_id_companies_id_fk", "tableFrom": "status_cards", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "status_cards_created_by_agent_id_agents_id_fk": { "name": "status_cards_created_by_agent_id_agents_id_fk", "tableFrom": "status_cards", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "status_cards_query_compiled_by_agent_id_agents_id_fk": { "name": "status_cards_query_compiled_by_agent_id_agents_id_fk", "tableFrom": "status_cards", + "tableTo": "agents", "columnsFrom": [ "query_compiled_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "status_cards_agent_id_agents_id_fk": { "name": "status_cards_agent_id_agents_id_fk", "tableFrom": "status_cards", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "status_cards_document_id_documents_id_fk": { "name": "status_cards_document_id_documents_id_fk", "tableFrom": "status_cards", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "status_cards_generating_issue_id_issues_id_fk": { "name": "status_cards_generating_issue_id_issues_id_fk", "tableFrom": "status_cards", + "tableTo": "issues", "columnsFrom": [ "generating_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "status_cards_archived_by_agent_id_agents_id_fk": { "name": "status_cards_archived_by_agent_id_agents_id_fk", "tableFrom": "status_cards", + "tableTo": "agents", "columnsFrom": [ "archived_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -54458,10 +54652,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"status_decision_effects\".\"delivery_state\" in ('pending', 'failed')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "status_decision_effects_decision_ordinal_uq": { "name": "status_decision_effects_decision_ordinal_uq", @@ -54480,9 +54674,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_decision_effects_company_idempotency_uq": { "name": "status_decision_effects_company_idempotency_uq", @@ -54501,56 +54695,56 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "status_decision_effects_company_id_companies_id_fk": { "name": "status_decision_effects_company_id_companies_id_fk", "tableFrom": "status_decision_effects", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "status_decision_effects_issue_company_fk": { "name": "status_decision_effects_issue_company_fk", "tableFrom": "status_decision_effects", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "status_decision_effects_decision_owner_fk": { "name": "status_decision_effects_decision_owner_fk", "tableFrom": "status_decision_effects", + "tableTo": "status_decisions", "columnsFrom": [ "company_id", "issue_id", "decision_id" ], - "tableTo": "status_decisions", "columnsTo": [ "company_id", "issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -54687,9 +54881,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_decisions_company_assessment_uq": { "name": "status_decisions_company_assessment_uq", @@ -54708,9 +54902,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_decisions_company_issue_digest_uq": { "name": "status_decisions_company_issue_digest_uq", @@ -54735,98 +54929,98 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "status_decisions_company_id_companies_id_fk": { "name": "status_decisions_company_id_companies_id_fk", "tableFrom": "status_decisions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "status_decisions_issue_company_fk": { "name": "status_decisions_issue_company_fk", "tableFrom": "status_decisions", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "status_decisions_assessment_owner_fk": { "name": "status_decisions_assessment_owner_fk", "tableFrom": "status_decisions", + "tableTo": "work_assessments", "columnsFrom": [ "company_id", "issue_id", "run_id", "assessment_id" ], - "tableTo": "work_assessments", "columnsTo": [ "company_id", "issue_id", "run_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "status_decisions_supersedes_owner_fk": { "name": "status_decisions_supersedes_owner_fk", "tableFrom": "status_decisions", + "tableTo": "status_decisions", "columnsFrom": [ "company_id", "issue_id", "supersedes_decision_id" ], - "tableTo": "status_decisions", "columnsTo": [ "company_id", "issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "status_decisions_company_issue_id_uq": { "name": "status_decisions_company_issue_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "issue_id", "id" - ], - "nullsNotDistinct": false + ] }, "status_decisions_company_issue_run_assessment_id_uq": { "name": "status_decisions_company_issue_run_assessment_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "issue_id", "run_id", "assessment_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -54938,9 +55132,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "summary_slots_company_scope_idx": { "name": "summary_slots_company_scope_idx", @@ -54965,9 +55159,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "summary_slots_company_generating_issue_idx": { "name": "summary_slots_company_generating_issue_idx", @@ -54986,9 +55180,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "summary_slots_company_updated_idx": { "name": "summary_slots_company_updated_idx", @@ -55007,76 +55201,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "summary_slots_company_id_companies_id_fk": { "name": "summary_slots_company_id_companies_id_fk", "tableFrom": "summary_slots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "summary_slots_document_id_documents_id_fk": { "name": "summary_slots_document_id_documents_id_fk", "tableFrom": "summary_slots", + "tableTo": "documents", "columnsFrom": [ "document_id" ], - "tableTo": "documents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "summary_slots_generating_issue_id_issues_id_fk": { "name": "summary_slots_generating_issue_id_issues_id_fk", "tableFrom": "summary_slots", + "tableTo": "issues", "columnsFrom": [ "generating_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "summary_slots_last_generated_by_agent_id_agents_id_fk": { "name": "summary_slots_last_generated_by_agent_id_agents_id_fk", "tableFrom": "summary_slots", + "tableTo": "agents", "columnsFrom": [ "last_generated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "summary_slots_company_scope_slot_uq": { "name": "summary_slots_company_scope_slot_uq", + "nullsNotDistinct": true, "columns": [ "company_id", "scope_kind", "scope_id", "slot_key" - ], - "nullsNotDistinct": true + ] } }, "policies": {}, @@ -55206,9 +55400,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_access_audit_connection_idx": { "name": "tool_access_audit_connection_idx", @@ -55221,9 +55415,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_access_audit_gateway_idx": { "name": "tool_access_audit_gateway_idx", @@ -55242,76 +55436,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_access_audit_events_company_id_companies_id_fk": { "name": "tool_access_audit_events_company_id_companies_id_fk", "tableFrom": "tool_access_audit_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_access_audit_events_gateway_id_tool_mcp_gateways_id_fk": { "name": "tool_access_audit_events_gateway_id_tool_mcp_gateways_id_fk", "tableFrom": "tool_access_audit_events", + "tableTo": "tool_mcp_gateways", "columnsFrom": [ "gateway_id" ], - "tableTo": "tool_mcp_gateways", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_access_audit_events_gateway_token_id_tool_mcp_gateway_tokens_id_fk": { "name": "tool_access_audit_events_gateway_token_id_tool_mcp_gateway_tokens_id_fk", "tableFrom": "tool_access_audit_events", + "tableTo": "tool_mcp_gateway_tokens", "columnsFrom": [ "gateway_token_id" ], - "tableTo": "tool_mcp_gateway_tokens", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_access_audit_events_connection_id_tool_connections_id_fk": { "name": "tool_access_audit_events_connection_id_tool_connections_id_fk", "tableFrom": "tool_access_audit_events", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_access_audit_events_catalog_entry_id_tool_catalog_entries_id_fk": { "name": "tool_access_audit_events_catalog_entry_id_tool_catalog_entries_id_fk", "tableFrom": "tool_access_audit_events", + "tableTo": "tool_catalog_entries", "columnsFrom": [ "catalog_entry_id" ], - "tableTo": "tool_catalog_entries", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -55380,63 +55574,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_action_deliveries_action_request_id_tool_action_requests_id_fk": { "name": "tool_action_deliveries_action_request_id_tool_action_requests_id_fk", "tableFrom": "tool_action_deliveries", + "tableTo": "tool_action_requests", "columnsFrom": [ "action_request_id" ], - "tableTo": "tool_action_requests", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_action_deliveries_company_id_companies_id_fk": { "name": "tool_action_deliveries_company_id_companies_id_fk", "tableFrom": "tool_action_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_action_deliveries_issue_id_issues_id_fk": { "name": "tool_action_deliveries_issue_id_issues_id_fk", "tableFrom": "tool_action_deliveries", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_action_deliveries_interaction_id_issue_thread_interactions_id_fk": { "name": "tool_action_deliveries_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "tool_action_deliveries", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -55604,9 +55798,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_action_requests_pending_expiry_idx": { "name": "tool_action_requests_pending_expiry_idx", @@ -55625,10 +55819,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"tool_action_requests\".\"status\" = 'pending'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "tool_action_requests_company_pending_expiry_idx": { "name": "tool_action_requests_company_pending_expiry_idx", @@ -55647,10 +55841,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"tool_action_requests\".\"status\" = 'pending'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "tool_action_requests_executing_deadline_idx": { "name": "tool_action_requests_executing_deadline_idx", @@ -55669,10 +55863,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"tool_action_requests\".\"status\" = 'executing'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "tool_action_requests_approved_idx": { "name": "tool_action_requests_approved_idx", @@ -55685,10 +55879,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"tool_action_requests\".\"status\" = 'approved'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "tool_action_requests_invocation_idx": { "name": "tool_action_requests_invocation_idx", @@ -55701,9 +55895,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_action_requests_company_interaction_idx": { "name": "tool_action_requests_company_interaction_idx", @@ -55722,9 +55916,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_action_requests_issue_idx": { "name": "tool_action_requests_issue_idx", @@ -55743,115 +55937,115 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_action_requests_company_id_companies_id_fk": { "name": "tool_action_requests_company_id_companies_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_action_requests_invocation_id_tool_invocations_id_fk": { "name": "tool_action_requests_invocation_id_tool_invocations_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "tool_invocations", "columnsFrom": [ "invocation_id" ], - "tableTo": "tool_invocations", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_action_requests_issue_id_issues_id_fk": { "name": "tool_action_requests_issue_id_issues_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_action_requests_interaction_id_issue_thread_interactions_id_fk": { "name": "tool_action_requests_interaction_id_issue_thread_interactions_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "issue_thread_interactions", "columnsFrom": [ "interaction_id" ], - "tableTo": "issue_thread_interactions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_action_requests_approval_id_approvals_id_fk": { "name": "tool_action_requests_approval_id_approvals_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "approvals", "columnsFrom": [ "approval_id" ], - "tableTo": "approvals", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_action_requests_requested_by_agent_id_agents_id_fk": { "name": "tool_action_requests_requested_by_agent_id_agents_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "agents", "columnsFrom": [ "requested_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_action_requests_resolved_by_agent_id_agents_id_fk": { "name": "tool_action_requests_resolved_by_agent_id_agents_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "agents", "columnsFrom": [ "resolved_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_action_requests_decided_by_agent_id_agents_id_fk": { "name": "tool_action_requests_decided_by_agent_id_agents_id_fk", "tableFrom": "tool_action_requests", + "tableTo": "agents", "columnsFrom": [ "decided_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -55966,9 +56160,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_applications_company_status_idx": { "name": "tool_applications_company_status_idx", @@ -55987,9 +56181,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_applications_company_name_uq": { "name": "tool_applications_company_name_uq", @@ -56008,9 +56202,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_applications_company_key_uq": { "name": "tool_applications_company_key_uq", @@ -56029,50 +56223,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_applications_company_id_companies_id_fk": { "name": "tool_applications_company_id_companies_id_fk", "tableFrom": "tool_applications", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_applications_plugin_id_plugins_id_fk": { "name": "tool_applications_plugin_id_plugins_id_fk", "tableFrom": "tool_applications", + "tableTo": "plugins", "columnsFrom": [ "plugin_id" ], - "tableTo": "plugins", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_applications_owner_agent_id_agents_id_fk": { "name": "tool_applications_owner_agent_id_agents_id_fk", "tableFrom": "tool_applications", + "tableTo": "agents", "columnsFrom": [ "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -56367,9 +56561,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_run_idx": { "name": "tool_call_events_run_idx", @@ -56388,9 +56582,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_issue_idx": { "name": "tool_call_events_issue_idx", @@ -56409,9 +56603,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_invocation_idx": { "name": "tool_call_events_invocation_idx", @@ -56424,9 +56618,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_gateway_idx": { "name": "tool_call_events_gateway_idx", @@ -56445,167 +56639,167 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_call_events_company_id_companies_id_fk": { "name": "tool_call_events_company_id_companies_id_fk", "tableFrom": "tool_call_events", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_call_events_agent_id_agents_id_fk": { "name": "tool_call_events_agent_id_agents_id_fk", "tableFrom": "tool_call_events", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_run_id_heartbeat_runs_id_fk": { "name": "tool_call_events_run_id_heartbeat_runs_id_fk", "tableFrom": "tool_call_events", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_issue_id_issues_id_fk": { "name": "tool_call_events_issue_id_issues_id_fk", "tableFrom": "tool_call_events", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_gateway_id_tool_mcp_gateways_id_fk": { "name": "tool_call_events_gateway_id_tool_mcp_gateways_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_mcp_gateways", "columnsFrom": [ "gateway_id" ], - "tableTo": "tool_mcp_gateways", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_gateway_token_id_tool_mcp_gateway_tokens_id_fk": { "name": "tool_call_events_gateway_token_id_tool_mcp_gateway_tokens_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_mcp_gateway_tokens", "columnsFrom": [ "gateway_token_id" ], - "tableTo": "tool_mcp_gateway_tokens", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_application_id_tool_applications_id_fk": { "name": "tool_call_events_application_id_tool_applications_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_connection_id_tool_connections_id_fk": { "name": "tool_call_events_connection_id_tool_connections_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_catalog_entry_id_tool_catalog_entries_id_fk": { "name": "tool_call_events_catalog_entry_id_tool_catalog_entries_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_catalog_entries", "columnsFrom": [ "catalog_entry_id" ], - "tableTo": "tool_catalog_entries", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_invocation_id_tool_invocations_id_fk": { "name": "tool_call_events_invocation_id_tool_invocations_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_invocations", "columnsFrom": [ "invocation_id" ], - "tableTo": "tool_invocations", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_action_request_id_tool_action_requests_id_fk": { "name": "tool_call_events_action_request_id_tool_action_requests_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_action_requests", "columnsFrom": [ "action_request_id" ], - "tableTo": "tool_action_requests", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_call_events_runtime_slot_id_tool_runtime_slots_id_fk": { "name": "tool_call_events_runtime_slot_id_tool_runtime_slots_id_fk", "tableFrom": "tool_call_events", + "tableTo": "tool_runtime_slots", "columnsFrom": [ "runtime_slot_id" ], - "tableTo": "tool_runtime_slots", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -56818,9 +57012,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_application_idx": { "name": "tool_catalog_entries_application_idx", @@ -56833,9 +57027,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_connection_idx": { "name": "tool_catalog_entries_connection_idx", @@ -56848,9 +57042,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_company_status_idx": { "name": "tool_catalog_entries_company_status_idx", @@ -56869,9 +57063,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_connection_name_uq": { "name": "tool_catalog_entries_connection_name_uq", @@ -56890,63 +57084,63 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_catalog_entries_company_id_companies_id_fk": { "name": "tool_catalog_entries_company_id_companies_id_fk", "tableFrom": "tool_catalog_entries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_catalog_entries_application_id_tool_applications_id_fk": { "name": "tool_catalog_entries_application_id_tool_applications_id_fk", "tableFrom": "tool_catalog_entries", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_catalog_entries_connection_id_tool_connections_id_fk": { "name": "tool_catalog_entries_connection_id_tool_connections_id_fk", "tableFrom": "tool_catalog_entries", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_catalog_entries_reviewed_by_agent_id_agents_id_fk": { "name": "tool_catalog_entries_reviewed_by_agent_id_agents_id_fk", "tableFrom": "tool_catalog_entries", + "tableTo": "agents", "columnsFrom": [ "reviewed_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -57053,39 +57247,39 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_connection_app_snapshots_company_id_companies_id_fk": { "name": "tool_connection_app_snapshots_company_id_companies_id_fk", "tableFrom": "tool_connection_app_snapshots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_connection_app_snapshots_company_connection_fk": { "name": "tool_connection_app_snapshots_company_connection_fk", "tableFrom": "tool_connection_app_snapshots", + "tableTo": "tool_connections", "columnsFrom": [ "company_id", "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -57206,39 +57400,39 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_connection_app_syncs_company_id_companies_id_fk": { "name": "tool_connection_app_syncs_company_id_companies_id_fk", "tableFrom": "tool_connection_app_syncs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_connection_app_syncs_company_connection_fk": { "name": "tool_connection_app_syncs_company_connection_fk", "tableFrom": "tool_connection_app_syncs", + "tableTo": "tool_connections", "columnsFrom": [ "company_id", "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -57326,9 +57520,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connection_installs_connection_idx": { "name": "tool_connection_installs_connection_idx", @@ -57347,9 +57541,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connection_installs_target_uq": { "name": "tool_connection_installs_target_uq", @@ -57380,50 +57574,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_connection_installs_company_id_companies_id_fk": { "name": "tool_connection_installs_company_id_companies_id_fk", "tableFrom": "tool_connection_installs", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_connection_installs_connection_id_tool_connections_id_fk": { "name": "tool_connection_installs_connection_id_tool_connections_id_fk", "tableFrom": "tool_connection_installs", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_connection_installs_created_by_agent_id_agents_id_fk": { "name": "tool_connection_installs_created_by_agent_id_agents_id_fk", "tableFrom": "tool_connection_installs", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -57650,9 +57844,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connections_application_idx": { "name": "tool_connections_application_idx", @@ -57665,9 +57859,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connections_company_enabled_idx": { "name": "tool_connections_company_enabled_idx", @@ -57686,9 +57880,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connections_company_uid_uq": { "name": "tool_connections_company_uid_uq", @@ -57707,61 +57901,61 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_connections_company_id_companies_id_fk": { "name": "tool_connections_company_id_companies_id_fk", "tableFrom": "tool_connections", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_connections_application_id_tool_applications_id_fk": { "name": "tool_connections_application_id_tool_applications_id_fk", "tableFrom": "tool_connections", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "tool_connections_created_by_agent_id_agents_id_fk": { "name": "tool_connections_created_by_agent_id_agents_id_fk", "tableFrom": "tool_connections", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "tool_connections_company_id_uq": { "name": "tool_connections_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -57882,9 +58076,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_rate_limit_counters_window_uq": { "name": "tool_gateway_rate_limit_counters_window_uq", @@ -57909,24 +58103,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_gateway_rate_limit_counters_company_id_companies_id_fk": { "name": "tool_gateway_rate_limit_counters_company_id_companies_id_fk", "tableFrom": "tool_gateway_rate_limit_counters", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -58075,9 +58269,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_company_agent_idx": { "name": "tool_gateway_sessions_company_agent_idx", @@ -58096,9 +58290,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_company_expires_idx": { "name": "tool_gateway_sessions_company_expires_idx", @@ -58117,9 +58311,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_expiry_idx": { "name": "tool_gateway_sessions_expiry_idx", @@ -58132,9 +58326,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_run_idx": { "name": "tool_gateway_sessions_run_idx", @@ -58153,9 +58347,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_issue_idx": { "name": "tool_gateway_sessions_issue_idx", @@ -58174,9 +58368,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_gateway_idx": { "name": "tool_gateway_sessions_gateway_idx", @@ -58195,102 +58389,102 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_gateway_sessions_company_id_companies_id_fk": { "name": "tool_gateway_sessions_company_id_companies_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_gateway_sessions_agent_id_agents_id_fk": { "name": "tool_gateway_sessions_agent_id_agents_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_gateway_sessions_run_id_heartbeat_runs_id_fk": { "name": "tool_gateway_sessions_run_id_heartbeat_runs_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_gateway_sessions_issue_id_issues_id_fk": { "name": "tool_gateway_sessions_issue_id_issues_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_gateway_sessions_project_id_projects_id_fk": { "name": "tool_gateway_sessions_project_id_projects_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_gateway_sessions_gateway_id_tool_mcp_gateways_id_fk": { "name": "tool_gateway_sessions_gateway_id_tool_mcp_gateways_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "tool_mcp_gateways", "columnsFrom": [ "gateway_id" ], - "tableTo": "tool_mcp_gateways", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_gateway_sessions_gateway_token_id_tool_mcp_gateway_tokens_id_fk": { "name": "tool_gateway_sessions_gateway_token_id_tool_mcp_gateway_tokens_id_fk", "tableFrom": "tool_gateway_sessions", + "tableTo": "tool_mcp_gateway_tokens", "columnsFrom": [ "gateway_token_id" ], - "tableTo": "tool_mcp_gateway_tokens", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -58605,9 +58799,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_run_idx": { "name": "tool_invocations_run_idx", @@ -58626,9 +58820,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_issue_idx": { "name": "tool_invocations_issue_idx", @@ -58647,9 +58841,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_gateway_idx": { "name": "tool_invocations_gateway_idx", @@ -58668,9 +58862,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_company_idempotency_uq": { "name": "tool_invocations_company_idempotency_uq", @@ -58689,128 +58883,128 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_invocations_company_id_companies_id_fk": { "name": "tool_invocations_company_id_companies_id_fk", "tableFrom": "tool_invocations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_invocations_agent_id_agents_id_fk": { "name": "tool_invocations_agent_id_agents_id_fk", "tableFrom": "tool_invocations", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_issue_id_issues_id_fk": { "name": "tool_invocations_issue_id_issues_id_fk", "tableFrom": "tool_invocations", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_run_id_heartbeat_runs_id_fk": { "name": "tool_invocations_run_id_heartbeat_runs_id_fk", "tableFrom": "tool_invocations", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_gateway_id_tool_mcp_gateways_id_fk": { "name": "tool_invocations_gateway_id_tool_mcp_gateways_id_fk", "tableFrom": "tool_invocations", + "tableTo": "tool_mcp_gateways", "columnsFrom": [ "gateway_id" ], - "tableTo": "tool_mcp_gateways", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_gateway_token_id_tool_mcp_gateway_tokens_id_fk": { "name": "tool_invocations_gateway_token_id_tool_mcp_gateway_tokens_id_fk", "tableFrom": "tool_invocations", + "tableTo": "tool_mcp_gateway_tokens", "columnsFrom": [ "gateway_token_id" ], - "tableTo": "tool_mcp_gateway_tokens", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_application_id_tool_applications_id_fk": { "name": "tool_invocations_application_id_tool_applications_id_fk", "tableFrom": "tool_invocations", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_connection_id_tool_connections_id_fk": { "name": "tool_invocations_connection_id_tool_connections_id_fk", "tableFrom": "tool_invocations", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_invocations_catalog_entry_id_tool_catalog_entries_id_fk": { "name": "tool_invocations_catalog_entry_id_tool_catalog_entries_id_fk", "tableFrom": "tool_invocations", + "tableTo": "tool_catalog_entries", "columnsFrom": [ "catalog_entry_id" ], - "tableTo": "tool_catalog_entries", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -58982,9 +59176,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_expiry_idx": { "name": "tool_mcp_gateway_tokens_expiry_idx", @@ -59003,9 +59197,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_gateway_idx": { "name": "tool_mcp_gateway_tokens_gateway_idx", @@ -59024,9 +59218,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_subject_idx": { "name": "tool_mcp_gateway_tokens_subject_idx", @@ -59051,9 +59245,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_company_expires_idx": { "name": "tool_mcp_gateway_tokens_company_expires_idx", @@ -59072,63 +59266,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_mcp_gateway_tokens_company_id_companies_id_fk": { "name": "tool_mcp_gateway_tokens_company_id_companies_id_fk", "tableFrom": "tool_mcp_gateway_tokens", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_mcp_gateway_tokens_gateway_id_tool_mcp_gateways_id_fk": { "name": "tool_mcp_gateway_tokens_gateway_id_tool_mcp_gateways_id_fk", "tableFrom": "tool_mcp_gateway_tokens", + "tableTo": "tool_mcp_gateways", "columnsFrom": [ "gateway_id" ], - "tableTo": "tool_mcp_gateways", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_mcp_gateway_tokens_expiry_override_by_agent_id_agents_id_fk": { "name": "tool_mcp_gateway_tokens_expiry_override_by_agent_id_agents_id_fk", "tableFrom": "tool_mcp_gateway_tokens", + "tableTo": "agents", "columnsFrom": [ "expiry_override_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_mcp_gateway_tokens_created_by_agent_id_agents_id_fk": { "name": "tool_mcp_gateway_tokens_created_by_agent_id_agents_id_fk", "tableFrom": "tool_mcp_gateway_tokens", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -59323,9 +59517,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_company_status_idx": { "name": "tool_mcp_gateways_company_status_idx", @@ -59344,9 +59538,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_profile_idx": { "name": "tool_mcp_gateways_profile_idx", @@ -59365,9 +59559,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_public_id_uq": { "name": "tool_mcp_gateways_public_id_uq", @@ -59380,9 +59574,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_company_slug_uq": { "name": "tool_mcp_gateways_company_slug_uq", @@ -59401,9 +59595,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_company_name_uq": { "name": "tool_mcp_gateways_company_name_uq", @@ -59422,102 +59616,102 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_mcp_gateways_company_id_companies_id_fk": { "name": "tool_mcp_gateways_company_id_companies_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_mcp_gateways_profile_id_tool_profiles_id_fk": { "name": "tool_mcp_gateways_profile_id_tool_profiles_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "tool_profiles", "columnsFrom": [ "profile_id" ], - "tableTo": "tool_profiles", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "restrict" + "onDelete": "restrict", + "onUpdate": "no action" }, "tool_mcp_gateways_agent_id_agents_id_fk": { "name": "tool_mcp_gateways_agent_id_agents_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_mcp_gateways_project_id_projects_id_fk": { "name": "tool_mcp_gateways_project_id_projects_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_mcp_gateways_issue_id_issues_id_fk": { "name": "tool_mcp_gateways_issue_id_issues_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_mcp_gateways_approval_issue_id_issues_id_fk": { "name": "tool_mcp_gateways_approval_issue_id_issues_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "issues", "columnsFrom": [ "approval_issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_mcp_gateways_created_by_agent_id_agents_id_fk": { "name": "tool_mcp_gateways_created_by_agent_id_agents_id_fk", "tableFrom": "tool_mcp_gateways", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -59634,9 +59828,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_connection_idx": { "name": "tool_oauth_states_connection_idx", @@ -59649,9 +59843,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_actor_idx": { "name": "tool_oauth_states_actor_idx", @@ -59670,9 +59864,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_subject_agent_idx": { "name": "tool_oauth_states_subject_agent_idx", @@ -59691,9 +59885,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_expires_at_idx": { "name": "tool_oauth_states_expires_at_idx", @@ -59706,50 +59900,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_oauth_states_company_id_companies_id_fk": { "name": "tool_oauth_states_company_id_companies_id_fk", "tableFrom": "tool_oauth_states", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_oauth_states_connection_id_tool_connections_id_fk": { "name": "tool_oauth_states_connection_id_tool_connections_id_fk", "tableFrom": "tool_oauth_states", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_oauth_states_subject_agent_id_agents_id_fk": { "name": "tool_oauth_states_subject_agent_id_agents_id_fk", "tableFrom": "tool_oauth_states", + "tableTo": "agents", "columnsFrom": [ "subject_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -59871,9 +60065,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_policies_company_type_idx": { "name": "tool_policies_company_type_idx", @@ -59892,9 +60086,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_policies_company_name_uq": { "name": "tool_policies_company_name_uq", @@ -59913,37 +60107,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_policies_company_id_companies_id_fk": { "name": "tool_policies_company_id_companies_id_fk", "tableFrom": "tool_policies", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_policies_created_by_agent_id_agents_id_fk": { "name": "tool_policies_created_by_agent_id_agents_id_fk", "tableFrom": "tool_policies", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -60052,9 +60246,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_bindings_target_profile_uq": { "name": "tool_profile_bindings_target_profile_uq", @@ -60085,50 +60279,50 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_profile_bindings_company_id_companies_id_fk": { "name": "tool_profile_bindings_company_id_companies_id_fk", "tableFrom": "tool_profile_bindings", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_profile_bindings_profile_id_tool_profiles_id_fk": { "name": "tool_profile_bindings_profile_id_tool_profiles_id_fk", "tableFrom": "tool_profile_bindings", + "tableTo": "tool_profiles", "columnsFrom": [ "profile_id" ], - "tableTo": "tool_profiles", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_profile_bindings_created_by_agent_id_agents_id_fk": { "name": "tool_profile_bindings_created_by_agent_id_agents_id_fk", "tableFrom": "tool_profile_bindings", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -60242,9 +60436,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_entries_application_idx": { "name": "tool_profile_entries_application_idx", @@ -60263,9 +60457,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_entries_connection_idx": { "name": "tool_profile_entries_connection_idx", @@ -60284,9 +60478,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_entries_catalog_entry_idx": { "name": "tool_profile_entries_catalog_entry_idx", @@ -60305,76 +60499,76 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_profile_entries_company_id_companies_id_fk": { "name": "tool_profile_entries_company_id_companies_id_fk", "tableFrom": "tool_profile_entries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_profile_entries_profile_id_tool_profiles_id_fk": { "name": "tool_profile_entries_profile_id_tool_profiles_id_fk", "tableFrom": "tool_profile_entries", + "tableTo": "tool_profiles", "columnsFrom": [ "profile_id" ], - "tableTo": "tool_profiles", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_profile_entries_application_id_tool_applications_id_fk": { "name": "tool_profile_entries_application_id_tool_applications_id_fk", "tableFrom": "tool_profile_entries", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_profile_entries_connection_id_tool_connections_id_fk": { "name": "tool_profile_entries_connection_id_tool_connections_id_fk", "tableFrom": "tool_profile_entries", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_profile_entries_catalog_entry_id_tool_catalog_entries_id_fk": { "name": "tool_profile_entries_catalog_entry_id_tool_catalog_entries_id_fk", "tableFrom": "tool_profile_entries", + "tableTo": "tool_catalog_entries", "columnsFrom": [ "catalog_entry_id" ], - "tableTo": "tool_catalog_entries", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -60478,9 +60672,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profiles_company_key_uq": { "name": "tool_profiles_company_key_uq", @@ -60499,9 +60693,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profiles_company_name_uq": { "name": "tool_profiles_company_name_uq", @@ -60520,24 +60714,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_profiles_company_id_companies_id_fk": { "name": "tool_profiles_company_id_companies_id_fk", "tableFrom": "tool_profiles", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -60644,9 +60838,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_rate_limit_counters_window_uq": { "name": "tool_rate_limit_counters_window_uq", @@ -60683,37 +60877,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_rate_limit_counters_company_id_companies_id_fk": { "name": "tool_rate_limit_counters_company_id_companies_id_fk", "tableFrom": "tool_rate_limit_counters", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_rate_limit_counters_policy_id_tool_policies_id_fk": { "name": "tool_rate_limit_counters_policy_id_tool_policies_id_fk", "tableFrom": "tool_rate_limit_counters", + "tableTo": "tool_policies", "columnsFrom": [ "policy_id" ], - "tableTo": "tool_policies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -60797,9 +60991,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_metric_counters_bucket_uq": { "name": "tool_runtime_metric_counters_bucket_uq", @@ -60824,24 +61018,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_runtime_metric_counters_company_id_companies_id_fk": { "name": "tool_runtime_metric_counters_company_id_companies_id_fk", "tableFrom": "tool_runtime_metric_counters", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -61067,9 +61261,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_slots_connection_idx": { "name": "tool_runtime_slots_connection_idx", @@ -61082,9 +61276,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_slots_execution_workspace_idx": { "name": "tool_runtime_slots_execution_workspace_idx", @@ -61103,9 +61297,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_slots_slot_key_uq": { "name": "tool_runtime_slots_slot_key_uq", @@ -61124,89 +61318,89 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_runtime_slots_company_id_companies_id_fk": { "name": "tool_runtime_slots_company_id_companies_id_fk", "tableFrom": "tool_runtime_slots", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_runtime_slots_application_id_tool_applications_id_fk": { "name": "tool_runtime_slots_application_id_tool_applications_id_fk", "tableFrom": "tool_runtime_slots", + "tableTo": "tool_applications", "columnsFrom": [ "application_id" ], - "tableTo": "tool_applications", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_runtime_slots_connection_id_tool_connections_id_fk": { "name": "tool_runtime_slots_connection_id_tool_connections_id_fk", "tableFrom": "tool_runtime_slots", + "tableTo": "tool_connections", "columnsFrom": [ "connection_id" ], - "tableTo": "tool_connections", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_runtime_slots_project_workspace_id_project_workspaces_id_fk": { "name": "tool_runtime_slots_project_workspace_id_project_workspaces_id_fk", "tableFrom": "tool_runtime_slots", + "tableTo": "project_workspaces", "columnsFrom": [ "project_workspace_id" ], - "tableTo": "project_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_runtime_slots_execution_workspace_id_execution_workspaces_id_fk": { "name": "tool_runtime_slots_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "tool_runtime_slots", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "tool_runtime_slots_issue_id_issues_id_fk": { "name": "tool_runtime_slots_issue_id_issues_id_fk", "tableFrom": "tool_runtime_slots", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -61329,9 +61523,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_stdio_command_templates_company_status_idx": { "name": "tool_stdio_command_templates_company_status_idx", @@ -61350,9 +61544,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_stdio_command_templates_company_key_uq": { "name": "tool_stdio_command_templates_company_key_uq", @@ -61371,37 +61565,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "tool_stdio_command_templates_company_id_companies_id_fk": { "name": "tool_stdio_command_templates_company_id_companies_id_fk", "tableFrom": "tool_stdio_command_templates", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "tool_stdio_command_templates_created_by_agent_id_agents_id_fk": { "name": "tool_stdio_command_templates_created_by_agent_id_agents_id_fk", "tableFrom": "tool_stdio_command_templates", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -61479,9 +61673,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_company_preferences_primary_agent_idx": { "name": "user_company_preferences_primary_agent_idx", @@ -61494,37 +61688,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "user_company_preferences_company_id_companies_id_fk": { "name": "user_company_preferences_company_id_companies_id_fk", "tableFrom": "user_company_preferences", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "user_company_preferences_primary_agent_id_agents_id_fk": { "name": "user_company_preferences_primary_agent_id_agents_id_fk", "tableFrom": "user_company_preferences", + "tableTo": "agents", "columnsFrom": [ "primary_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -61603,9 +61797,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_inbox_agent_policies_allowed_agent_ids_idx": { "name": "user_inbox_agent_policies_allowed_agent_ids_idx", @@ -61618,24 +61812,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} } }, "foreignKeys": { "user_inbox_agent_policies_company_id_companies_id_fk": { "name": "user_inbox_agent_policies_company_id_companies_id_fk", "tableFrom": "user_inbox_agent_policies", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -61750,9 +61944,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_definition_idx": { "name": "user_secret_declarations_definition_idx", @@ -61765,9 +61959,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_target_idx": { "name": "user_secret_declarations_target_idx", @@ -61792,9 +61986,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_company_required_idx": { "name": "user_secret_declarations_company_required_idx", @@ -61813,9 +62007,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_target_path_uq": { "name": "user_secret_declarations_target_path_uq", @@ -61846,9 +62040,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_required_override_idx": { "name": "user_secret_declarations_required_override_idx", @@ -61867,38 +62061,38 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"user_secret_declarations\".\"allow_missing_override\" = true", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "user_secret_declarations_company_id_companies_id_fk": { "name": "user_secret_declarations_company_id_companies_id_fk", "tableFrom": "user_secret_declarations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "user_secret_declarations_user_secret_definition_id_user_secret_definitions_id_fk": { "name": "user_secret_declarations_user_secret_definition_id_user_secret_definitions_id_fk", "tableFrom": "user_secret_declarations", + "tableTo": "user_secret_definitions", "columnsFrom": [ "user_secret_definition_id" ], - "tableTo": "user_secret_definitions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -62044,9 +62238,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_definitions_company_provider_idx": { "name": "user_secret_definitions_company_provider_idx", @@ -62065,9 +62259,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_definitions_provider_config_idx": { "name": "user_secret_definitions_provider_config_idx", @@ -62080,9 +62274,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_definitions_company_key_uq": { "name": "user_secret_definitions_company_key_uq", @@ -62101,64 +62295,64 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"user_secret_definitions\".\"deleted_at\" is null", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "user_secret_definitions_company_id_companies_id_fk": { "name": "user_secret_definitions_company_id_companies_id_fk", "tableFrom": "user_secret_definitions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "user_secret_definitions_provider_config_id_company_secret_provider_configs_id_fk": { "name": "user_secret_definitions_provider_config_id_company_secret_provider_configs_id_fk", "tableFrom": "user_secret_definitions", + "tableTo": "company_secret_provider_configs", "columnsFrom": [ "provider_config_id" ], - "tableTo": "company_secret_provider_configs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "user_secret_definitions_created_by_agent_id_agents_id_fk": { "name": "user_secret_definitions_created_by_agent_id_agents_id_fk", "tableFrom": "user_secret_definitions", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "user_secret_definitions_updated_by_agent_id_agents_id_fk": { "name": "user_secret_definitions_updated_by_agent_id_agents_id_fk", "tableFrom": "user_secret_definitions", + "tableTo": "agents", "columnsFrom": [ "updated_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -62218,9 +62412,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -62288,9 +62482,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -62445,137 +62639,137 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "work_assessments_company_id_companies_id_fk": { "name": "work_assessments_company_id_companies_id_fk", "tableFrom": "work_assessments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "work_assessments_trigger_actor_company_id_companies_id_fk": { "name": "work_assessments_trigger_actor_company_id_companies_id_fk", "tableFrom": "work_assessments", + "tableTo": "companies", "columnsFrom": [ "trigger_actor_company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "work_assessments_issue_company_fk": { "name": "work_assessments_issue_company_fk", "tableFrom": "work_assessments", + "tableTo": "issues", "columnsFrom": [ "company_id", "issue_id" ], - "tableTo": "issues", "columnsTo": [ "company_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "work_assessments_run_owner_fk": { "name": "work_assessments_run_owner_fk", "tableFrom": "work_assessments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "company_id", "issue_id", "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "company_id", "native_issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "work_assessments_contract_owner_fk": { "name": "work_assessments_contract_owner_fk", "tableFrom": "work_assessments", + "tableTo": "completion_contracts", "columnsFrom": [ "company_id", "issue_id", "contract_id" ], - "tableTo": "completion_contracts", "columnsTo": [ "company_id", "issue_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "work_assessments_result_owner_fk": { "name": "work_assessments_result_owner_fk", "tableFrom": "work_assessments", + "tableTo": "native_run_results", "columnsFrom": [ "company_id", "issue_id", "run_id", "result_id" ], - "tableTo": "native_run_results", "columnsTo": [ "company_id", "issue_id", "run_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "work_assessments_supersedes_owner_fk": { "name": "work_assessments_supersedes_owner_fk", "tableFrom": "work_assessments", + "tableTo": "work_assessments", "columnsFrom": [ "company_id", "issue_id", "run_id", "supersedes_assessment_id" ], - "tableTo": "work_assessments", "columnsTo": [ "company_id", "issue_id", "run_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "work_assessments_company_issue_run_id_uq": { "name": "work_assessments_company_issue_run_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "issue_id", "run_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -62655,37 +62849,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "workflows_company_id_companies_id_fk": { "name": "workflows_company_id_companies_id_fk", "tableFrom": "workflows", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "workflows_created_by_agent_id_agents_id_fk": { "name": "workflows_created_by_agent_id_agents_id_fk", "tableFrom": "workflows", + "tableTo": "agents", "columnsFrom": [ "created_by_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -62861,9 +63055,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_operations_company_workspace_started_idx": { "name": "workspace_operations_company_workspace_started_idx", @@ -62888,9 +63082,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_operations_company_workspace_issue_started_idx": { "name": "workspace_operations_company_workspace_issue_started_idx", @@ -62921,63 +63115,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "workspace_operations_company_id_companies_id_fk": { "name": "workspace_operations_company_id_companies_id_fk", "tableFrom": "workspace_operations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "workspace_operations_execution_workspace_id_execution_workspaces_id_fk": { "name": "workspace_operations_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "workspace_operations", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_operations_heartbeat_run_id_heartbeat_runs_id_fk": { "name": "workspace_operations_heartbeat_run_id_heartbeat_runs_id_fk", "tableFrom": "workspace_operations", + "tableTo": "heartbeat_runs", "columnsFrom": [ "heartbeat_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_operations_issue_id_issues_id_fk": { "name": "workspace_operations_issue_id_issues_id_fk", "tableFrom": "workspace_operations", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -63200,9 +63394,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_runtime_services_company_execution_workspace_status_idx": { "name": "workspace_runtime_services_company_execution_workspace_status_idx", @@ -63227,9 +63421,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_runtime_services_company_project_status_idx": { "name": "workspace_runtime_services_company_project_status_idx", @@ -63254,9 +63448,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_runtime_services_run_idx": { "name": "workspace_runtime_services_run_idx", @@ -63269,9 +63463,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_runtime_services_company_updated_idx": { "name": "workspace_runtime_services_company_updated_idx", @@ -63290,102 +63484,102 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "workspace_runtime_services_company_id_companies_id_fk": { "name": "workspace_runtime_services_company_id_companies_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" }, "workspace_runtime_services_project_id_projects_id_fk": { "name": "workspace_runtime_services_project_id_projects_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "projects", "columnsFrom": [ "project_id" ], - "tableTo": "projects", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_runtime_services_project_workspace_id_project_workspaces_id_fk": { "name": "workspace_runtime_services_project_workspace_id_project_workspaces_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "project_workspaces", "columnsFrom": [ "project_workspace_id" ], - "tableTo": "project_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_runtime_services_execution_workspace_id_execution_workspaces_id_fk": { "name": "workspace_runtime_services_execution_workspace_id_execution_workspaces_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "execution_workspaces", "columnsFrom": [ "execution_workspace_id" ], - "tableTo": "execution_workspaces", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_runtime_services_issue_id_issues_id_fk": { "name": "workspace_runtime_services_issue_id_issues_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "issues", "columnsFrom": [ "issue_id" ], - "tableTo": "issues", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_runtime_services_owner_agent_id_agents_id_fk": { "name": "workspace_runtime_services_owner_agent_id_agents_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "agents", "columnsFrom": [ "owner_agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" }, "workspace_runtime_services_started_by_run_id_heartbeat_runs_id_fk": { "name": "workspace_runtime_services_started_by_run_id_heartbeat_runs_id_fk", "tableFrom": "workspace_runtime_services", + "tableTo": "heartbeat_runs", "columnsFrom": [ "started_by_run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -63539,9 +63733,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_attachment_upload_expiry_idx": { "name": "mcp_attachment_upload_expiry_idx", @@ -63554,50 +63748,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_attachment_uploads_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_attachment_uploads_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_attachment_uploads", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_attachment_uploads_company_id_companies_id_fk": { "name": "mcp_attachment_uploads_company_id_companies_id_fk", "tableFrom": "mcp_attachment_uploads", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_attachment_uploads_user_id_user_id_fk": { "name": "mcp_attachment_uploads_user_id_user_id_fk", "tableFrom": "mcp_attachment_uploads", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -63673,9 +63867,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_admissions_grant_idx": { "name": "mcp_event_admissions_grant_idx", @@ -63688,9 +63882,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_admissions_company_idx": { "name": "mcp_event_admissions_company_idx", @@ -63703,37 +63897,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_event_admissions_company_id_companies_id_fk": { "name": "mcp_event_admissions_company_id_companies_id_fk", "tableFrom": "mcp_event_admissions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_event_admissions_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_event_admissions_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_event_admissions", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -63822,9 +64016,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_deliveries_activity_uq": { "name": "mcp_event_deliveries_activity_uq", @@ -63843,9 +64037,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_deliveries_due_idx": { "name": "mcp_event_deliveries_due_idx", @@ -63858,24 +64052,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_event_deliveries_subscription_id_mcp_event_subscriptions_id_fk": { "name": "mcp_event_deliveries_subscription_id_mcp_event_subscriptions_id_fk", "tableFrom": "mcp_event_deliveries", + "tableTo": "mcp_event_subscriptions", "columnsFrom": [ "subscription_id" ], - "tableTo": "mcp_event_subscriptions", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -63986,9 +64180,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_subscriptions_company_idx": { "name": "mcp_event_subscriptions_company_idx", @@ -64001,37 +64195,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_event_subscriptions_company_id_companies_id_fk": { "name": "mcp_event_subscriptions_company_id_companies_id_fk", "tableFrom": "mcp_event_subscriptions", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_event_subscriptions_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_event_subscriptions_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_event_subscriptions", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -64111,9 +64305,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_file_ticket_grant_idx": { "name": "mcp_file_ticket_grant_idx", @@ -64126,50 +64320,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_file_tickets_company_id_companies_id_fk": { "name": "mcp_file_tickets_company_id_companies_id_fk", "tableFrom": "mcp_file_tickets", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_file_tickets_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_file_tickets_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_file_tickets", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_file_tickets_upload_id_mcp_attachment_uploads_id_fk": { "name": "mcp_file_tickets_upload_id_mcp_attachment_uploads_id_fk", "tableFrom": "mcp_file_tickets", + "tableTo": "mcp_attachment_uploads", "columnsFrom": [ "upload_id" ], - "tableTo": "mcp_attachment_uploads", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -64276,9 +64470,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_mutation_receipts_company_idx": { "name": "mcp_mutation_receipts_company_idx", @@ -64291,50 +64485,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_mutation_receipts_company_id_companies_id_fk": { "name": "mcp_mutation_receipts_company_id_companies_id_fk", "tableFrom": "mcp_mutation_receipts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_mutation_receipts_user_id_user_id_fk": { "name": "mcp_mutation_receipts_user_id_user_id_fk", "tableFrom": "mcp_mutation_receipts", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_mutation_receipts_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_mutation_receipts_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_mutation_receipts", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -64384,9 +64578,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -64640,9 +64834,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_user_code_uq": { "name": "mcp_oauth_user_code_uq", @@ -64655,9 +64849,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_device_expiry_idx": { "name": "mcp_oauth_device_expiry_idx", @@ -64670,37 +64864,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_oauth_device_requests_client_id_mcp_oauth_clients_id_fk": { "name": "mcp_oauth_device_requests_client_id_mcp_oauth_clients_id_fk", "tableFrom": "mcp_oauth_device_requests", + "tableTo": "mcp_oauth_clients", "columnsFrom": [ "client_id" ], - "tableTo": "mcp_oauth_clients", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_oauth_device_requests_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_oauth_device_requests_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_oauth_device_requests", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -64813,63 +65007,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_oauth_grants_company_id_companies_id_fk": { "name": "mcp_oauth_grants_company_id_companies_id_fk", "tableFrom": "mcp_oauth_grants", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_oauth_grants_user_id_user_id_fk": { "name": "mcp_oauth_grants_user_id_user_id_fk", "tableFrom": "mcp_oauth_grants", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_oauth_grants_client_id_mcp_oauth_clients_id_fk": { "name": "mcp_oauth_grants_client_id_mcp_oauth_clients_id_fk", "tableFrom": "mcp_oauth_grants", + "tableTo": "mcp_oauth_clients", "columnsFrom": [ "client_id" ], - "tableTo": "mcp_oauth_clients", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_oauth_grants_agent_id_agents_id_fk": { "name": "mcp_oauth_grants_agent_id_agents_id_fk", "tableFrom": "mcp_oauth_grants", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -64914,9 +65108,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -65028,9 +65222,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_requests_expiry_idx": { "name": "mcp_oauth_requests_expiry_idx", @@ -65043,37 +65237,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_oauth_requests_client_id_mcp_oauth_clients_id_fk": { "name": "mcp_oauth_requests_client_id_mcp_oauth_clients_id_fk", "tableFrom": "mcp_oauth_requests", + "tableTo": "mcp_oauth_clients", "columnsFrom": [ "client_id" ], - "tableTo": "mcp_oauth_clients", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "mcp_oauth_requests_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_oauth_requests_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_oauth_requests", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -65150,9 +65344,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_tokens_grant_idx": { "name": "mcp_oauth_tokens_grant_idx", @@ -65165,9 +65359,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_tokens_revocation_revision_idx": { "name": "mcp_oauth_tokens_revocation_revision_idx", @@ -65192,9 +65386,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_tokens_expiry_idx": { "name": "mcp_oauth_tokens_expiry_idx", @@ -65207,24 +65401,24 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "mcp_oauth_tokens_grant_id_mcp_oauth_grants_id_fk": { "name": "mcp_oauth_tokens_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "mcp_oauth_tokens", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -65357,9 +65551,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_holds_agent_idx": { "name": "external_holds_agent_idx", @@ -65378,37 +65572,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "external_agent_holds_company_id_companies_id_fk": { "name": "external_agent_holds_company_id_companies_id_fk", "tableFrom": "external_agent_holds", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "external_agent_holds_agent_id_agents_id_fk": { "name": "external_agent_holds_agent_id_agents_id_fk", "tableFrom": "external_agent_holds", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -65621,10 +65815,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"muse_agent_bindings\".\"revoked_at\" IS NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "muse_bindings_ticket_uq": { "name": "muse_bindings_ticket_uq", @@ -65637,9 +65831,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_bindings_active_grant_uq": { "name": "muse_bindings_active_grant_uq", @@ -65652,51 +65846,51 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"muse_agent_bindings\".\"revoked_at\" IS NULL AND \"muse_agent_bindings\".\"grant_id\" IS NOT NULL", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { "muse_agent_bindings_company_id_companies_id_fk": { "name": "muse_agent_bindings_company_id_companies_id_fk", "tableFrom": "muse_agent_bindings", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_agent_bindings_agent_id_agents_id_fk": { "name": "muse_agent_bindings_agent_id_agents_id_fk", "tableFrom": "muse_agent_bindings", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_agent_bindings_grant_id_mcp_oauth_grants_id_fk": { "name": "muse_agent_bindings_grant_id_mcp_oauth_grants_id_fk", "tableFrom": "muse_agent_bindings", + "tableTo": "mcp_oauth_grants", "columnsFrom": [ "grant_id" ], - "tableTo": "mcp_oauth_grants", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "set null" + "onDelete": "set null", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -65790,9 +65984,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_credentials_binding_idx": { "name": "muse_credentials_binding_idx", @@ -65811,37 +66005,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_credentials_company_id_companies_id_fk": { "name": "muse_credentials_company_id_companies_id_fk", "tableFrom": "muse_credentials", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_credentials_binding_id_muse_agent_bindings_id_fk": { "name": "muse_credentials_binding_id_muse_agent_bindings_id_fk", "tableFrom": "muse_credentials", + "tableTo": "muse_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "muse_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -65929,37 +66123,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_idle_receipts_company_id_companies_id_fk": { "name": "muse_idle_receipts_company_id_companies_id_fk", "tableFrom": "muse_idle_receipts", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_idle_receipts_binding_id_muse_agent_bindings_id_fk": { "name": "muse_idle_receipts_binding_id_muse_agent_bindings_id_fk", "tableFrom": "muse_idle_receipts", + "tableTo": "muse_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "muse_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -66059,9 +66253,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_input_source_uq": { "name": "muse_input_source_uq", @@ -66080,37 +66274,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_input_deliveries_company_id_companies_id_fk": { "name": "muse_input_deliveries_company_id_companies_id_fk", "tableFrom": "muse_input_deliveries", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_input_deliveries_assignment_id_muse_runner_assignments_id_fk": { "name": "muse_input_deliveries_assignment_id_muse_runner_assignments_id_fk", "tableFrom": "muse_input_deliveries", + "tableTo": "muse_runner_assignments", "columnsFrom": [ "assignment_id" ], - "tableTo": "muse_runner_assignments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -66216,9 +66410,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_mailbox_cursor_idx": { "name": "muse_mailbox_cursor_idx", @@ -66243,50 +66437,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_mailbox_items_company_id_companies_id_fk": { "name": "muse_mailbox_items_company_id_companies_id_fk", "tableFrom": "muse_mailbox_items", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_mailbox_items_binding_id_muse_agent_bindings_id_fk": { "name": "muse_mailbox_items_binding_id_muse_agent_bindings_id_fk", "tableFrom": "muse_mailbox_items", + "tableTo": "muse_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "muse_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_mailbox_items_assignment_id_muse_runner_assignments_id_fk": { "name": "muse_mailbox_items_assignment_id_muse_runner_assignments_id_fk", "tableFrom": "muse_mailbox_items", + "tableTo": "muse_runner_assignments", "columnsFrom": [ "assignment_id" ], - "tableTo": "muse_runner_assignments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -66418,37 +66612,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_receiver_contact_buckets_company_id_companies_id_fk": { "name": "muse_receiver_contact_buckets_company_id_companies_id_fk", "tableFrom": "muse_receiver_contact_buckets", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_receiver_contact_buckets_binding_id_muse_agent_bindings_id_fk": { "name": "muse_receiver_contact_buckets_binding_id_muse_agent_bindings_id_fk", "tableFrom": "muse_receiver_contact_buckets", + "tableTo": "muse_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "muse_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -66617,9 +66811,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_assignments_live_binding_uq": { "name": "muse_assignments_live_binding_uq", @@ -66632,10 +66826,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"muse_runner_assignments\".\"status\" IN ('offered','claimed','accepted')", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "muse_assignments_company_idx": { "name": "muse_assignments_company_idx", @@ -66648,63 +66842,63 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_runner_assignments_company_id_companies_id_fk": { "name": "muse_runner_assignments_company_id_companies_id_fk", "tableFrom": "muse_runner_assignments", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_runner_assignments_binding_id_muse_agent_bindings_id_fk": { "name": "muse_runner_assignments_binding_id_muse_agent_bindings_id_fk", "tableFrom": "muse_runner_assignments", + "tableTo": "muse_agent_bindings", "columnsFrom": [ "binding_id" ], - "tableTo": "muse_agent_bindings", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_runner_assignments_run_id_heartbeat_runs_id_fk": { "name": "muse_runner_assignments_run_id_heartbeat_runs_id_fk", "tableFrom": "muse_runner_assignments", + "tableTo": "heartbeat_runs", "columnsFrom": [ "run_id" ], - "tableTo": "heartbeat_runs", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_runner_assignments_agent_id_agents_id_fk": { "name": "muse_runner_assignments_agent_id_agents_id_fk", "tableFrom": "muse_runner_assignments", + "tableTo": "agents", "columnsFrom": [ "agent_id" ], - "tableTo": "agents", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -66812,37 +67006,37 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "muse_runner_operations_company_id_companies_id_fk": { "name": "muse_runner_operations_company_id_companies_id_fk", "tableFrom": "muse_runner_operations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "muse_runner_operations_assignment_id_muse_runner_assignments_id_fk": { "name": "muse_runner_operations_assignment_id_muse_runner_assignments_id_fk", "tableFrom": "muse_runner_operations", + "tableTo": "muse_runner_assignments", "columnsFrom": [ "assignment_id" ], - "tableTo": "muse_runner_assignments", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -66900,15 +67094,15 @@ "company_prompt_injection_prevention_company_id_companies_id_fk": { "name": "company_prompt_injection_prevention_company_id_companies_id_fk", "tableFrom": "company_prompt_injection_prevention", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -67122,9 +67316,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "prompt_injection_invocations_pending_idx": { "name": "prompt_injection_invocations_pending_idx", @@ -67137,10 +67331,10 @@ } ], "isUnique": false, - "with": {}, - "method": "btree", "where": "\"prompt_injection_invocations\".\"status\" = 'running'", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "prompt_injection_invocations_cost_idx": { "name": "prompt_injection_invocations_cost_idx", @@ -67153,37 +67347,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": { "prompt_injection_invocations_company_id_companies_id_fk": { "name": "prompt_injection_invocations_company_id_companies_id_fk", "tableFrom": "prompt_injection_invocations", + "tableTo": "companies", "columnsFrom": [ "company_id" ], - "tableTo": "companies", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "prompt_injection_invocations_cost_event_id_cost_events_id_fk": { "name": "prompt_injection_invocations_cost_event_id_cost_events_id_fk", "tableFrom": "prompt_injection_invocations", + "tableTo": "cost_events", "columnsFrom": [ "cost_event_id" ], - "tableTo": "cost_events", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -67204,21 +67398,21 @@ }, "enums": {}, "schemas": {}, - "views": {}, "sequences": { "public.chat_telegram_draft_ids": { "name": "chat_telegram_draft_ids", + "schema": "public", "increment": "1", + "startWith": "1", "minValue": "1", "maxValue": "2147483647", - "startWith": "1", "cache": "1", - "cycle": false, - "schema": "public" + "cycle": false } }, "roles": {}, "policies": {}, + "views": {}, "_meta": { "columns": {}, "schemas": {}, diff --git a/packages/db/src/migrations/meta/_journal.json b/packages/db/src/migrations/meta/_journal.json index 3d335bebd8c..5d8bc8d9a27 100644 --- a/packages/db/src/migrations/meta/_journal.json +++ b/packages/db/src/migrations/meta/_journal.json @@ -3130,6 +3130,13 @@ "when": 1794135798799, "tag": "0448_agent_harness_verified_digest", "breakpoints": true + }, + { + "idx": 449, + "version": "7", + "when": 1794147993995, + "tag": "0449_controller_instances", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema/controller_instances.ts b/packages/db/src/schema/controller_instances.ts new file mode 100644 index 00000000000..60e45a626cc --- /dev/null +++ b/packages/db/src/schema/controller_instances.ts @@ -0,0 +1,28 @@ +import { bigint, bigserial, index, integer, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core"; + +/** + * One row per server process boot. A live process renews its lease on the + * database clock; a newer boot fences an older one only after its lease has + * expired, and a fenced or lease-less process stops. Stamps name the boot id, + * so a record owned by a replaced container is proven gone without sharing a + * host or PID space with it. + */ +export const controllerInstances = pgTable( + "controller_instances", + { + bootId: text("boot_id").primaryKey(), + epoch: bigserial("epoch", { mode: "number" }).notNull(), + processSpace: text("process_space").notNull(), + pid: integer("pid").notNull(), + startedAt: timestamp("started_at", { withTimezone: true }).notNull().defaultNow(), + renewedAt: timestamp("renewed_at", { withTimezone: true }).notNull().defaultNow(), + leaseExpiresAt: timestamp("lease_expires_at", { withTimezone: true }).notNull(), + fencedAt: timestamp("fenced_at", { withTimezone: true }), + fencedByEpoch: bigint("fenced_by_epoch", { mode: "number" }), + stoppedAt: timestamp("stopped_at", { withTimezone: true }), + }, + (table) => ({ + epochIdx: uniqueIndex("controller_instances_epoch_idx").on(table.epoch), + liveIdx: index("controller_instances_lease_idx").on(table.leaseExpiresAt), + }), +); diff --git a/packages/db/src/schema/index.ts b/packages/db/src/schema/index.ts index 21948a1745b..1feb03de978 100644 --- a/packages/db/src/schema/index.ts +++ b/packages/db/src/schema/index.ts @@ -5,6 +5,7 @@ export { companyTransferRuns } from "./company_transfer_runs.js"; export { companyOnboardingSeeds } from "./company_onboarding_seeds.js"; export { authUsers, authSessions, authAccounts, authVerifications } from "./auth.js"; export { instanceSettings } from "./instance_settings.js"; +export { controllerInstances } from "./controller_instances.js"; export { instanceUserRoles } from "./instance_user_roles.js"; export { chatVoiceCallbacks } from "./chat_voice_callbacks.js"; export { userSidebarPreferences } from "./user_sidebar_preferences.js"; diff --git a/server/src/__tests__/controller-instance-lease.test.ts b/server/src/__tests__/controller-instance-lease.test.ts new file mode 100644 index 00000000000..7df0d46c85d --- /dev/null +++ b/server/src/__tests__/controller-instance-lease.test.ts @@ -0,0 +1,418 @@ +import { randomUUID } from "node:crypto"; +import { eq, sql } from "drizzle-orm"; +import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import { agents, companies, controllerInstances, createDb, environmentLeases, heartbeatRuns, issues, nativeRunFinalizations } from "@paperclipai/db"; +import { getEmbeddedPostgresTestSupport, startEmbeddedPostgresTestDatabase } from "./helpers/embedded-postgres.js"; +import { + controllerInstanceLeaseEnabled, proveControllerInstance, registerControllerInstanceDb, registerControllerInstanceLeaseWork, + resetControllerInstanceLeaseForTests, stopControllerInstanceLease, tickControllerInstanceLease, +} from "../services/controller-instance-lease.js"; +import { currentControllerBootId, currentControllerProcessStamp, currentProcessSpaceHash } from "../services/controller-process-identity.js"; +import type { createDeliveryWorkCoordinator } from "../services/delivery-work-coordinator.js"; +import { ENVIRONMENT_LEASE_CONTROLLER_KEY } from "../services/environment-lease-controller.js"; +import { proveOwnerGone, type LocalOwnerStamp } from "../services/owner-proof.js"; +import { createOwnershipReportState, runOwnershipReconciliationPass } from "../services/recovery/ownership-invariant-report.js"; +import { beginIdleTrackedWork, readTaskDrain } from "../services/task-admission.js"; + +const support = await getEmbeddedPostgresTestSupport(); +const suite = support.supported ? describe : describe.skip; + +suite("controller instance lease: a replaced container's records are provable", () => { + let db!: ReturnType; + let temporary: Awaited> | null = null; + let companyId = ""; + + beforeAll(async () => { + temporary = await startEmbeddedPostgresTestDatabase("paperclip-controller-instance-lease-"); + db = createDb(temporary.connectionString); + companyId = randomUUID(); + await db.insert(companies).values({ id: companyId, name: "Paperclip", issuePrefix: "CIL", requireBoardApprovalForNewAgents: false }); + }, 30_000); + + afterEach(async () => { + vi.unstubAllEnvs(); + resetControllerInstanceLeaseForTests(); + await db.delete(environmentLeases); + await db.delete(controllerInstances); + }); + + afterAll(async () => { await temporary?.cleanup(); }); + + const coordinator = { register: () => ({ ready: Promise.resolve(), wake: vi.fn(), stop: async () => {} }) } as unknown as + ReturnType; + + /** A server boot in another container: its own PID space, no platform deployment identity. */ + async function otherBoot(lease: { expiredMsAgo?: number; liveForMs?: number; epoch?: number } = {}) { + const bootId = `boot-${randomUUID()}`; + const expires = lease.liveForMs !== undefined ? sql`now() + ${`${lease.liveForMs} milliseconds`}::interval` + : sql`now() - ${`${lease.expiredMsAgo ?? 120_000} milliseconds`}::interval`; + await db.insert(controllerInstances).values({ bootId, processSpace: "old-container", pid: 7, leaseExpiresAt: expires, + ...(lease.epoch !== undefined ? { epoch: lease.epoch } : {}) }); + return bootId; + } + + const minutesAgo = (minutes: number) => new Date(Date.now() - minutes * 60_000).toISOString(); + const stampOf = (bootId: string, extra: Partial = {}): LocalOwnerStamp => ({ + kind: "local", scope: "test", generation: null, host: null, processSpace: "old-container", bootId, pid: 7, + processStartedAt: null, processGroupId: null, touchedAt: minutesAgo(10), ...extra }); + + /** Registers this boot's lease; a stamp plus one tick creates its row and epoch. */ + async function startHere(options: Parameters[2] = {}, stamp = true) { + registerControllerInstanceDb(db); + const lost = vi.fn(); + registerControllerInstanceLeaseWork(db, coordinator, { onLost: lost, ...options }); + if (stamp) { currentControllerProcessStamp(); await tickControllerInstanceLease(); } + const [row] = await db.select().from(controllerInstances).where(eq(controllerInstances.bootId, currentControllerBootId())); + return { lost, epoch: row?.epoch ?? null }; + } + + it("proves a replaced container's records gone by fencing its boot, with no Railway environment", async () => { + for (const key of ["RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID", "RAILWAY_SERVICE_ID", "RAILWAY_DEPLOYMENT_ID"]) vi.stubEnv(key, ""); + expect(controllerInstanceLeaseEnabled()).toBe(true); + const replaced = await otherBoot({ expiredMsAgo: 120_000 }); + const another = await otherBoot({ expiredMsAgo: 120_000 }); + const { epoch } = await startHere(); + expect(await proveOwnerGone(stampOf(replaced))).toEqual({ verdict: "gone", reason: "controller_fenced" }); + const [row] = await db.select().from(controllerInstances).where(eq(controllerInstances.bootId, replaced)); + expect(row).toMatchObject({ fencedByEpoch: epoch }); + + const leaseId = randomUUID(); + await db.insert(environmentLeases).values({ id: leaseId, companyId, heartbeatRunId: null, status: "active", + leasePolicy: "ephemeral", provider: "fake", providerLeaseId: `sandbox://fake/${leaseId}`, updatedAt: new Date(minutesAgo(10)), + metadata: { [ENVIRONMENT_LEASE_CONTROLLER_KEY]: { bootId: another, pid: 7, hostHash: "old-container", processStartedAt: null } } }); + const first = await runOwnershipReconciliationPass(db, { state: createOwnershipReportState() }); + expect(first.kinds.find(kind => kind.kind === "environment_login_probe_lease")).toMatchObject({ + settled: 1, reasons: { controller_fenced: 1 } }); + const second = await runOwnershipReconciliationPass(db, { state: createOwnershipReportState() }); + expect(second.kinds.find(kind => kind.kind === "environment_login_probe_lease")).toMatchObject({ settled: 0 }); + }); + + it("treats a live lease as alive", async () => { + const live = await otherBoot({ liveForMs: 60_000 }); + registerControllerInstanceDb(db); + expect(await proveOwnerGone(stampOf(live))).toEqual({ verdict: "alive", reason: "controller_lease_held" }); + }); + + it("keeps an owner alive (and watched) through the grace, and for work written after an idle lapse", async () => { + const justExpired = await otherBoot({ expiredMsAgo: 5_000 }); + const resumed = await otherBoot({ expiredMsAgo: 600_000 }); + await startHere(); + expect(await proveOwnerGone(stampOf(justExpired))).toEqual({ verdict: "alive", reason: "controller_lease_grace" }); + expect(await proveOwnerGone(stampOf(resumed, { touchedAt: minutesAgo(1) }))).toEqual({ verdict: "alive", reason: "controller_lease_grace" }); + expect(await proveOwnerGone(stampOf(resumed, { touchedAt: null }))).toEqual({ verdict: "unprovable", reason: "different_process_space" }); + for (const bootId of [justExpired, resumed]) expect(await proveControllerInstance(db, bootId, null)).toBe("expired"); + }); + + it("never lets an older epoch fence a newer one", async () => { + await startHere(); + const newer = await otherBoot({ expiredMsAgo: 600_000, epoch: 9_000_000 }); + expect(await proveOwnerGone(stampOf(newer))).toEqual({ verdict: "unprovable", reason: "different_process_space" }); + expect(await proveControllerInstance(db, newer, null)).toBe("expired"); + }); + + it("never fences without a lease row of its own: off, or not registered", async () => { + const replaced = await otherBoot({ expiredMsAgo: 600_000 }); + registerControllerInstanceDb(db); + expect(await proveOwnerGone(stampOf(replaced))).toEqual({ verdict: "unprovable", reason: "different_process_space" }); + expect(await proveControllerInstance(db, replaced, null)).toBe("expired"); + }); + + it("an idle prover creates its own row on demand, then fences", async () => { + const replaced = await otherBoot({ expiredMsAgo: 600_000 }); + await startHere({}, false); + expect(await db.select().from(controllerInstances).where(eq(controllerInstances.bootId, currentControllerBootId()))).toEqual([]); + expect(await proveOwnerGone(stampOf(replaced))).toEqual({ verdict: "gone", reason: "controller_fenced" }); + const [own] = await db.select().from(controllerInstances).where(eq(controllerInstances.bootId, currentControllerBootId())); + const [fenced] = await db.select().from(controllerInstances).where(eq(controllerInstances.bootId, replaced)); + expect(fenced?.fencedByEpoch).toBe(own?.epoch); + }); + + it("never fences on a read-only pass", async () => { + const replaced = await otherBoot({ expiredMsAgo: 600_000 }); + await startHere(); + const leaseId = randomUUID(); + await db.insert(environmentLeases).values({ id: leaseId, companyId, heartbeatRunId: null, status: "active", + leasePolicy: "ephemeral", provider: "fake", providerLeaseId: `sandbox://fake/${leaseId}`, updatedAt: new Date(minutesAgo(15)), + metadata: { [ENVIRONMENT_LEASE_CONTROLLER_KEY]: { bootId: replaced, pid: 7, hostHash: "old-container", processStartedAt: null } } }); + const report = await runOwnershipReconciliationPass(db, { state: createOwnershipReportState(), record: false }); + expect(report.kinds.find(kind => kind.kind === "environment_login_probe_lease")).toMatchObject({ settled: 0 }); + expect(await proveControllerInstance(db, replaced, null)).toBe("expired"); + }); + + it("keeps renewing while this boot holds a native finalizer lease", async () => { + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + await startHere(); + vi.setSystemTime(Date.now() + 120_000); + const holder = { token: "token-1", bootId: currentControllerBootId(), pid: process.pid, hostHash: currentProcessSpaceHash(), processStartedAt: null }; + const agentId = randomUUID(), issueId = randomUUID(), runId = randomUUID(); + await db.insert(agents).values({ id: agentId, companyId, name: "Finalizer", adapterType: "codex_local", status: "idle" }); + await db.insert(issues).values({ id: issueId, companyId, title: "Native task" }); + await db.insert(heartbeatRuns).values({ id: runId, companyId, agentId, status: "succeeded", invocationSource: "on_demand", runtimeMode: "native", nativeIssueId: issueId, issueId }); + await db.insert(nativeRunFinalizations).values({ runId, companyId, issueId, phase: "observed", + leaseOwner: "token-1", leaseHolder: holder, leaseExpiresAt: new Date(Date.now() + 300_000) }); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + currentControllerProcessStamp(); vi.setSystemTime(Date.now() + 120_000); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("live"); + await db.delete(nativeRunFinalizations); + await db.delete(heartbeatRuns); + await db.delete(issues); + await db.delete(agents); + } finally { vi.useRealTimers(); } + }); + + it("keeps renewing while this boot runs a legacy run", async () => { + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + await startHere(); + vi.setSystemTime(Date.now() + 120_000); + const agentId = randomUUID(), runId = randomUUID(); + await db.insert(agents).values({ id: agentId, companyId, name: "Legacy", adapterType: "codex_local", status: "running" }); + await db.insert(heartbeatRuns).values({ id: runId, companyId, agentId, status: "running", invocationSource: "on_demand", + runtimeMode: "legacy", controllerBootId: currentControllerBootId() }); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + currentControllerProcessStamp(); vi.setSystemTime(Date.now() + 120_000); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("live"); + await db.delete(heartbeatRuns); + await db.delete(agents); + } finally { vi.useRealTimers(); } + }); + + it("proves a cleanly stopped boot gone at once", async () => { + const stopped = await otherBoot({ liveForMs: 60_000 }); + await db.update(controllerInstances).set({ stoppedAt: sql`now()` }).where(eq(controllerInstances.bootId, stopped)); + registerControllerInstanceDb(db); + expect(await proveOwnerGone(stampOf(stopped))).toEqual({ verdict: "gone", reason: "controller_stopped" }); + }); + + it("keeps a record that names a process group unprovable: agent processes may outlive their server", async () => { + const replaced = await otherBoot(); + await startHere(); + expect(await proveOwnerGone(stampOf(replaced, { processGroupId: 7 }))).toEqual({ verdict: "unprovable", reason: "different_process_space" }); + }); + + it("issues no statements while idle, and renews in one statement only while it holds stamped work", async () => { + let now = 0; + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + await startHere({ now: () => now }, false); + await tickControllerInstanceLease(); + expect(await db.select().from(controllerInstances)).toEqual([]); + currentControllerProcessStamp(); + await tickControllerInstanceLease(); + const [created] = await db.select().from(controllerInstances); + expect(created).toMatchObject({ bootId: currentControllerBootId(), processSpace: currentProcessSpaceHash() }); + // Past the stamp window, a record stamped with this boot still holds the lease. + now = 120_000; + vi.setSystemTime(Date.now() + 120_000); + const leaseId = randomUUID(); + await db.insert(environmentLeases).values({ id: leaseId, companyId, heartbeatRunId: null, status: "active", leasePolicy: "ephemeral", + metadata: { [ENVIRONMENT_LEASE_CONTROLLER_KEY]: { bootId: currentControllerBootId(), pid: process.pid, hostHash: currentProcessSpaceHash(), processStartedAt: null } } }); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect((await proveControllerInstance(db, currentControllerBootId(), null))).toBe("live"); + // Released, and the server's work settled (every stamped write committed): the next renewal + // lets the lease lapse and the worker goes quiet. + await db.delete(environmentLeases); + beginIdleTrackedWork()(); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect((await proveControllerInstance(db, currentControllerBootId(), null))).toBe("expired"); + const renew = vi.fn(); + resetControllerInstanceLeaseForTests(); + registerControllerInstanceLeaseWork(db, coordinator, { renew }); + await tickControllerInstanceLease(); + expect(renew).not.toHaveBeenCalled(); + } finally { vi.useRealTimers(); } + }); + + it("re-checks holdings when other work settles, not on its own run's settle, at most every 5 s", async () => { + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + const wake = vi.fn(); + const capturing = { register: () => ({ ready: Promise.resolve(), wake, stop: async () => {} }) } as unknown as + ReturnType; + registerControllerInstanceDb(db); + registerControllerInstanceLeaseWork(db, capturing, { renew: async () => "holding" as const }); + currentControllerProcessStamp(); + expect(wake).toHaveBeenCalledTimes(1); + await tickControllerInstanceLease(); + beginIdleTrackedWork()(); + expect(wake).toHaveBeenCalledTimes(1); + beginIdleTrackedWork()(); + expect(wake).toHaveBeenCalledTimes(1); + vi.setSystemTime(Date.now() + 6_000); + beginIdleTrackedWork()(); + expect(wake).toHaveBeenCalledTimes(2); + } finally { vi.useRealTimers(); } + }); + + it("never loses a stamp taken while a renewal is in flight", async () => { + const wake = vi.fn(); + const capturing = { register: () => ({ ready: Promise.resolve(), wake, stop: async () => {} }) } as unknown as + ReturnType; + registerControllerInstanceDb(db); + registerControllerInstanceLeaseWork(db, capturing, { renew: async () => { currentControllerProcessStamp(); return "idle" as const; } }); + currentControllerProcessStamp(); + wake.mockClear(); + await tickControllerInstanceLease(); + expect(wake).toHaveBeenCalledTimes(1); + }); + + it("counts a cleanup claim as held only while its attempt is in flight", async () => { + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + await startHere(); + vi.setSystemTime(Date.now() + 60_000); + const leaseId = randomUUID(); + const claim = { bootId: currentControllerBootId(), pid: process.pid, hostHash: currentProcessSpaceHash(), processStartedAt: null }; + await db.insert(environmentLeases).values({ id: leaseId, companyId, heartbeatRunId: null, status: "pending_cleanup", leasePolicy: "ephemeral", + metadata: { pendingCleanupController: claim, pendingCleanupInFlight: false } }); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + // A stamp whose record no renewal saw holds the lease until the 10-minute cap. + currentControllerProcessStamp(); vi.setSystemTime(Date.now() + 120_000); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("live"); + vi.setSystemTime(Date.now() + 11 * 60_000); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("expired"); + await db.update(environmentLeases).set({ metadata: { pendingCleanupController: claim, pendingCleanupInFlight: true } }); + currentControllerProcessStamp(); vi.setSystemTime(Date.now() + 120_000); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("live"); + } finally { vi.useRealTimers(); } + }); + + it("holds an unobserved stamp only until the server's work settles", async () => { + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + await startHere(); + vi.setSystemTime(Date.now() + 120_000); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("live"); + beginIdleTrackedWork()(); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("expired"); + } finally { vi.useRealTimers(); } + }); + + it("keeps a pending stamped write held when a renewal sees another held record", async () => { + vi.useFakeTimers({ toFake: ["Date"], now: new Date() }); + try { + await startHere(); + const agentId = randomUUID(), runId = randomUUID(); + await db.insert(agents).values({ id: agentId, companyId, name: "Legacy", adapterType: "codex_local", status: "running" }); + await db.insert(heartbeatRuns).values({ id: runId, companyId, agentId, status: "running", invocationSource: "on_demand", + runtimeMode: "legacy", controllerBootId: currentControllerBootId() }); + // A second stamp whose ownership write has not committed yet. + currentControllerProcessStamp(); + await tickControllerInstanceLease(); + // The other record finishes; the pending write is still uncommitted past the stamp window. + await db.delete(heartbeatRuns); + await db.delete(agents); + vi.setSystemTime(Date.now() + 120_000); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("live"); + beginIdleTrackedWork()(); + await db.update(controllerInstances).set({ leaseExpiresAt: sql`now()` }); + await tickControllerInstanceLease(); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("expired"); + } finally { vi.useRealTimers(); } + }); + + it("rides out a 45 s database outage: quiesces dispatch, never exits, and resumes", async () => { + let now = 0, down = true; + const renew = vi.fn(async () => { if (down) throw new Error("connection refused"); return "holding" as const; }); + const { lost } = await startHere({ now: () => now, renew }, false); + currentControllerProcessStamp(); + for (now = 0; now <= 45_000; now += 5_000) { + await tickControllerInstanceLease(); + expect(readTaskDrain(new Date())).not.toBeNull(); + } + down = false; + await tickControllerInstanceLease(); + expect(lost).not.toHaveBeenCalled(); + expect(readTaskDrain(new Date())).toBeNull(); + }); + + it("bounds a renewal that never answers, counting from the attempt's start", async () => { + let now = 0; + vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] }); + try { + const { lost } = await startHere({ now: () => now, renew: () => new Promise(() => {}) }, false); + currentControllerProcessStamp(); + const attempt = tickControllerInstanceLease(); + now = 10_000; + await vi.advanceTimersByTimeAsync(10_000); + await attempt; + expect(readTaskDrain(new Date())).not.toBeNull(); + for (now = 15_000; now <= 60_000; now += 5_000) { + const next = tickControllerInstanceLease(); + await vi.advanceTimersByTimeAsync(10_000); + await next; + } + expect(lost).toHaveBeenCalledWith("lease_lost"); + } finally { vi.useRealTimers(); } + }); + + it("stops after a 70 s outage while holding work, and the successor recovers its work exactly once", async () => { + let now = 0; + const { lost } = await startHere({ now: () => now, renew: async () => { throw new Error("down"); } }, false); + currentControllerProcessStamp(); + for (now = 0; now <= 70_000 && !lost.mock.calls.length; now += 5_000) await tickControllerInstanceLease(); + expect(lost).toHaveBeenCalledWith("lease_lost"); + expect(now).toBeGreaterThanOrEqual(60_000); + expect(now).toBeLessThanOrEqual(70_000); + + // The stopped boot as its successor sees it: lease expired long ago, work last written under it. + resetControllerInstanceLeaseForTests(); + await db.insert(controllerInstances).values({ bootId: "exited-boot", processSpace: "old-container", pid: 7, + leaseExpiresAt: sql`now() - interval '3 minutes'`, epoch: 1 }); + await startHere(); + const leaseId = randomUUID(); + await db.insert(environmentLeases).values({ id: leaseId, companyId, heartbeatRunId: null, status: "active", + leasePolicy: "ephemeral", provider: "fake", providerLeaseId: `sandbox://fake/${leaseId}`, updatedAt: new Date(minutesAgo(5)), + metadata: { [ENVIRONMENT_LEASE_CONTROLLER_KEY]: { bootId: "exited-boot", pid: 7, hostHash: "old-container", processStartedAt: null } } }); + const passes = []; + for (let pass = 0; pass < 2; pass += 1) { + const report = await runOwnershipReconciliationPass(db, { state: createOwnershipReportState() }); + passes.push(report.kinds.find(kind => kind.kind === "environment_login_probe_lease")?.settled); + } + expect(passes).toEqual([1, 0]); + expect((await db.select().from(environmentLeases).where(eq(environmentLeases.id, leaseId)))[0]).toMatchObject({ status: "pending_cleanup" }); + }); + + it("stops at once when a newer boot fenced it", async () => { + const { lost } = await startHere(); + await db.update(controllerInstances).set({ fencedAt: sql`now()` }).where(eq(controllerInstances.bootId, currentControllerBootId())); + currentControllerProcessStamp(); + await tickControllerInstanceLease(); + expect(lost).toHaveBeenCalledWith("fenced"); + }); + + it("records a graceful stop, and is off on a volume-exclusive Railway deployment or when disabled", async () => { + await startHere(); + await stopControllerInstanceLease(db); + expect(await proveControllerInstance(db, currentControllerBootId(), null)).toBe("stopped"); + vi.stubEnv("PAPERCLIP_CONTROLLER_INSTANCE_LEASE", "off"); + expect(controllerInstanceLeaseEnabled()).toBe(false); + vi.unstubAllEnvs(); + for (const [key, value] of [["RAILWAY_PROJECT_ID", "p"], ["RAILWAY_ENVIRONMENT_ID", "e"], ["RAILWAY_SERVICE_ID", "s"], ["RAILWAY_DEPLOYMENT_ID", "d"]]) { + vi.stubEnv(key!, value!); + } + // A stateless Railway service has no deployment-replacement proof, so it keeps the lease. + expect(controllerInstanceLeaseEnabled()).toBe(true); + vi.stubEnv("RAILWAY_VOLUME_ID", "v"); + vi.stubEnv("RAILWAY_VOLUME_MOUNT_PATH", "/data"); + expect(controllerInstanceLeaseEnabled()).toBe(false); + vi.stubEnv("PAPERCLIP_CONTROLLER_INSTANCE_LEASE", "on"); + expect(controllerInstanceLeaseEnabled()).toBe(true); + vi.unstubAllEnvs(); + }); +}); diff --git a/server/src/__tests__/maintenance-server-routes.test.ts b/server/src/__tests__/maintenance-server-routes.test.ts index aa8a597442a..7d2111ecb8d 100644 --- a/server/src/__tests__/maintenance-server-routes.test.ts +++ b/server/src/__tests__/maintenance-server-routes.test.ts @@ -161,7 +161,12 @@ describeDatabase("assembled maintenance server production wiring", () => { await server.updateIssue({ id: issue!.id, status: "done" }); await settleClock(server); const quiet = server.proxy.queries.length; for (let step = 0; step < 4; step++) { await server.advance(30_000); await settleClock(server); } - expect(server.proxy.queries.length).toBe(quiet); + // The controller instance lease may check once more that the boot no longer holds the + // run's stamped records, then stops (it renews only while the boot holds work). + expect(server.proxy.queries.slice(quiet).filter(query => !query.sql.includes("controller_instances"))).toEqual([]); + const leaseIdle = server.proxy.queries.length; + for (let step = 0; step < 2; step++) { await server.advance(30_000); await settleClock(server); } + expect(server.proxy.queries.length).toBe(leaseIdle); await writeFile(path.join(server.directory, "receipt-measurement.json"), JSON.stringify({ phase: "ordinary-held-task-retry", companyId: company.id, issueId: issue!.id, requestId: retry.requestId, waiting, grace, parked, executed, count: count!.count, parkedRealMs: 30_000, parkedQueries: 0, settledClockMs: 120_000, settledQueries: 0, boundary: "actual Retry and subtree release HTTP, wakeAgents false, real clock through process/controller authority, real local process, no outcome seeded", frames: server.proxy.frames }, null, 2)); diff --git a/server/src/index.ts b/server/src/index.ts index 9f4c0d05e85..6645c7ef067 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -78,6 +78,8 @@ import { chatCompletionDeliveryService } from "./services/chat-completion-delive // instrumentationReady before opening DB connections or constructing the // HTTP server, so trace coverage does not depend on incidental timing. import { instrumentationReady, shutdownInstrumentation } from "./instrumentation.js"; +import { controllerInstanceLeaseEnabled, registerControllerInstanceDb, registerControllerInstanceLeaseWork, + stopControllerInstanceLease } from "./services/controller-instance-lease.js"; import { sentryReady, shutdownSentry, captureException } from "./sentry.js"; import { setSentryRunLinkResolver } from "./sentry-links.js"; import { createSentryRunLinkResolver } from "./services/sentry-run-links.js"; @@ -1097,6 +1099,13 @@ async function startServerWithDatabaseTeardown( logger.error({ err }, "startup reconciliation of managed runtime control operations failed"); } + // Records this boot owns are stamped with its boot id; the lease lets a server on + // another host or container prove this boot gone after it is replaced. + registerControllerInstanceDb(db as any); + const controllerInstanceLeaseWork = controllerInstanceLeaseEnabled() + ? registerControllerInstanceLeaseWork(db as any, deliveryWork) : null; + if (controllerInstanceLeaseWork) server.on("close", () => { void controllerInstanceLeaseWork.stop(); }); + // These jobs need not delay readiness, but their writes must finish before // an idle report can authorize sleep. Count the whole detached promise. void trackIdleWork(reconcilePersistedRuntimeServicesOnStartup(db as any) @@ -2167,7 +2176,9 @@ async function startServerWithDatabaseTeardown( // Keep the finalizer's defensive listener close for partial teardown paths. await finalizeServerShutdown({ signal, - shutdownAppServices: appShutdown, + shutdownAppServices: async () => { + try { await appShutdown?.(); } finally { await stopControllerInstanceLease(); } + }, closeHttpListener: () => closeHttpListenerForShutdown({ server, signal, log: logger }), drainPendingRunFailureReports: waitForPendingRunFailureReports, diff --git a/server/src/services/controller-instance-lease.ts b/server/src/services/controller-instance-lease.ts new file mode 100644 index 00000000000..36ff6f52412 --- /dev/null +++ b/server/src/services/controller-instance-lease.ts @@ -0,0 +1,298 @@ +import { and, eq, isNull, sql } from "drizzle-orm"; +import { controllerInstances, type Db } from "@paperclipai/db"; +import { logger } from "../middleware/logger.js"; +import { + currentControllerBootId, currentControllerDeployment, currentProcessSpaceHash, onControllerStamp, +} from "./controller-process-identity.js"; +import type { createDeliveryWorkCoordinator } from "./delivery-work-coordinator.js"; +import { DELIVERY_QUEUES } from "./delivery-work-notifications.js"; +import { setControllerLeaseQuiesce, subscribeIdleWorkSettled } from "./task-admission.js"; + +export const CONTROLLER_LEASE_TTL_MS = 90_000; +export const CONTROLLER_LEASE_RENEW_MS = 30_000; +/** Renewal attempts start failing from their own start; this boot stops after this long while holding work. */ +export const CONTROLLER_LEASE_SELF_FENCE_MS = 60_000; +/** A prover fences a boot only this long after the boot's last sign of life. */ +export const CONTROLLER_LEASE_FENCE_GRACE_MS = 30_000; +/** A stamp counts as held work for a full lease, so a slow ownership write commits before the lease can lapse. */ +const STAMP_COMMIT_GRACE_MS = CONTROLLER_LEASE_TTL_MS; +/** A settle of other work re-checks holdings at most this often. */ +const SETTLE_RECHECK_MIN_MS = 5_000; +/** A renewal that has not answered within this bound counts as failed. */ +const RENEW_TIMEOUT_MS = 10_000; +const RETRY_MS = 5_000; + +export type ControllerInstanceState = "live" | "grace" | "expired" | "fenced" | "stopped"; +/** "holding" saw an in-progress record held by this boot; "holding_stamp" held only for a recent stamp. */ +type RenewResult = "holding" | "holding_stamp" | "idle" | "fenced"; +/** A stamp whose record no renewal has seen keeps the lease held until the server's tracked work next settles + * (its write then committed or rolled back), and at most this long. */ +const UNOBSERVED_STAMP_CAP_MS = 10 * 60_000; + +type LeaseState = { + onLost: (reason: "fenced" | "lease_lost") => void; + now: () => number; + renew: (stampedRecently: boolean) => Promise; + lastStampAt: number; + /** Start of the first renewal attempt in the current failing streak. */ + failingSince: number | null; + /** Renewal is due: this boot stamped work, or its last renewal found work it still holds. */ + active: boolean; + epoch: number | null; + stopped: boolean; + /** Wall-clock time of the last stamp (the stamp window follows the server's clock). */ + lastStampWallAt: number; + lastTickAt: number; + /** Counts stamps, so a stamp taken while a renewal is in flight is never lost. */ + stampSeq: number; + /** Wall time of the oldest stamp no renewal has yet seen a held record for. */ + unobservedStampSince: number | null; + unsubscribe: () => void; + wake: () => void; +}; + +let state: LeaseState | null = null; +let registeredDb: Db | null = null; + +/** A Railway deployment with an exclusive volume proves a replaced deployment on its own; every + * other host (Docker, Kubernetes, Fly, a stateless Railway service, a rebooted machine) needs the + * lease to prove a replaced process. PAPERCLIP_CONTROLLER_INSTANCE_LEASE=on|off overrides this. */ +export function controllerInstanceLeaseEnabled(env: NodeJS.ProcessEnv = process.env): boolean { + const setting = env.PAPERCLIP_CONTROLLER_INSTANCE_LEASE; + if (setting === "off") return false; + if (setting === "on") return true; + return currentControllerDeployment(env)?.exclusiveVolume !== true; +} + +function exitOnLostLease(reason: "fenced" | "lease_lost") { + logger.fatal({ reason }, "controller instance lease lost while holding work; stopping so a newer server can recover it"); + process.exit(1); +} + +/** In-progress records stamped with this boot id: the process-owned kinds of the ownership registry. */ +function holdsStampedWorkSql(bootId: string) { + return sql`( + exists (select 1 from environment_leases where + (status = 'active' and metadata->'leaseController'->>'bootId' = ${bootId}) + or (status = 'pending_cleanup' and metadata->>'pendingCleanupInFlight' = 'true' + and metadata->'pendingCleanupController'->>'bootId' = ${bootId})) + or exists (select 1 from sandbox_creation_operations where state = 'pending' and metadata->'creationController'->>'bootId' = ${bootId}) + or exists (select 1 from workspace_operations where status in ('running', 'pending') and metadata->'finalizeOwner'->>'bootId' = ${bootId}) + or exists (select 1 from agents where lifecycle_operation->'leaseHolder'->>'bootId' = ${bootId}) + or exists (select 1 from native_run_finalizations where lease_owner is not null + and lease_holder->>'token' = lease_owner and lease_holder->>'bootId' = ${bootId}) + or exists (select 1 from native_run_finalizations where controller_boot_id = ${bootId} + and phase not in ('committed', 'terminal_failure', 'applied')) + or exists (select 1 from heartbeat_runs where status = 'running' and controller_boot_id::text = ${bootId}))`; +} + +/** + * One statement: create this boot's row on first use, and extend its lease only while the boot + * holds work (a stamp within the TTL, or an in-progress record stamped with its boot id). + * Returns whether it still holds work, or that a newer boot fenced it. + */ +function renewInDatabase(db: Db): (stampedRecently: boolean) => Promise { + return async stampedRecently => { + const bootId = currentControllerBootId(); + const records = holdsStampedWorkSql(bootId); + const holds = sql`(${stampedRecently} or ${records})`; + const expires = sql`now() + ${`${CONTROLLER_LEASE_TTL_MS} milliseconds`}::interval`; + const rows = await db.execute(sql` + insert into controller_instances (boot_id, process_space, pid, lease_expires_at) + values (${bootId}, ${currentProcessSpaceHash()}, ${process.pid}, ${expires}) + on conflict (boot_id) do update set + lease_expires_at = case when ${holds} then ${expires} else controller_instances.lease_expires_at end, + renewed_at = case when ${holds} then now() else controller_instances.renewed_at end + where controller_instances.fenced_at is null and controller_instances.stopped_at is null + returning epoch, ${holds} as holds, ${records} as records`) as unknown as Array<{ epoch: string | number; holds: boolean; records: boolean }>; + const row = rows[0]; + if (!row) return "fenced"; + if (state) state.epoch = Number(row.epoch); + return row.records ? "holding" : row.holds ? "holding_stamp" : "idle"; + }; +} + +function withTimeout(work: Promise, ms: number): Promise { + let timer: ReturnType | undefined; + return Promise.race([work, new Promise((_, reject) => { + timer = setTimeout(() => reject(new Error("controller instance lease renewal timed out")), ms); + })]).finally(() => clearTimeout(timer)); +} + +/** + * Registers this boot's lease with the shared delivery coordinator. The lease is renewed only + * while the boot holds work, so an idle boot issues no statements and its database can sleep. + */ +export function registerControllerInstanceLeaseWork(db: Db, coordinator: ReturnType, + options: { + onLost?: (reason: "fenced" | "lease_lost") => void; + now?: () => number; + renew?: (stampedRecently: boolean) => Promise; + } = {}) { + registeredDb = db; + const current: LeaseState = { + onLost: options.onLost ?? exitOnLostLease, now: options.now ?? (() => performance.now()), + renew: options.renew ?? renewInDatabase(db), lastStampAt: Number.NEGATIVE_INFINITY, failingSince: null, + active: false, epoch: null, stopped: false, unsubscribe: () => {}, wake: () => {}, + lastStampWallAt: Number.NEGATIVE_INFINITY, lastTickAt: Number.NEGATIVE_INFINITY, stampSeq: 0, + unobservedStampSince: null, + }; + state = current; + const worker = coordinator.register(DELIVERY_QUEUES.controllerInstanceLease, { + retryMs: RETRY_MS, + runDuringDrain: true, + run: () => tickControllerInstanceLease(), + hasPending: async () => false, + nextRunAt: () => nextLeaseDeadline(current), + }); + current.wake = worker.wake; + const unsubscribeStamp = onControllerStamp(() => { + const wasActive = current.active; + current.lastStampAt = current.now(); + current.lastStampWallAt = Date.now(); + current.stampSeq += 1; + current.unobservedStampSince ??= Date.now(); + current.active = true; + // The first stamp after an idle lapse renews at once, without delaying the stamping write. + if (!wasActive && !current.stopped) worker.wake(); + }); + // When the server's work settles, check holdings now rather than one renewal later, + // so an idle server issues no statement after its last work. + // The rate limit also absorbs the settle of this worker's own run. + const unsubscribeSettle = subscribeIdleWorkSettled(() => { + // All tracked work finished: any ownership write it made has committed or rolled back, + // so the holdings query is authoritative from here on. + current.unobservedStampSince = null; + if (current.active && !current.stopped && Date.now() - current.lastTickAt >= SETTLE_RECHECK_MIN_MS) worker.wake(); + }); + current.unsubscribe = () => { unsubscribeStamp(); unsubscribeSettle(); }; + return { + ready: worker.ready, + stop: async () => { + current.unsubscribe(); + await worker.stop(); + }, + }; +} + +function nextLeaseDeadline(current: LeaseState): number | null { + if (current.stopped) return null; + if (current.failingSince !== null) return Date.now() + RETRY_MS; + return current.active ? Date.now() + CONTROLLER_LEASE_RENEW_MS : null; +} + +/** Renew while holding work; quiesce on failure; stop only if the failure outlasts the self-fence window with work held. */ +export async function tickControllerInstanceLease(): Promise { + const current = state; + if (!current || current.stopped || (!current.active && current.failingSince === null)) return; + const attemptStartedAt = current.now(); + const stampSeqAtStart = current.stampSeq; + current.lastTickAt = Date.now(); + // Held until a renewal sees the stamped record committed (or rolled back past the cap). + const stampedRecently = Date.now() - current.lastStampWallAt < STAMP_COMMIT_GRACE_MS + || (current.unobservedStampSince !== null && Date.now() - current.unobservedStampSince < UNOBSERVED_STAMP_CAP_MS); + let result: RenewResult | "failed"; + try { result = await withTimeout(current.renew(stampedRecently), RENEW_TIMEOUT_MS); } catch (error) { + logger.warn({ err: error }, "controller instance lease renewal failed"); + result = "failed"; + } + if (result === "holding" || result === "holding_stamp" || result === "idle") { + current.failingSince = null; + // Idle: the lease lapses with no further statements until the next stamp wakes it. + // A stamp taken during this attempt was not seen by its snapshot: check again now. + const stampedDuringAttempt = current.stampSeq !== stampSeqAtStart; + // A held record does not show that every stamped write has committed: another stamp's + // write may still be pending. Only the work-settled signal (or the cap) clears it. + current.active = result !== "idle" || stampedDuringAttempt; + if (result === "idle" && stampedDuringAttempt) current.wake(); + setControllerLeaseQuiesce(false); + return; + } + // Fenced or unreachable: dispatch nothing new while the outcome is open. + setControllerLeaseQuiesce(true); + if (result === "fenced") { current.stopped = true; current.onLost("fenced"); return; } + current.failingSince ??= attemptStartedAt; + if (current.now() - current.failingSince >= CONTROLLER_LEASE_SELF_FENCE_MS && (current.active || stampedRecently)) { + current.stopped = true; + current.onLost("lease_lost"); + } +} + +/** Graceful shutdown: this boot no longer owns anything, so its stamps are gone at once. */ +export async function stopControllerInstanceLease(db: Db | null = registeredDb): Promise { + const current = state; + if (current) { current.stopped = true; current.unsubscribe(); } + state = null; + if (!db || current?.epoch == null) return; + await db.update(controllerInstances).set({ stoppedAt: sql`now()` }) + .where(eq(controllerInstances.bootId, currentControllerBootId())) + .catch(error => logger.warn({ err: error }, "controller instance stop record failed")); +} + +/** + * The lease state of another boot, for a record it last wrote at `touchedAt`. The boot's last + * sign of life is the later of its lease expiry and that write plus the TTL (a boot that resumed + * after an idle lapse renews on its first stamp). Within the grace after it, the owner is still + * treated as alive so the record stays watched; past it, the boot is fenced (only by a newer + * epoch) and its records are gone. A boot that held work exits before this point. + */ +export async function proveControllerInstance(db: Db, bootId: string, touchedAt: Date | null, + options: { readOnly?: boolean } = {}): Promise { + const [row] = await db.select({ + fenced: sql`${controllerInstances.fencedAt} is not null`, + stopped: sql`${controllerInstances.stoppedAt} is not null`, + live: sql`${controllerInstances.leaseExpiresAt} > now()`, + pastGrace: sql`greatest(${controllerInstances.leaseExpiresAt}, + ${touchedAt?.toISOString() ?? null}::timestamptz + ${`${CONTROLLER_LEASE_TTL_MS} milliseconds`}::interval) + < now() - ${`${CONTROLLER_LEASE_FENCE_GRACE_MS} milliseconds`}::interval`, + }).from(controllerInstances).where(eq(controllerInstances.bootId, bootId)); + if (!row) return null; + if (row.stopped) return "stopped"; + if (row.fenced) return "fenced"; + if (row.live) return "live"; + if (!touchedAt) return "expired"; + if (!row.pastGrace) return "grace"; + // A read-only pass reports; only a mutating pass fences (or creates this boot's row). + if (options.readOnly) return "expired"; + // Only a boot that holds a lease row of its own may fence, and only an older epoch. + const epoch = await ownEpoch(); + if (epoch === null) return "expired"; + const [fenced] = await db.update(controllerInstances).set({ fencedAt: sql`now()`, fencedByEpoch: epoch }) + .where(and(eq(controllerInstances.bootId, bootId), isNull(controllerInstances.fencedAt), isNull(controllerInstances.stoppedAt), + sql`greatest(${controllerInstances.leaseExpiresAt}, ${touchedAt.toISOString()}::timestamptz + + ${`${CONTROLLER_LEASE_TTL_MS} milliseconds`}::interval) + < now() - ${`${CONTROLLER_LEASE_FENCE_GRACE_MS} milliseconds`}::interval`, + sql`${controllerInstances.epoch} < ${epoch}`)) + .returning({ bootId: controllerInstances.bootId }); + if (fenced) return "fenced"; + const [after] = await db.select({ fenced: sql`${controllerInstances.fencedAt} is not null` }) + .from(controllerInstances).where(eq(controllerInstances.bootId, bootId)); + return after?.fenced ? "fenced" : "expired"; +} + +/** This boot's epoch, creating its row on first need (one statement). Null when the lease is off or unreachable. */ +async function ownEpoch(): Promise { + const current = state; + if (!current || current.stopped) return null; + if (current.epoch === null) { + const result = await withTimeout(current.renew(false), RENEW_TIMEOUT_MS).catch(() => null); + if (result === "fenced") return null; + } + return current.epoch; +} + +/** Lets the owner proof read other boots' leases, whether or not this boot holds one. */ +export function registerControllerInstanceDb(db: Db): void { + registeredDb = db; +} + +export function registeredControllerInstanceDb(): Db | null { + return registeredDb; +} + +export function resetControllerInstanceLeaseForTests(): void { + state?.unsubscribe(); + state = null; + registeredDb = null; + setControllerLeaseQuiesce(false); +} diff --git a/server/src/services/controller-process-identity.ts b/server/src/services/controller-process-identity.ts index 030dceaa295..9986100214b 100644 --- a/server/src/services/controller-process-identity.ts +++ b/server/src/services/controller-process-identity.ts @@ -119,10 +119,23 @@ export function currentControllerBootId(): string { return bootId; } +const stampListeners = new Set<() => void>(); +/** Called (synchronously, without I/O) whenever this process stamps ownership of a record. */ +export function onControllerStamp(listener: () => void): () => void { + stampListeners.add(listener); + return () => { stampListeners.delete(listener); }; +} +function notifyStamp() { + for (const listener of stampListeners) { + try { listener(); } catch { /* a listener never blocks a stamp */ } + } +} + export async function currentControllerProcess(): Promise { const startedAt = await currentProcessStartedAtMs(); const iso = startedAt === null ? null : new Date(startedAt).toISOString(); resolvedProcessStartedAt = iso; + notifyStamp(); return { bootId, pid: process.pid, hostHash, processStartedAt: iso, ...deploymentField() }; } @@ -133,6 +146,7 @@ export async function currentControllerProcess(): Promise { * a live PID then stays ambiguous, which fails closed. */ export function currentControllerProcessStamp(): ControllerProcess { + notifyStamp(); return { bootId, pid: process.pid, hostHash, processStartedAt: resolvedProcessStartedAt, ...deploymentField() }; } diff --git a/server/src/services/delivery-work-notifications.ts b/server/src/services/delivery-work-notifications.ts index 487532c1684..c8ecc5a9ba6 100644 --- a/server/src/services/delivery-work-notifications.ts +++ b/server/src/services/delivery-work-notifications.ts @@ -88,6 +88,7 @@ export const DELIVERY_QUEUES = { budgetEnforcement: "budget-enforcement", accounting: "cost-accounting", taskDrainExpiry: "task-drain-expiry", + controllerInstanceLease: "controller-instance-lease", agentLifecycle: "agent-lifecycle", chatBoardMessages: "chat-board-messages", chatTaskStarts: "chat-task-starts", diff --git a/server/src/services/owner-proof.ts b/server/src/services/owner-proof.ts index f76dc42bad5..61c6129346e 100644 --- a/server/src/services/owner-proof.ts +++ b/server/src/services/owner-proof.ts @@ -12,6 +12,7 @@ import { } from "./controller-process-identity.js"; import type { WorkspaceWorker } from "./native-runtime/native-workspace-platform-proof.js"; import { ephemeralServerEnabled } from "./ephemeral-server-mode.js"; +import { proveControllerInstance, registeredControllerInstanceDb, type ControllerInstanceState } from "./controller-instance-lease.js"; /** `processSpace` value written when a board operator confirmed that this exact * recorded owner stopped (native-controller-host-recovery.ts). The attestation @@ -57,6 +58,8 @@ export type LocalOwnerStamp = { * An ephemeral (multi-host) server never judges them. */ processSpaceUnrecorded?: boolean; + /** When the owned record was last written, if the caller knows (for the controller lease proof). */ + touchedAt?: string | null; }; export type RemoteOwnerStamp = { @@ -89,6 +92,9 @@ export type OwnerProofReason = | "provider_stopped" | "deployment_replaced" | "operator_attested" + /** The owner's server boot stopped cleanly, or a newer boot fenced it after its lease expired. */ + | "controller_stopped" + | "controller_fenced" /** This process owns the record and is not executing its run. Only a * caller that knows this process's executions may conclude it * (`settleOwnableKind` with `currentProcessIdle`); the prover never does. */ @@ -98,6 +104,8 @@ export type OwnerProofReason = | "pid_alive" | "process_group_alive" | "fence_held" + | "controller_lease_held" + | "controller_lease_grace" | "provider_running" // unprovable | "missing_identity" @@ -135,6 +143,10 @@ export type ProcessProbe = { * the platform stops every earlier deployment of the service before it * starts this one (a Railway service with an attached volume). */ deployment?: { worker: WorkspaceWorker; exclusiveVolume: boolean; volumeId?: string | null } | null; + /** The lease state of another server boot (controller_instances), when this server can read it. */ + controllerInstance?: (bootId: string, touchedAt: Date | null) => Promise; + /** Report without changing any lease row (a read-only reconciliation pass). */ + readOnly?: boolean; }; function processGroupExists(processGroupId: number): boolean { @@ -163,6 +175,10 @@ export function currentProcessProbe(): ProcessProbe { processSpace: currentProcessSpaceHash(), pidExists: processExists, processGroupExists, + controllerInstance: async function (this: ProcessProbe, bootId, touchedAt) { + const db = registeredControllerInstanceDb(); + return db ? proveControllerInstance(db, bootId, touchedAt, { readOnly: this?.readOnly === true }) : null; + }, readStartedAt: async pid => { const startedAt = await observedProcessStartedAt(pid); return startedAt === null ? null : new Date(startedAt); @@ -230,6 +246,23 @@ export async function proveOwnerGone( } async function proveLocalOwnerGone(stamp: LocalOwnerStamp, probe: ProcessProbe): Promise { + const proof = await proveLocalProcessGone(stamp, probe); + if (proof.verdict !== "unprovable" || !CROSS_SPACE_REASONS.has(proof.reason) || !stamp.bootId || !probe.controllerInstance + || validPid(stamp.processGroupId ?? null)) return proof; + // Another host or PID space: the owner's server boot answers through its lease. Only a record the + // server process itself held qualifies; agent processes in a recorded group may outlive it. + const instance = await probe.controllerInstance(stamp.bootId, stamp.touchedAt ? new Date(stamp.touchedAt) : null); + if (instance === "stopped") return { verdict: "gone", reason: "controller_stopped" }; + if (instance === "fenced") return { verdict: "gone", reason: "controller_fenced" }; + if (instance === "live") return { verdict: "alive", reason: "controller_lease_held" }; + // Just past its last sign of life: kept as alive so the settle watch re-checks it after the grace. + if (instance === "grace") return { verdict: "alive", reason: "controller_lease_grace" }; + return proof; +} + +const CROSS_SPACE_REASONS = new Set(["different_process_space", "different_host", "unknown_process_space"]); + +async function proveLocalProcessGone(stamp: LocalOwnerStamp, probe: ProcessProbe): Promise { if (stamp.bootId && stamp.bootId === probe.bootId) return { verdict: "alive", reason: "current_process" }; // The platform stopped the owner's whole deployment, with every process and // orphaned child in it, before it started this one. Host and PID are moot. diff --git a/server/src/services/recovery/ownership-invariant-report.ts b/server/src/services/recovery/ownership-invariant-report.ts index fae6a0cd9c7..b3379adb9d7 100644 --- a/server/src/services/recovery/ownership-invariant-report.ts +++ b/server/src/services/recovery/ownership-invariant-report.ts @@ -10,7 +10,7 @@ import { taskClosedByAgentSql, TEMPORARY_REFUSAL_TRIGGERS } from "../work-intent import { deliveredQueuedCommentIds } from "../queued-comment-delivery.js"; import { logger } from "../../middleware/logger.js"; import { persistActivity } from "../activity-log.js"; -import { proveOwnerGone, type OwnerProof, type ProcessProbe } from "../owner-proof.js"; +import { currentProcessProbe, proveOwnerGone, type OwnerProof, type ProcessProbe } from "../owner-proof.js"; import { OWNABLE_KINDS, resolveFenceHolders, @@ -176,9 +176,10 @@ async function classifyRunOwners(db: Db, records: InProgressRecord[]): Promise, probe: ProcessProbe | undefined, - now: Date): Promise { + now: Date, touchedAt: Date | null = null): Promise { switch (owner.kind) { - case "process": return proveOwnerGone(owner.stamp, probe); + // The record's last write time lets a replaced server boot be fenced only for work it touched under a valid lease. + case "process": return proveOwnerGone(touchedAt ? { ...owner.stamp, touchedAt: touchedAt.toISOString() } : owner.stamp, probe); case "fence": return proveOwnerGone(owner.stamp, owner.fence, now); case "run": return runProofs.get(owner.runId) ?? { verdict: "unprovable", reason: "owner_run_unread" }; case "issue": return runProofs.get(`issue:${owner.issueId}`) ?? { verdict: "unprovable", reason: "owner_issue_unread" }; @@ -272,7 +273,7 @@ async function settleKind(db: Db, kindId: string, options: { const settled: SettledRecord[] = []; let watched = 0; for (const record of unique) { - let proof = await classify(record.owner, runProofs, options.probe, now); + let proof = await classify(record.owner, runProofs, options.probe, now, record.updatedAt); if (options.currentProcessIdle && record.runId && proof.verdict === "alive" && proof.reason === "current_process") { proof = { verdict: "gone", reason: "current_process_idle" }; } @@ -588,6 +589,8 @@ export async function runOwnershipReconciliationPass(db: Db, options: { const goneThisPass = new Set(); let queueDueAt: Date | null = null; const settleRecords = options.settle ?? options.record !== false; + // A pass that settles nothing must not fence another boot's lease either. + const passProbe = settleRecords ? options.probe : { ...(options.probe ?? currentProcessProbe()), readOnly: true }; let retryNeeded = false; for (const kind of kinds) { @@ -618,7 +621,7 @@ export async function runOwnershipReconciliationPass(db: Db, options: { report.inProgress = unique.length; const runProofs = await classifyRunOwners(db, unique); for (const record of unique) { - const proof = await classify(record.owner, runProofs, options.probe, now); + const proof = await classify(record.owner, runProofs, passProbe, now, record.updatedAt); report.verdicts[proof.verdict] += 1; report.reasons[proof.reason] = (report.reasons[proof.reason] ?? 0) + 1; const base = { kind: kind.id, recordId: record.recordId, companyId: record.companyId, diff --git a/server/src/services/task-admission.ts b/server/src/services/task-admission.ts index 0529e0c823f..176913c17d0 100644 --- a/server/src/services/task-admission.ts +++ b/server/src/services/task-admission.ts @@ -45,6 +45,16 @@ export function registerTaskDrainExpiryWork( }; } +// Set while this server cannot renew its controller instance lease: it stops +// dispatching new work until the lease is renewed (or it exits). It never +// replaces an operator's drain and has no idle owner, so HTTP stays open. +let controllerLeaseQuiesce: TaskDrainState | null = null; +export function setControllerLeaseQuiesce(quiesced: boolean): void { + if (quiesced === (controllerLeaseQuiesce !== null)) return; + controllerLeaseQuiesce = quiesced ? { startedAt: new Date(), expiresAt: null } : null; + notifyDrainChanged(); +} + export function readTaskDrain(now: Date): TaskDrainState | null { if (taskDrainState?.expiresAt && taskDrainState.expiresAt.getTime() <= now.getTime()) { taskDrainState = null; @@ -52,7 +62,7 @@ export function readTaskDrain(now: Date): TaskDrainState | null { try { listener(); } catch (error) { process.emitWarning(`Task drain expiry notification failed: ${String(error)}`); } } } - return taskDrainState; + return taskDrainState ?? controllerLeaseQuiesce; } export function computeTaskDrain(opts: { ttlMs?: number | null; purpose?: "idle" } = {}): TaskDrainState { @@ -71,7 +81,7 @@ export function startTaskDrain(opts: { ttlMs?: number | null; purpose?: "idle" } return drain; } export function stopTaskDrain(): { wasActive: boolean } { - const wasActive = readTaskDrain(new Date()) !== null; + const wasActive = readTaskDrain(new Date()) !== null && taskDrainState !== null; taskDrainState = null; notifyDrainChanged(); return { wasActive }; @@ -83,6 +93,12 @@ export function isIdleTaskDrainActive(): boolean { return Boolean(readTaskDrain( // The generation also catches work which starts AND finishes during a scan. let generation = 0; let active = 0; +const settledListeners = new Set<() => void>(); +/** Called (synchronously) whenever the last tracked work finishes. */ +export function subscribeIdleWorkSettled(listener: () => void): () => void { + settledListeners.add(listener); + return () => { settledListeners.delete(listener); }; +} export function beginIdleTrackedWork(): () => void { generation++; active++; @@ -92,6 +108,9 @@ export function beginIdleTrackedWork(): () => void { finished = true; active--; generation++; + if (active === 0) for (const listener of settledListeners) { + try { listener(); } catch { /* a listener never blocks work accounting */ } + } }; } export function trackIdleWork(work: Promise): Promise {