From 12bb7e1976caf83afda2ee85ba357ac204a1b7f1 Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Thu, 22 Oct 2026 15:52:04 -0700 Subject: [PATCH] feat: track git workspace restore points and apply their retention (#17241) ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Closed issues' git worktrees pile up on disk because they can only be removed once the remote reproduces them exactly > - #17238 adds restore points: encrypted saves of the unpushed and uncommitted parts of a worktree, so the worktree itself can be removed > - Those saves live in file storage and must be deleted on a schedule, and promptly when their issue or company is deleted > - This pull request adds the table that tracks restore points and a deadline-driven retention worker, with nothing creating restore points yet > - The benefit is a reviewable lifecycle foundation before capture is wired into expiration ## Linked Issues or Issue Description Refs #17238 (restore point library). Bug report described in-PR (bug report template). **What happened?** Closed issues' worktrees accumulate without bound. For example, one instance's last 111 git cache expiration checks removed nothing, because each worktree held unpushed commits or uncommitted files. Restore points (#17238) will let those worktrees be removed safely. That needs a durable record of every stored restore point and a retention policy for deleting them. **Expected behavior** - A restore point is kept while its work can still resume. - It is deleted a fixed time after its issue tree closes. - It is deleted promptly when its issue or company is deleted. **Steps to reproduce** Not applicable on its own: this adds the lifecycle that the capture integration will use. **Paperclip version or commit:** `master` at def4726bea0. **Deployment mode:** any. **Agent adapter(s) involved:** not adapter-specific (core). ## What Changed **New table `execution_workspace_restore_points`** (migration `0372`, schema `packages/db/src/schema/execution_workspace_restore_points.ts`): - **Columns:** storage key, sha256, size, generation, source issue, `status`, closing time, review/deletion time (`delete_after`), a `review_generation` counter and last error. - **Statuses:** `pending`, `active`, `expiring`, `superseded`, `delete_requested`, `deleted`. - **No foreign keys:** a row outlives the deletion of its workspace, issue or company long enough to remove the stored object. - **Indexes:** - the storage key is unique; - live generations are unique per workspace; - an index on status and deadline serves the worker, and a partial index on active rows' source issue serves the trigger. **Issue tree trigger** (same migration): `paperclip_restore_point_tree_changed` runs after an issue's `status` or `parent_id` changes, and after an issue is deleted. It walks up from the issue and from its old and new parents (at most 64 levels). For every active restore point whose source issue is in that set, it makes the row due now (keeping an earlier due time) and increments `review_generation`. This happens in the same transaction, so a child's deletion or move still reaches its former parent's tree. **New `server/src/services/git-restore-point-ledger.ts`:** - **`gitRestorePointRetentionService(db, { storage, retentionDays, beforeExpire })`.** Each `tick` handles only due work, in batches of 50: - **Review:** an active restore point is checked when its `delete_after` time arrives. The due check compares against the later of the worker's clock and the database clock, so a row the trigger just marked is never skipped. At review: - **Tree still open:** clear `delete_after`. The trigger marks it due again on the next relevant issue change, so open trees cause no recurring checks. - **Tree `done` or `cancelled`:** expire `PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS` (default `90`, minimum `1`) after the tree's latest close. Expiry moves the row to `expiring`, then runs an optional `beforeExpire` hook, which the capture integration will use to mark the workspace no longer restorable. Only then does it request deletion. An `expiring` row's object is never deleted: after a restart, or if the hook fails, the hook is retried (after 15 minutes when it failed). - **Source issue gone:** delete. - **Concurrency:** a review result is written only if `review_generation` is unchanged since the worker read the row. If the trigger fired in between (for example, the tree closed or reopened), the write is skipped and the row stays due for the next run. Expiry and orphan deletion claim the row under the same check before the expiry hook runs. - **Abandoned captures:** a `pending` row older than one hour is deleted. - **Deletion:** `superseded` and `delete_requested` rows have their object removed. They become `deleted` only once `headObject` reports the object gone. Failures, including a local unlink error the provider swallows, are recorded in `last_error` and retried after 15 minutes. - **`nextDeadlineAt`** returns the earliest real deadline, or `null` when nothing is due. - **`requestRestorePointDeletion(tx, { sourceIssueId } | { companyId })`** registers a delivery-work notification and marks the matching `pending`/`active` rows `delete_requested` in the caller's transaction. **Deletion hooks:** - `issueService.remove` and `deleteCompany` call `requestRestorePointDeletion` in their transactions, so a deleted issue's or company's objects are removed promptly. - Child issues cannot be deleted with their parent (the parent link restricts deletion), so each issue removal goes through this hook. **Scheduling** follows `rules/sleep-aware-background-work.mdc`: - `registerGitRestorePointWork` registers a `git-restore-points` queue with the shared delivery-work coordinator. - The worker keeps no in-memory inputs. Due work is recorded in the table, by the trigger or by deletion requests. Each run handles it and schedules only `nextDeadlineAt`, so a failed run loses nothing and is retried by the coordinator. - It runs at startup, at real deadlines, and when terminal-workspace notifications settle after issue changes, but only while restore points exist. With nothing due, it schedules nothing. A full batch continues immediately. There is no timer. **Config and docs:** - `server/src/config.ts` adds `PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS`. - `doc/recoverable-disk-cleanup.md` gains a "Git workspace restore points" section; `doc/DEVELOPING.md` documents the variable. - `drizzle-kit generate` pruned `meta/0367_snapshot.json`, following the repository's snapshot-retention convention. - No code comments were added. ## Verification - `pnpm exec vitest run src/__tests__/git-restore-point-ledger.test.ts` (in `server/`): 26 passed against embedded Postgres, stable across repeated runs. The cases: - **Review outcomes:** an open tree clears its deadline and schedules nothing; a closed tree is scheduled 90 days after its close; a long-closed tree expires and is deleted; a missing source issue is deleted. - **Expiry durability:** a failing hook keeps the row `expiring` with its object until a retry succeeds; an `expiring` row left by a restart resumes the hook before deletion; an `expiring` row's object is never deleted while its hook fails. - **Trigger:** the last open child closing, a child being deleted, a child moving to another parent, and the source issue's own status change all mark the restore point due. Unrelated issues, inactive rows and already-due rows are untouched. End to end, an open tree's restore point waits without a deadline, then is scheduled 90 days after its tree closes. - **Races:** closing the tree, or reopening it, between the worker's read and write leaves the row due, and the next run resolves it correctly. A reopened tree's restore point is not deleted. - **No rescanning:** 60 retained restore points with future review times are not evaluated. A backlog of 60 due ones is processed as 50, then 10, then nothing. - **Captures and deletion:** abandoned pending rows are deleted while recent ones are kept; superseded rows are deleted; an object still present after deletion is not marked deleted; a failed deletion is retried only after its 15-minute deadline. - **Deadlines:** the next deadline is correct for each obligation, and `null` when idle. - **Deletion hooks:** `issueService.remove` marks only that issue's restore points, and `deleteCompany` marks all of the company's; the worker then deletes their objects. - **Worker:** schedules nothing when idle, and only the next deadline otherwise; wakes on issue changes only while restore points exist. - **Mutation checks:** each of these fails at least one case: - removing the issue hook or the company hook; - making the trigger ignore former parents; - removing the worker's generation check or the trigger's generation bump; - letting storage cleanup delete `expiring` rows, or not resuming the hook; - ignoring open trees; - removing the deletion verification; - evaluating rows that are not due; - dropping the retry deadline. - `pnpm exec vitest run company-deletion issue-delete issues-service delivery-work issue-tree` (in `server/`): 190 passed. - **CI note:** one earlier `Typecheck + Release Registry` run was cancelled when the GitHub runner received a shutdown signal; it is not a code failure. - `pnpm exec vitest run` (in `packages/db`): 211 passed. One run had a single failure in `issue-comment-derived-attribution-migration.test.ts`, an older migration's test unrelated to this change. It passed alone and on the full re-run. - `pnpm exec vitest run src/__tests__/git-restore-point-ledger-config.test.ts`: 5 passed. - `pnpm run check:migrations` (in `packages/db`): numbering and safety checks pass. - `pnpm run typecheck` (in `server/`): pass. ## Risks - **No behavior change today:** nothing creates restore points yet. The worker runs once at startup, finds no rows and schedules nothing. The capture integration follows in a separate PR. - **Trigger cost:** every issue status change, parent change or deletion now runs a short ancestor walk, plus an `UPDATE` on the new table that matches only active restore points through a partial index. With no restore points, the `UPDATE` matches nothing. - **Missed wakes:** if a wake is ever missed, for example because the process exits after commit, the due row stays in the table. The worker's startup run or next deadline processes it. - **Deletion paths:** issue and company deletion each gain one `UPDATE` on the new table inside their existing transactions. - **Migration:** `0372_mature_the_initiative.sql` creates one empty table, its indexes, and the trigger function with two triggers on `issues`; nothing is rewritten. - **Rollback:** revert. The table can stay, since nothing else reads it. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), 1M context, through Claude Code with tool use (shell, file edits, tests, read-only measurements on live instances). ## 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 - [ ] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip --- doc/DEVELOPING.md | 4 + doc/recoverable-disk-cleanup.md | 39 + .../migrations/0372_mature_the_initiative.sql | 59 + ...{0367_snapshot.json => 0372_snapshot.json} | 9972 +++++++++-------- packages/db/src/migrations/meta/_journal.json | 7 + .../execution_workspace_restore_points.ts | 46 + packages/db/src/schema/index.ts | 5 + .../git-restore-point-ledger-config.test.ts | 25 + .../git-restore-point-ledger.test.ts | 381 + server/src/config.ts | 3 + server/src/index.ts | 13 + server/src/services/company-deletion.ts | 2 + .../services/delivery-work-notifications.ts | 1 + .../src/services/git-restore-point-ledger.ts | 238 + server/src/services/issues.ts | 2 + 15 files changed, 6096 insertions(+), 4701 deletions(-) create mode 100644 packages/db/src/migrations/0372_mature_the_initiative.sql rename packages/db/src/migrations/meta/{0367_snapshot.json => 0372_snapshot.json} (92%) create mode 100644 packages/db/src/schema/execution_workspace_restore_points.ts create mode 100644 server/src/__tests__/git-restore-point-ledger-config.test.ts create mode 100644 server/src/__tests__/git-restore-point-ledger.test.ts create mode 100644 server/src/services/git-restore-point-ledger.ts diff --git a/doc/DEVELOPING.md b/doc/DEVELOPING.md index 1c7085ffe52..bffc9f3e053 100644 --- a/doc/DEVELOPING.md +++ b/doc/DEVELOPING.md @@ -2580,6 +2580,10 @@ Environment overrides: negative, empty, or non-numeric value falls back to the default. `PAPERCLIP_NATIVE_HARNESS_BACKUP_EXPIRATION_ENABLED=false` turns expiry off, and `PAPERCLIP_NATIVE_HARNESS_BACKUP_EXPIRATION_DRY_RUN=true` only reports candidates. +- `PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS=` sets how long a git workspace + restore point is kept after its issue tree closes (see + `doc/recoverable-disk-cleanup.md`). The default is `90` and the minimum is `1`. A + negative, empty, or non-numeric value falls back to the default. Without `PAPERCLIP_DB_BACKUP_ALERT_FILE`, health checks look for `db-backup-to-s3.failure` in the backup directory, beside the backup directory, diff --git a/doc/recoverable-disk-cleanup.md b/doc/recoverable-disk-cleanup.md index e6e450bd37d..915c404e83c 100644 --- a/doc/recoverable-disk-cleanup.md +++ b/doc/recoverable-disk-cleanup.md @@ -92,3 +92,42 @@ The rest of the session directory, including its control-plane state, is kept. Each batch that finds candidates logs them with candidate and reclaimed allocated bytes, cleared task sessions, and skip reasons. + +## Git workspace restore points + +Restore points are encrypted saves of the parts of a git worktree that its remote +cannot reproduce: unpushed commits and uncommitted files. They let a closed issue's +worktree be removed and restored later. The table `execution_workspace_restore_points` +tracks each one with its storage key, hash, size and status +(`pending`, `active`, `expiring`, `superseded`, `delete_requested`, `deleted`). The objects live in +the instance's configured file storage (`local_disk` or `s3`). + +An active restore point's `delete_after` is either its expiry time or empty while its +source issue tree is open. A database trigger on `issues` keeps this current: when an +issue's status or parent changes, or an issue is deleted, it marks every active restore +point whose source issue is that issue, its old or new parent, or any of their ancestors +as due now, in the same transaction. A retention worker on the shared delivery-work +scheduler runs at startup, when issue changes settle while restore points exist, and at +real deadlines: the earliest expiry, the end of an abandoned capture's grace period, or +a failed deletion's retry. With nothing due, it schedules nothing, and open trees cause +no recurring checks. At review it checks the source issue tree: + +- Tree still open: clear `delete_after` and wait for the next issue change. +- Tree `done` or `cancelled`: expire `PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS` + (default `90`, minimum `1`) after the tree's latest close, immediately if that time + has passed. Expiry first moves the row to `expiring`, runs the expiry hook, and only + then requests deletion. An `expiring` row's object is never deleted; after a restart + or a hook failure the hook is retried, after 15 minutes when it failed. +- Source issue gone: delete. + +Deleting an issue or a company marks its restore points `delete_requested` in the same +transaction and notifies the worker, so their objects are removed promptly. A +`pending` restore point older than one hour was abandoned mid-capture and is deleted. +`superseded` and `delete_requested` restore points have their stored object removed, +then become `deleted` once the storage provider confirms the object is gone. A +storage failure is recorded in `last_error` and retried after 15 minutes. Work is +processed in batches of 50; a full batch continues immediately. + +Rows have no foreign keys, so they outlive a deleted workspace, issue or company long +enough to remove the stored object. Each run that changes anything logs its counts. + diff --git a/packages/db/src/migrations/0372_mature_the_initiative.sql b/packages/db/src/migrations/0372_mature_the_initiative.sql new file mode 100644 index 00000000000..2add5f7a544 --- /dev/null +++ b/packages/db/src/migrations/0372_mature_the_initiative.sql @@ -0,0 +1,59 @@ +CREATE TABLE "execution_workspace_restore_points" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "company_id" uuid NOT NULL, + "execution_workspace_id" uuid NOT NULL, + "source_issue_id" uuid, + "generation" integer NOT NULL, + "object_key" text NOT NULL, + "sha256" text NOT NULL, + "byte_size" bigint NOT NULL, + "status" text DEFAULT 'pending' NOT NULL, + "activated_at" timestamp with time zone, + "tree_closed_at" timestamp with time zone, + "delete_after" timestamp with time zone, + "review_generation" integer DEFAULT 0 NOT NULL, + "deleted_at" timestamp with time zone, + "last_error" text, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE UNIQUE INDEX "execution_workspace_restore_points_object_key_uniq" ON "execution_workspace_restore_points" USING btree ("object_key");--> statement-breakpoint +CREATE UNIQUE INDEX "execution_workspace_restore_points_live_generation_uniq" ON "execution_workspace_restore_points" USING btree ("execution_workspace_id","generation") WHERE "execution_workspace_restore_points"."status" <> 'deleted';--> statement-breakpoint +CREATE INDEX "execution_workspace_restore_points_status_delete_after_idx" ON "execution_workspace_restore_points" USING btree ("status","delete_after");--> statement-breakpoint +CREATE INDEX "execution_workspace_restore_points_company_idx" ON "execution_workspace_restore_points" USING btree ("company_id");--> statement-breakpoint +CREATE INDEX "execution_workspace_restore_points_source_issue_idx" ON "execution_workspace_restore_points" USING btree ("company_id","source_issue_id");--> statement-breakpoint +CREATE INDEX "execution_workspace_restore_points_active_source_idx" ON "execution_workspace_restore_points" USING btree ("source_issue_id") WHERE "execution_workspace_restore_points"."status" = 'active';--> statement-breakpoint +CREATE OR REPLACE FUNCTION paperclip_restore_point_tree_changed() RETURNS trigger +LANGUAGE plpgsql SET search_path = public, pg_temp AS $$ +DECLARE starts uuid[]; +BEGIN + IF TG_OP = 'DELETE' THEN + starts := ARRAY[OLD.parent_id]; + ELSE + starts := ARRAY[NEW.id, OLD.parent_id, NEW.parent_id]; + END IF; + UPDATE execution_workspace_restore_points + SET delete_after = CASE WHEN delete_after IS NULL OR delete_after > now() THEN now() ELSE delete_after END, + review_generation = review_generation + 1, + updated_at = now() + WHERE status = 'active' + AND source_issue_id IN ( + WITH RECURSIVE ancestors(id, parent_id, depth) AS ( + SELECT i.id, i.parent_id, 0 FROM issues i WHERE i.id = ANY(starts) + UNION + SELECT parent.id, parent.parent_id, ancestors.depth + 1 FROM issues parent + JOIN ancestors ON parent.id = ancestors.parent_id WHERE ancestors.depth < 64 + ) + SELECT id FROM ancestors + ); + RETURN NULL; +END; +$$; +--> statement-breakpoint +CREATE TRIGGER paperclip_restore_point_tree_update AFTER UPDATE OF status, parent_id ON issues +FOR EACH ROW WHEN (OLD.status IS DISTINCT FROM NEW.status OR OLD.parent_id IS DISTINCT FROM NEW.parent_id) +EXECUTE FUNCTION paperclip_restore_point_tree_changed(); +--> statement-breakpoint +CREATE TRIGGER paperclip_restore_point_tree_delete AFTER DELETE ON issues +FOR EACH ROW EXECUTE FUNCTION paperclip_restore_point_tree_changed(); diff --git a/packages/db/src/migrations/meta/0367_snapshot.json b/packages/db/src/migrations/meta/0372_snapshot.json similarity index 92% rename from packages/db/src/migrations/meta/0367_snapshot.json rename to packages/db/src/migrations/meta/0372_snapshot.json index 0215d6fd0b9..e1aee913afc 100644 --- a/packages/db/src/migrations/meta/0367_snapshot.json +++ b/packages/db/src/migrations/meta/0372_snapshot.json @@ -1,6 +1,6 @@ { - "id": "c0ed7fbb-f880-4c25-887c-913e46ec0edc", - "prevId": "168ac180-15d9-46fc-b516-2962c3e944e2", + "id": "9c1b4cac-52f1-4c6e-89b3-c9a7816016c7", + "prevId": "7caf727e-0913-40b3-b01c-842e9447666f", "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": {}, @@ -758,9 +758,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_adjustments_event_idx": { "name": "cost_adjustments_event_idx", @@ -785,9 +785,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_adjustments_invoice_line_idx": { "name": "cost_adjustments_invoice_line_idx", @@ -806,50 +806,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": {}, @@ -961,24 +961,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": {}, @@ -1088,9 +1088,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "run_usage_receipts_run_latest_idx": { "name": "run_usage_receipts_run_latest_idx", @@ -1115,37 +1115,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": {}, @@ -1257,9 +1257,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_company_agent_created_idx": { "name": "activity_log_company_agent_created_idx", @@ -1284,9 +1284,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", @@ -1311,9 +1311,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_run_id_idx": { "name": "activity_log_run_id_idx", @@ -1326,9 +1326,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "activity_log_entity_type_id_idx": { "name": "activity_log_entity_type_id_idx", @@ -1347,50 +1347,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "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": {}, @@ -1546,9 +1546,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", @@ -1573,10 +1573,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", @@ -1589,9 +1589,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_environment_idx": { "name": "adapter_auth_sessions_environment_idx", @@ -1604,9 +1604,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_expires_idx": { "name": "adapter_auth_sessions_expires_idx", @@ -1619,9 +1619,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "adapter_auth_sessions_provider_lease_idx": { "name": "adapter_auth_sessions_provider_lease_idx", @@ -1634,37 +1634,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": {}, @@ -1752,9 +1752,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_api_keys_company_agent_idx": { "name": "agent_api_keys_company_agent_idx", @@ -1773,37 +1773,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": {}, @@ -1903,9 +1903,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_commentary_company_kind_created_idx": { "name": "agent_commentary_company_kind_created_idx", @@ -1930,63 +1930,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": {}, @@ -2099,9 +2099,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_config_revisions_agent_created_idx": { "name": "agent_config_revisions_agent_created_idx", @@ -2120,50 +2120,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": {}, @@ -2225,17 +2225,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": {}, @@ -2290,33 +2290,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": {}, @@ -2462,39 +2462,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": {}, @@ -2654,9 +2654,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_instruction_copies_agent_idx": { "name": "agent_instruction_copies_agent_idx", @@ -2681,39 +2681,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": {}, @@ -2797,9 +2797,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_memberships_company_user_starred_idx": { "name": "agent_memberships_company_user_starred_idx", @@ -2824,9 +2824,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_memberships_agent_idx": { "name": "agent_memberships_agent_idx", @@ -2839,9 +2839,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_memberships_company_user_agent_uq": { "name": "agent_memberships_company_user_agent_uq", @@ -2866,37 +2866,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": {}, @@ -3019,9 +3019,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_runtime_state_company_updated_idx": { "name": "agent_runtime_state_company_updated_idx", @@ -3040,37 +3040,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": {}, @@ -3184,9 +3184,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", @@ -3211,9 +3211,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", @@ -3232,37 +3232,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": {}, @@ -3424,9 +3424,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", @@ -3451,9 +3451,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", @@ -3478,50 +3478,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": {}, @@ -3656,6 +3656,28 @@ } }, "indexes": { + "agent_wakeup_requests_task_retry_idempotency_uq": { + "name": "agent_wakeup_requests_task_retry_idempotency_uq", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "idempotency_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"agent_wakeup_requests\".\"idempotency_key\" LIKE 'task-retry:%'", + "concurrently": false, + "method": "btree", + "with": {} + }, "agent_wakeup_requests_company_agent_status_idx": { "name": "agent_wakeup_requests_company_agent_status_idx", "columns": [ @@ -3679,9 +3701,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_wakeup_requests_company_requested_idx": { "name": "agent_wakeup_requests_company_requested_idx", @@ -3700,9 +3722,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agent_wakeup_requests_agent_requested_idx": { "name": "agent_wakeup_requests_agent_requested_idx", @@ -3721,9 +3743,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", @@ -3742,10 +3764,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", @@ -3764,10 +3786,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", @@ -3786,10 +3808,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", @@ -3808,10 +3830,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", @@ -3830,10 +3852,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", @@ -3852,10 +3874,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_chat_completion_uq": { "name": "agent_wakeup_requests_chat_completion_uq", @@ -3874,10 +3896,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", @@ -3890,43 +3912,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": {}, @@ -4170,9 +4192,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agents_company_status_idx": { "name": "agents_company_status_idx", @@ -4191,9 +4213,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agents_company_reports_to_idx": { "name": "agents_company_reports_to_idx", @@ -4212,9 +4234,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "agents_company_default_environment_idx": { "name": "agents_company_default_environment_idx", @@ -4233,61 +4255,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": {}, @@ -4373,39 +4395,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": {}, @@ -4478,54 +4500,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": {}, @@ -4567,43 +4589,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": {}, @@ -4697,80 +4719,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": {}, @@ -4846,39 +4868,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": {}, @@ -4952,9 +4974,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscription_connections_credential_idx": { "name": "ai_subscription_connections_credential_idx", @@ -4973,9 +4995,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscription_connections_account_idx": { "name": "ai_subscription_connections_account_idx", @@ -4994,63 +5016,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": {}, @@ -5159,9 +5181,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscription_prices_company_idx": { "name": "ai_subscription_prices_company_idx", @@ -5174,37 +5196,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": {}, @@ -5343,9 +5365,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "ai_subscriptions_company_idx": { "name": "ai_subscriptions_company_idx", @@ -5358,37 +5380,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": {}, @@ -5529,9 +5551,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "approval_comments_approval_idx": { "name": "approval_comments_approval_idx", @@ -5544,9 +5566,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "approval_comments_approval_created_idx": { "name": "approval_comments_approval_created_idx", @@ -5565,50 +5587,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": {}, @@ -5722,37 +5744,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": {}, @@ -5859,9 +5881,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "assets_company_provider_idx": { "name": "assets_company_provider_idx", @@ -5880,9 +5902,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "assets_company_object_key_uq": { "name": "assets_company_object_key_uq", @@ -5901,37 +5923,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": {}, @@ -6047,24 +6069,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": {}, @@ -6131,15 +6153,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": {}, @@ -6320,9 +6342,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "board_api_keys_user_idx": { "name": "board_api_keys_user_idx", @@ -6335,24 +6357,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": {}, @@ -6423,9 +6445,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_browsers_session_idx": { "name": "browser_use_browsers_session_idx", @@ -6438,37 +6460,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": {}, @@ -6590,9 +6612,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_runs_provider_uq": { "name": "browser_use_runs_provider_uq", @@ -6605,9 +6627,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_runs_session_idx": { "name": "browser_use_runs_session_idx", @@ -6620,50 +6642,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": {}, @@ -6796,9 +6818,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "browser_use_sessions_provider_uq": { "name": "browser_use_sessions_provider_uq", @@ -6811,76 +6833,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": {}, @@ -6924,28 +6946,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": {}, @@ -7083,9 +7105,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_incidents_company_scope_idx": { "name": "budget_incidents_company_scope_idx", @@ -7116,9 +7138,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_incidents_policy_window_threshold_idx": { "name": "budget_incidents_policy_window_threshold_idx", @@ -7143,51 +7165,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": {}, @@ -7358,9 +7380,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "budget_policies_company_window_idx": { "name": "budget_policies_company_window_idx", @@ -7385,9 +7407,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", @@ -7424,24 +7446,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": {}, @@ -7542,9 +7564,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "built_in_managed_resources_resource_idx": { "name": "built_in_managed_resources_resource_idx", @@ -7563,9 +7585,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", @@ -7596,24 +7618,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": {}, @@ -7689,9 +7711,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_access_sources_company_case_idx": { "name": "case_access_sources_company_case_idx", @@ -7710,37 +7732,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": {}, @@ -7816,9 +7838,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_attachments_asset_uq": { "name": "case_attachments_asset_uq", @@ -7831,50 +7853,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": {}, @@ -7957,9 +7979,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_documents_document_uq": { "name": "case_documents_document_uq", @@ -7972,9 +7994,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_documents_company_case_updated_idx": { "name": "case_documents_company_case_updated_idx", @@ -7999,50 +8021,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": {}, @@ -8144,9 +8166,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_events_company_case_idx": { "name": "case_events_company_case_idx", @@ -8165,50 +8187,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": {}, @@ -8230,6 +8252,24 @@ "name": "case_handoffs", "schema": "", "columns": { + "workflow_transition": { + "name": "workflow_transition", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "workflow_prompt": { + "name": "workflow_prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "base_workflow_document_revision_id": { + "name": "base_workflow_document_revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, "id": { "name": "id", "type": "uuid", @@ -8459,9 +8499,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_handoffs_actor_idempotency_uq": { "name": "case_handoffs_actor_idempotency_uq", @@ -8492,9 +8532,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_handoffs_pending_case_uq": { "name": "case_handoffs_pending_case_uq", @@ -8507,10 +8547,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", @@ -8523,10 +8563,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", @@ -8539,10 +8579,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", @@ -8561,9 +8601,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_handoffs_source_run_idx": { "name": "case_handoffs_source_run_idx", @@ -8582,10 +8622,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", @@ -8598,76 +8638,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": {}, @@ -8767,9 +8807,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_issue_links_company_case_idx": { "name": "case_issue_links_company_case_idx", @@ -8788,9 +8828,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_issue_links_issue_idx": { "name": "case_issue_links_issue_idx", @@ -8803,50 +8843,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": {}, @@ -8922,9 +8962,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_labels_company_case_idx": { "name": "case_labels_company_case_idx", @@ -8943,9 +8983,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "case_labels_label_idx": { "name": "case_labels_label_idx", @@ -8958,50 +8998,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": {}, @@ -9045,6 +9085,12 @@ "primaryKey": false, "notNull": false }, + "workflow_id": { + "name": "workflow_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, "handoff_version": { "name": "handoff_version", "type": "integer", @@ -9159,9 +9205,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_identifier_uq": { "name": "cases_identifier_uq", @@ -9174,9 +9220,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_work_issue_uq": { "name": "cases_work_issue_uq", @@ -9189,10 +9235,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", @@ -9217,9 +9263,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_company_status_idx": { "name": "cases_company_status_idx", @@ -9238,9 +9284,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_company_type_idx": { "name": "cases_company_type_idx", @@ -9259,9 +9305,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_company_project_idx": { "name": "cases_company_project_idx", @@ -9280,9 +9326,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_parent_idx": { "name": "cases_parent_idx", @@ -9295,9 +9341,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cases_title_search_idx": { "name": "cases_title_search_idx", @@ -9311,9 +9357,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "cases_identifier_search_idx": { "name": "cases_identifier_search_idx", @@ -9327,9 +9373,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "cases_summary_search_idx": { "name": "cases_summary_search_idx", @@ -9343,76 +9389,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" + ], + "columnsTo": [ + "id" + ], + "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": {}, @@ -9532,97 +9591,97 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "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": {}, @@ -9720,54 +9779,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": {}, @@ -9907,9 +9966,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_conversations_thread_uq": { "name": "chat_conversations_thread_uq", @@ -9940,106 +9999,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": {}, @@ -10182,9 +10241,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_deliveries_event_uq": { "name": "chat_deliveries_event_uq", @@ -10203,9 +10262,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_deliveries_dedupe_uq": { "name": "chat_deliveries_dedupe_uq", @@ -10224,106 +10283,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": {}, @@ -10409,9 +10468,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoint_leases_expiry_idx": { "name": "chat_endpoint_leases_expiry_idx", @@ -10424,39 +10483,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": {}, @@ -10584,9 +10643,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoint_resources_external_uq": { "name": "chat_endpoint_resources_external_uq", @@ -10611,50 +10670,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": {}, @@ -10902,9 +10961,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_agent_idx": { "name": "chat_endpoints_agent_idx", @@ -10923,9 +10982,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_status_idx": { "name": "chat_endpoints_status_idx", @@ -10944,9 +11003,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_public_id_uq": { "name": "chat_endpoints_public_id_uq", @@ -10959,9 +11018,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_agentmail_inbox_uq": { "name": "chat_endpoints_agentmail_inbox_uq", @@ -10974,10 +11033,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", @@ -10990,9 +11049,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_endpoints_live_bot_external_uq": { "name": "chat_endpoints_live_bot_external_uq", @@ -11017,10 +11076,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", @@ -11033,10 +11092,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", @@ -11055,10 +11114,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", @@ -11077,10 +11136,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", @@ -11105,79 +11164,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": {}, @@ -11313,9 +11372,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_external_principals_external_uq": { "name": "chat_external_principals_external_uq", @@ -11346,35 +11405,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": {}, @@ -11489,9 +11548,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_identity_links_endpoint_principal_uq": { "name": "chat_identity_links_endpoint_principal_uq", @@ -11510,54 +11569,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": {}, @@ -11662,138 +11721,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": {}, @@ -11937,9 +11996,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_publications_work_idx": { "name": "chat_publications_work_idx", @@ -11958,9 +12017,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_publications_idempotency_uq": { "name": "chat_publications_idempotency_uq", @@ -11979,110 +12038,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": {}, @@ -12177,9 +12236,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_sdk_state_expiry_idx": { "name": "chat_sdk_state_expiry_idx", @@ -12192,39 +12251,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": {}, @@ -12327,9 +12386,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_completion_deliveries_pending_idx": { "name": "chat_completion_deliveries_pending_idx", @@ -12348,63 +12407,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": {}, @@ -12473,63 +12532,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": {}, @@ -12642,17 +12701,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": {}, @@ -12771,9 +12830,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_github_registration_endpoint_idx": { "name": "chat_github_registration_endpoint_idx", @@ -12792,26 +12851,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": {}, @@ -12991,9 +13050,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_github_reviews_pull_idx": { "name": "chat_github_reviews_pull_idx", @@ -13024,9 +13083,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_github_reviews_task_idx": { "name": "chat_github_reviews_task_idx", @@ -13051,65 +13110,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": {}, @@ -13244,9 +13303,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_slack_manager_grants_owner_idx": { "name": "chat_slack_manager_grants_owner_idx", @@ -13277,24 +13336,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": {}, @@ -13423,32 +13482,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": {}, @@ -13712,9 +13771,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_teams_file_transfers_token_uq": { "name": "chat_teams_file_transfers_token_uq", @@ -13733,9 +13792,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_teams_file_transfers_work_idx": { "name": "chat_teams_file_transfers_work_idx", @@ -13760,97 +13819,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": {}, @@ -13950,26 +14009,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": {}, @@ -14118,81 +14177,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": {}, @@ -14277,40 +14336,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": {}, @@ -14410,26 +14469,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": {}, @@ -14528,9 +14587,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_replies_cursor_uq": { "name": "chat_voice_replies_cursor_uq", @@ -14549,54 +14608,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": {}, @@ -14774,9 +14833,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_sessions_request_uq": { "name": "chat_voice_sessions_request_uq", @@ -14801,9 +14860,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", @@ -14828,10 +14887,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", @@ -14850,95 +14909,95 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "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": {}, @@ -15055,9 +15114,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "chat_voice_tool_calls_webhook_uq": { "name": "chat_voice_tool_calls_webhook_uq", @@ -15076,54 +15135,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": {}, @@ -15248,9 +15307,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cli_auth_challenges_approved_by_idx": { "name": "cli_auth_challenges_approved_by_idx", @@ -15263,9 +15322,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cli_auth_challenges_requested_company_idx": { "name": "cli_auth_challenges_requested_company_idx", @@ -15278,50 +15337,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": {}, @@ -15478,9 +15537,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -15540,9 +15599,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_logos_asset_uq": { "name": "company_logos_asset_uq", @@ -15555,37 +15614,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": {}, @@ -15675,9 +15734,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_memberships_principal_status_idx": { "name": "company_memberships_principal_status_idx", @@ -15702,9 +15761,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_memberships_company_status_idx": { "name": "company_memberships_company_status_idx", @@ -15723,24 +15782,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": {}, @@ -15823,28 +15882,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": {}, @@ -15958,63 +16017,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": {}, @@ -16124,9 +16183,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_bindings_secret_idx": { "name": "company_secret_bindings_secret_idx", @@ -16139,9 +16198,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_bindings_target_idx": { "name": "company_secret_bindings_target_idx", @@ -16166,9 +16225,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_bindings_target_path_uq": { "name": "company_secret_bindings_target_path_uq", @@ -16199,37 +16258,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": {}, @@ -16464,9 +16523,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_proposer_status_idx": { "name": "company_secret_proposals_proposer_status_idx", @@ -16485,9 +16544,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_expiry_idx": { "name": "company_secret_proposals_expiry_idx", @@ -16506,9 +16565,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_secret_proposal_idx": { "name": "company_secret_proposals_secret_proposal_idx", @@ -16521,9 +16580,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_proposals_interaction_idx": { "name": "company_secret_proposals_interaction_idx", @@ -16536,128 +16595,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": {}, @@ -16802,9 +16861,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", @@ -16823,9 +16882,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_provider_configs_default_uq": { "name": "company_secret_provider_configs_default_uq", @@ -16844,38 +16903,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": {}, @@ -16988,9 +17047,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_versions_value_sha256_idx": { "name": "company_secret_versions_value_sha256_idx", @@ -17003,9 +17062,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_versions_fingerprint_idx": { "name": "company_secret_versions_fingerprint_idx", @@ -17018,9 +17077,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secret_versions_secret_version_uq": { "name": "company_secret_versions_secret_version_uq", @@ -17039,37 +17098,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": {}, @@ -17114,6 +17173,12 @@ "primaryKey": false, "notNull": false }, + "owner_project_id": { + "name": "owner_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, "owner_plugin_id": { "name": "owner_plugin_id", "type": "uuid", @@ -17254,9 +17319,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_scope_idx": { "name": "company_secrets_company_scope_idx", @@ -17275,9 +17340,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_owner_idx": { "name": "company_secrets_company_owner_idx", @@ -17296,9 +17361,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_user_definition_owner_idx": { "name": "company_secrets_user_definition_owner_idx", @@ -17323,9 +17388,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_provider_idx": { "name": "company_secrets_company_provider_idx", @@ -17344,9 +17409,43 @@ } ], "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", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "owner_project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "owner_plugin_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"company_secrets\".\"scope\" = 'instance' and \"company_secrets\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} }, "company_secrets_instance_owner_key_uq": { "name": "company_secrets_instance_owner_key_uq", @@ -17377,10 +17476,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", @@ -17393,9 +17492,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_secrets_company_name_uq": { "name": "company_secrets_company_name_uq", @@ -17414,10 +17513,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", @@ -17436,10 +17535,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", @@ -17464,92 +17563,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" + ], + "columnsTo": [ + "company_id", + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -17558,7 +17672,7 @@ "checkConstraints": { "company_secrets_scope_shape_check": { "name": "company_secrets_scope_shape_check", - "value": "(\n \"company_secrets\".\"scope\" = 'company'\n and \"company_secrets\".\"owner_user_id\" is null\n and \"company_secrets\".\"user_secret_definition_id\" is null\n and \"company_secrets\".\"owner_agent_id\" is null and \"company_secrets\".\"owner_plugin_id\" is null\n ) or (\n \"company_secrets\".\"scope\" = 'user'\n and \"company_secrets\".\"owner_user_id\" is not null\n and \"company_secrets\".\"user_secret_definition_id\" is not null\n and \"company_secrets\".\"owner_agent_id\" is null and \"company_secrets\".\"owner_plugin_id\" is null\n ) or (\n \"company_secrets\".\"scope\" = 'instance'\n and \"company_secrets\".\"owner_user_id\" is null and \"company_secrets\".\"user_secret_definition_id\" is null\n and \"company_secrets\".\"owner_agent_id\" is not null and \"company_secrets\".\"owner_plugin_id\" is not null\n )" + "value": "(\n \"company_secrets\".\"scope\" = 'company'\n and \"company_secrets\".\"owner_user_id\" is null\n and \"company_secrets\".\"user_secret_definition_id\" is null\n and \"company_secrets\".\"owner_agent_id\" is null and \"company_secrets\".\"owner_project_id\" is null and \"company_secrets\".\"owner_plugin_id\" is null\n ) or (\n \"company_secrets\".\"scope\" = 'user'\n and \"company_secrets\".\"owner_user_id\" is not null\n and \"company_secrets\".\"user_secret_definition_id\" is not null\n and \"company_secrets\".\"owner_agent_id\" is null and \"company_secrets\".\"owner_project_id\" is null and \"company_secrets\".\"owner_plugin_id\" is null\n ) or (\n \"company_secrets\".\"scope\" = 'instance'\n and \"company_secrets\".\"owner_user_id\" is null and \"company_secrets\".\"user_secret_definition_id\" is null\n and (\"company_secrets\".\"owner_agent_id\" is not null) <> (\"company_secrets\".\"owner_project_id\" is not null)\n and \"company_secrets\".\"owner_plugin_id\" is not null\n )" } }, "isRLSEnabled": false @@ -17619,15 +17733,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": {}, @@ -17666,15 +17780,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": {}, @@ -17775,9 +17889,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", @@ -17796,50 +17910,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": {}, @@ -18083,10 +18197,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", @@ -18111,25 +18225,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": {}, @@ -18294,9 +18408,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_skill_sources_source_project_idx": { "name": "project_skill_sources_source_project_idx", @@ -18321,9 +18435,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_skill_sources_sync_idx": { "name": "project_skill_sources_sync_idx", @@ -18348,63 +18462,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": {}, @@ -18505,9 +18619,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_comments_parent_idx": { "name": "company_skill_comments_parent_idx", @@ -18520,63 +18634,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": {}, @@ -18640,24 +18754,24 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "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": {}, @@ -18727,9 +18841,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_stars_skill_user_idx": { "name": "company_skill_stars_skill_user_idx", @@ -18748,9 +18862,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", @@ -18775,50 +18889,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": {}, @@ -18913,9 +19027,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", @@ -18940,37 +19054,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": {}, @@ -19083,50 +19197,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": {}, @@ -19316,9 +19430,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", @@ -19337,9 +19451,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", @@ -19364,9 +19478,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", @@ -19385,9 +19499,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", @@ -19406,89 +19520,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": {}, @@ -19607,9 +19721,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skill_versions_skill_release_idx": { "name": "company_skill_versions_skill_release_idx", @@ -19628,10 +19742,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", @@ -19656,63 +19770,63 @@ } ], "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_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": {}, @@ -19948,9 +20062,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_name_idx": { "name": "company_skills_company_name_idx", @@ -19969,9 +20083,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_folder_idx": { "name": "company_skills_company_folder_idx", @@ -19990,9 +20104,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_categories_idx": { "name": "company_skills_company_categories_idx", @@ -20005,9 +20119,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "company_skills_company_sharing_scope_idx": { "name": "company_skills_company_sharing_scope_idx", @@ -20026,9 +20140,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_current_version_idx": { "name": "company_skills_company_current_version_idx", @@ -20047,9 +20161,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_skills_company_forked_from_idx": { "name": "company_skills_company_forked_from_idx", @@ -20068,76 +20182,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": {}, @@ -20272,9 +20386,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_transfer_runs_idempotency_direction_idx": { "name": "company_transfer_runs_idempotency_direction_idx", @@ -20293,9 +20407,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_transfer_runs_actor_status_idx": { "name": "company_transfer_runs_actor_status_idx", @@ -20314,24 +20428,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": {}, @@ -20397,9 +20511,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "company_user_sidebar_preferences_user_idx": { "name": "company_user_sidebar_preferences_user_idx", @@ -20412,9 +20526,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", @@ -20433,24 +20547,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": {}, @@ -20574,9 +20688,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "completion_contracts_issue_hash_uq": { "name": "completion_contracts_issue_hash_uq", @@ -20595,68 +20709,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": {}, @@ -20794,9 +20908,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_event_deliveries_company_status_idx": { "name": "connection_event_deliveries_company_status_idx", @@ -20821,24 +20935,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": {}, @@ -20902,37 +21016,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": {}, @@ -21135,9 +21249,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_provider_request_idx": { "name": "cost_events_provider_request_idx", @@ -21162,9 +21276,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_project_occurred_idx": { "name": "cost_events_company_project_occurred_idx", @@ -21189,9 +21303,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_unpriced_idx": { "name": "cost_events_unpriced_idx", @@ -21216,10 +21330,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", @@ -21244,10 +21358,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", @@ -21266,9 +21380,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_subscription_occurred_idx": { "name": "cost_events_company_subscription_occurred_idx", @@ -21293,9 +21407,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_agent_occurred_idx": { "name": "cost_events_company_agent_occurred_idx", @@ -21320,9 +21434,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_provider_occurred_idx": { "name": "cost_events_company_provider_occurred_idx", @@ -21347,9 +21461,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_biller_occurred_idx": { "name": "cost_events_company_biller_occurred_idx", @@ -21374,9 +21488,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "cost_events_company_heartbeat_run_idx": { "name": "cost_events_company_heartbeat_run_idx", @@ -21395,102 +21509,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": {}, @@ -21569,15 +21683,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": {}, @@ -21773,9 +21887,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_invocations_pending_idx": { "name": "decision_invocations_pending_idx", @@ -21788,10 +21902,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", @@ -21804,37 +21918,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": {}, @@ -21972,9 +22086,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_archive_notification_outbox_pending_idx": { "name": "decision_archive_notification_outbox_pending_idx", @@ -21993,37 +22107,37 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "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": {}, @@ -22140,9 +22254,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_queue_items_company_source_idx": { "name": "decision_queue_items_company_source_idx", @@ -22167,78 +22281,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": {}, @@ -22370,9 +22484,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_queues_company_updated_idx": { "name": "decision_queues_company_updated_idx", @@ -22391,74 +22505,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": {}, @@ -22605,9 +22719,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_retention_company_archived_idx": { "name": "decision_retention_company_archived_idx", @@ -22626,50 +22740,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": {}, @@ -22812,9 +22926,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_triage_company_decide_by_idx": { "name": "decision_triage_company_decide_by_idx", @@ -22833,63 +22947,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": {}, @@ -23029,9 +23143,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_triage_events_queue_created_idx": { "name": "decision_triage_events_queue_created_idx", @@ -23050,76 +23164,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": {}, @@ -23246,9 +23360,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_training_examples_issue_idx": { "name": "decision_training_examples_issue_idx", @@ -23261,9 +23375,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_training_examples_source_author_uq": { "name": "decision_training_examples_source_author_uq", @@ -23288,37 +23402,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": {}, @@ -23400,63 +23514,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": {}, @@ -23550,9 +23664,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_effect_executions_target_issue_idx": { "name": "decision_effect_executions_target_issue_idx", @@ -23565,50 +23679,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": {}, @@ -23652,9 +23766,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decision_target_issues_issue_idx": { "name": "decision_target_issues_issue_idx", @@ -23667,50 +23781,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": { @@ -23912,9 +24026,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decisions_bundle_idx": { "name": "decisions_bundle_idx", @@ -23927,9 +24041,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decisions_origin_issue_idx": { "name": "decisions_origin_issue_idx", @@ -23942,9 +24056,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "decisions_company_idempotency_uq": { "name": "decisions_company_idempotency_uq", @@ -23963,77 +24077,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": {}, @@ -24157,9 +24271,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", @@ -24184,76 +24298,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": {}, @@ -24390,9 +24504,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", @@ -24417,9 +24531,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", @@ -24444,9 +24558,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", @@ -24471,9 +24585,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", @@ -24498,9 +24612,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_issue_comment_idx": { "name": "document_annotation_comments_issue_comment_idx", @@ -24513,9 +24627,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_annotation_comments_body_search_idx": { "name": "document_annotation_comments_body_search_idx", @@ -24529,128 +24643,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": {}, @@ -24875,9 +24989,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", @@ -24902,9 +25016,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", @@ -24929,9 +25043,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", @@ -24956,9 +25070,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", @@ -24989,9 +25103,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", @@ -25010,128 +25124,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": {}, @@ -25219,9 +25333,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_memberships_company_user_document_uq": { "name": "document_memberships_company_user_document_uq", @@ -25246,37 +25360,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": {}, @@ -25383,9 +25497,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "document_revisions_company_document_created_idx": { "name": "document_revisions_company_document_created_idx", @@ -25410,63 +25524,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": {}, @@ -25605,9 +25719,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "documents_company_created_idx": { "name": "documents_company_created_idx", @@ -25626,9 +25740,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "documents_title_search_idx": { "name": "documents_title_search_idx", @@ -25642,9 +25756,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "documents_latest_body_search_idx": { "name": "documents_latest_body_search_idx", @@ -25658,63 +25772,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": {}, @@ -25854,10 +25968,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", @@ -25870,10 +25984,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", @@ -25886,50 +26000,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": {}, @@ -26022,9 +26136,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "dot_mailbox_binding_cursor_idx": { "name": "dot_mailbox_binding_cursor_idx", @@ -26049,50 +26163,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": {}, @@ -26242,9 +26356,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "dot_assignments_active_binding_uq": { "name": "dot_assignments_active_binding_uq", @@ -26257,10 +26371,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", @@ -26273,63 +26387,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": {}, @@ -26443,37 +26557,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": {}, @@ -26540,17 +26654,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": {}, @@ -26663,9 +26777,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "email_messages_conversation_idx": { "name": "email_messages_conversation_idx", @@ -26690,41 +26804,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": {}, @@ -26810,42 +26924,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": {}, @@ -27000,9 +27114,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", @@ -27015,10 +27129,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", @@ -27031,9 +27145,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", @@ -27046,9 +27160,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", @@ -27061,9 +27175,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", @@ -27082,76 +27196,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": {}, @@ -27284,9 +27398,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", @@ -27311,9 +27425,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", @@ -27326,10 +27440,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", @@ -27342,9 +27456,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", @@ -27357,50 +27471,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": {}, @@ -27536,6 +27650,22 @@ } }, "indexes": { + "environment_leases_retained_recovery_adoption_idx": { + "name": "environment_leases_retained_recovery_adoption_idx", + "columns": [ + { + "expression": "heartbeat_run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "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, + "method": "btree", + "with": {} + }, "environment_leases_company_environment_status_idx": { "name": "environment_leases_company_environment_status_idx", "columns": [ @@ -27559,9 +27689,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_company_execution_workspace_idx": { "name": "environment_leases_company_execution_workspace_idx", @@ -27580,9 +27710,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_company_issue_idx": { "name": "environment_leases_company_issue_idx", @@ -27601,9 +27731,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_heartbeat_run_idx": { "name": "environment_leases_heartbeat_run_idx", @@ -27616,9 +27746,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_company_last_used_idx": { "name": "environment_leases_company_last_used_idx", @@ -27637,9 +27767,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environment_leases_provider_lease_idx": { "name": "environment_leases_provider_lease_idx", @@ -27652,76 +27782,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": {}, @@ -27814,9 +27944,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "environments_local_driver_idx": { "name": "environments_local_driver_idx", @@ -27829,10 +27959,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", @@ -27845,10 +27975,10 @@ } ], "isUnique": true, - "with": {}, - "method": "btree", "where": "\"environments\".\"driver\" = 'sandbox' AND (\"environments\".\"metadata\" ->> 'managedByPaperclip')::boolean = true", - "concurrently": false + "concurrently": false, + "method": "btree", + "with": {} }, "environments_name_idx": { "name": "environments_name_idx", @@ -27861,9 +27991,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -28004,9 +28134,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_repositories_path_idx": { "name": "execution_workspace_repositories_path_idx", @@ -28025,9 +28155,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_repositories_request_idx": { "name": "execution_workspace_repositories_request_idx", @@ -28046,9 +28176,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspace_repositories_company_workspace_idx": { "name": "execution_workspace_repositories_company_workspace_idx", @@ -28067,50 +28197,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": {}, @@ -28223,24 +28353,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": {}, @@ -28317,24 +28447,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": {}, @@ -28343,6 +28473,237 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "public.execution_workspace_restore_points": { + "name": "execution_workspace_restore_points", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "company_id": { + "name": "company_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "execution_workspace_id": { + "name": "execution_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "source_issue_id": { + "name": "source_issue_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "generation": { + "name": "generation", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "object_key": { + "name": "object_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "byte_size": { + "name": "byte_size", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "activated_at": { + "name": "activated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "tree_closed_at": { + "name": "tree_closed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "delete_after": { + "name": "delete_after", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "review_generation": { + "name": "review_generation", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "execution_workspace_restore_points_object_key_uniq": { + "name": "execution_workspace_restore_points_object_key_uniq", + "columns": [ + { + "expression": "object_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_workspace_restore_points_live_generation_uniq": { + "name": "execution_workspace_restore_points_live_generation_uniq", + "columns": [ + { + "expression": "execution_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "generation", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"execution_workspace_restore_points\".\"status\" <> 'deleted'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_workspace_restore_points_status_delete_after_idx": { + "name": "execution_workspace_restore_points_status_delete_after_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "delete_after", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_workspace_restore_points_company_idx": { + "name": "execution_workspace_restore_points_company_idx", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_workspace_restore_points_source_issue_idx": { + "name": "execution_workspace_restore_points_source_issue_idx", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_issue_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_workspace_restore_points_active_source_idx": { + "name": "execution_workspace_restore_points_active_source_idx", + "columns": [ + { + "expression": "source_issue_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"execution_workspace_restore_points\".\"status\" = 'active'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "public.execution_workspace_runtime_leases": { "name": "execution_workspace_runtime_leases", "schema": "", @@ -28455,9 +28816,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", @@ -28476,9 +28837,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", @@ -28491,86 +28852,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": {}, @@ -28757,9 +29118,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", @@ -28784,9 +29145,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_source_issue_idx": { "name": "execution_workspaces_company_source_issue_idx", @@ -28805,9 +29166,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_last_used_idx": { "name": "execution_workspaces_company_last_used_idx", @@ -28826,9 +29187,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "execution_workspaces_company_branch_idx": { "name": "execution_workspaces_company_branch_idx", @@ -28847,76 +29208,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": {}, @@ -29066,9 +29427,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_object_mentions_company_object_idx": { "name": "external_object_mentions_company_object_idx", @@ -29087,9 +29448,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_object_mentions_company_provider_idx": { "name": "external_object_mentions_company_provider_idx", @@ -29114,9 +29475,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", @@ -29165,10 +29526,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", @@ -29211,64 +29572,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": {}, @@ -29500,9 +29861,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_provider_status_idx": { "name": "external_objects_company_provider_status_idx", @@ -29527,9 +29888,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_refresh_idx": { "name": "external_objects_company_refresh_idx", @@ -29548,9 +29909,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_external_id_uq": { "name": "external_objects_company_external_id_uq", @@ -29581,9 +29942,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_objects_company_identity_uq": { "name": "external_objects_company_identity_uq", @@ -29614,37 +29975,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": {}, @@ -29714,15 +30075,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": {}, @@ -29944,9 +30305,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "fast_response_requests_history_idx": { "name": "fast_response_requests_history_idx", @@ -29965,9 +30326,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "fast_response_requests_work_idx": { "name": "fast_response_requests_work_idx", @@ -29980,38 +30341,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": {}, @@ -30206,9 +30567,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_created_idx": { "name": "feedback_exports_company_created_idx", @@ -30227,9 +30588,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_status_idx": { "name": "feedback_exports_company_status_idx", @@ -30254,9 +30615,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_issue_idx": { "name": "feedback_exports_company_issue_idx", @@ -30281,9 +30642,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_project_idx": { "name": "feedback_exports_company_project_idx", @@ -30308,9 +30669,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_exports_company_author_idx": { "name": "feedback_exports_company_author_idx", @@ -30335,63 +30696,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": {}, @@ -30511,9 +30872,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_votes_issue_target_idx": { "name": "feedback_votes_issue_target_idx", @@ -30538,9 +30899,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_votes_author_idx": { "name": "feedback_votes_author_idx", @@ -30559,9 +30920,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "feedback_votes_company_target_author_idx": { "name": "feedback_votes_company_target_author_idx", @@ -30592,37 +30953,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": {}, @@ -30833,9 +31194,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_occurred_idx": { "name": "finance_events_company_occurred_idx", @@ -30854,9 +31215,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_biller_occurred_idx": { "name": "finance_events_company_biller_occurred_idx", @@ -30881,9 +31242,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_kind_occurred_idx": { "name": "finance_events_company_kind_occurred_idx", @@ -30908,9 +31269,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_direction_occurred_idx": { "name": "finance_events_company_direction_occurred_idx", @@ -30935,9 +31296,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_heartbeat_run_idx": { "name": "finance_events_company_heartbeat_run_idx", @@ -30956,9 +31317,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "finance_events_company_cost_event_idx": { "name": "finance_events_company_cost_event_idx", @@ -30977,102 +31338,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": {}, @@ -31186,9 +31547,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "folders_company_kind_root_slug_uq": { "name": "folders_company_kind_root_slug_uq", @@ -31213,10 +31574,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", @@ -31247,10 +31608,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", @@ -31275,10 +31636,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", @@ -31315,37 +31676,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": {}, @@ -31436,50 +31797,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": {}, @@ -31641,9 +32002,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "grok_dispatch_company_status_idx": { "name": "grok_dispatch_company_status_idx", @@ -31662,9 +32023,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "grok_dispatch_assignment_kind_idx": { "name": "grok_dispatch_assignment_kind_idx", @@ -31683,76 +32044,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": {}, @@ -31878,9 +32239,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "grok_routines_company_agent_idx": { "name": "grok_routines_company_agent_idx", @@ -31899,76 +32260,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": {}, @@ -32103,9 +32464,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", @@ -32124,10 +32485,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", @@ -32152,10 +32513,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", @@ -32174,9 +32535,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_run_events_company_created_idx": { "name": "heartbeat_run_events_company_created_idx", @@ -32195,50 +32556,50 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "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": {}, @@ -32344,9 +32705,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", @@ -32371,76 +32732,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": {}, @@ -32939,6 +33300,22 @@ } }, "indexes": { + "heartbeat_runs_retained_recovery_adoption_idx": { + "name": "heartbeat_runs_retained_recovery_adoption_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "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, + "method": "btree", + "with": {} + }, "heartbeat_runs_cost_accounting_pending_idx": { "name": "heartbeat_runs_cost_accounting_pending_idx", "columns": [ @@ -32956,10 +33333,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", @@ -32972,8 +33349,8 @@ }, { "expression": "coalesce(\"finished_at\", \"created_at\") desc", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -32984,10 +33361,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", @@ -33000,10 +33377,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", @@ -33016,10 +33393,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", @@ -33038,10 +33415,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", @@ -33066,9 +33443,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_issue_created_idx": { "name": "heartbeat_runs_company_issue_created_idx", @@ -33093,9 +33470,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_responsible_user_idx": { "name": "heartbeat_runs_company_responsible_user_idx", @@ -33120,9 +33497,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "heartbeat_runs_company_liveness_idx": { "name": "heartbeat_runs_company_liveness_idx", @@ -33147,9 +33524,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", @@ -33174,9 +33551,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", @@ -33201,9 +33578,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", @@ -33222,9 +33599,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", @@ -33237,8 +33614,8 @@ }, { "expression": "(\"context_snapshot\" ->> 'issueId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -33249,9 +33626,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", @@ -33264,8 +33641,8 @@ }, { "expression": "(\"context_snapshot\" ->> 'taskId')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -33276,9 +33653,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", @@ -33291,8 +33668,8 @@ }, { "expression": "(\"context_snapshot\" ->> 'taskKey')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -33303,9 +33680,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", @@ -33318,8 +33695,8 @@ }, { "expression": "(\"context_snapshot\" -> 'paperclipIssue' ->> 'id')", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -33330,9 +33707,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": true, "method": "btree", - "concurrently": true + "with": {} }, "heartbeat_runs_company_origin_issue_idx": { "name": "heartbeat_runs_company_origin_issue_idx", @@ -33345,104 +33722,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": {}, @@ -33536,9 +33913,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "inbox_dismissals_company_item_idx": { "name": "inbox_dismissals_company_item_idx", @@ -33557,9 +33934,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "inbox_dismissals_company_user_item_idx": { "name": "inbox_dismissals_company_user_item_idx", @@ -33584,24 +33961,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": {}, @@ -33671,9 +34048,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grant_delegations_grant_agent_uq": { "name": "connection_grant_delegations_grant_agent_uq", @@ -33692,52 +34069,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": {}, @@ -33813,9 +34190,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grant_members_grant_subject_uq": { "name": "connection_grant_members_grant_subject_uq", @@ -33840,39 +34217,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": {}, @@ -34029,9 +34406,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_subject_user_idx": { "name": "connection_grants_subject_user_idx", @@ -34050,9 +34427,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_subject_agent_idx": { "name": "connection_grants_subject_agent_idx", @@ -34071,9 +34448,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_user_uq": { "name": "connection_grants_user_uq", @@ -34092,9 +34469,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_agent_uq": { "name": "connection_grants_agent_uq", @@ -34113,9 +34490,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_grants_default_uq": { "name": "connection_grants_default_uq", @@ -34128,90 +34505,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": {}, @@ -34381,9 +34758,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_token_issuances_connection_created_idx": { "name": "connection_token_issuances_connection_created_idx", @@ -34408,9 +34785,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_token_issuances_agent_connection_idx": { "name": "connection_token_issuances_agent_connection_idx", @@ -34441,9 +34818,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "connection_token_issuances_run_idx": { "name": "connection_token_issuances_run_idx", @@ -34462,102 +34839,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": {}, @@ -34631,24 +35008,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": {}, @@ -34714,9 +35091,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "instance_user_roles_role_idx": { "name": "instance_user_roles_role_idx", @@ -34729,9 +35106,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -34835,9 +35212,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "invites_company_invite_state_idx": { "name": "invites_company_invite_state_idx", @@ -34868,24 +35245,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": {}, @@ -34985,9 +35362,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_access_grants_issue_idx": { "name": "issue_access_grants_issue_idx", @@ -35006,37 +35383,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": {}, @@ -35108,9 +35485,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_approvals_approval_idx": { "name": "issue_approvals_approval_idx", @@ -35123,9 +35500,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_approvals_company_idx": { "name": "issue_approvals_company_idx", @@ -35138,63 +35515,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": { @@ -35285,9 +35662,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_attachments_issue_comment_idx": { "name": "issue_attachments_issue_comment_idx", @@ -35300,9 +35677,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_attachments_originating_run_idx": { "name": "issue_attachments_originating_run_idx", @@ -35315,9 +35692,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_attachments_asset_uq": { "name": "issue_attachments_asset_uq", @@ -35330,76 +35707,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": {}, @@ -35585,9 +35962,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_comments_company_idx": { "name": "issue_comments_company_idx", @@ -35600,9 +35977,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", @@ -35627,9 +36004,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", @@ -35660,9 +36037,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_comments_body_search_idx": { "name": "issue_comments_body_search_idx", @@ -35676,148 +36053,148 @@ } ], "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_company_id_uq": { "name": "issue_comments_company_id_uq", + "nullsNotDistinct": false, "columns": [ "company_id", "id" - ], - "nullsNotDistinct": false + ] } }, "policies": {}, @@ -35879,9 +36256,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_create_idempotency_keys_issue_idx": { "name": "issue_create_idempotency_keys_issue_idx", @@ -35894,9 +36271,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", @@ -35915,37 +36292,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": {}, @@ -36028,9 +36405,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_documents_document_uq": { "name": "issue_documents_document_uq", @@ -36043,9 +36420,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_documents_company_issue_updated_idx": { "name": "issue_documents_company_issue_updated_idx", @@ -36070,50 +36447,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": {}, @@ -36220,9 +36597,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_execution_decisions_stage_idx": { "name": "issue_execution_decisions_stage_idx", @@ -36247,63 +36624,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": {}, @@ -36400,9 +36777,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_inbox_archives_company_user_idx": { "name": "issue_inbox_archives_company_user_idx", @@ -36421,9 +36798,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", @@ -36448,63 +36825,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": {}, @@ -36560,9 +36937,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_labels_label_idx": { "name": "issue_labels_label_idx", @@ -36575,9 +36952,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_labels_company_idx": { "name": "issue_labels_company_idx", @@ -36590,50 +36967,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": { @@ -36782,9 +37159,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_plan_decompositions_active_owner_idx": { "name": "issue_plan_decompositions_active_owner_idx", @@ -36803,10 +37180,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", @@ -36831,89 +37208,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": {}, @@ -37053,9 +37430,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_question_response_deliveries_correlation_uq": { "name": "issue_question_response_deliveries_correlation_uq", @@ -37068,9 +37445,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_question_response_deliveries_pending_idx": { "name": "issue_question_response_deliveries_pending_idx", @@ -37089,9 +37466,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", @@ -37116,76 +37493,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": {}, @@ -37272,9 +37649,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_read_states_company_user_idx": { "name": "issue_read_states_company_user_idx", @@ -37293,9 +37670,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", @@ -37320,37 +37697,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": {}, @@ -37528,6 +37905,71 @@ } }, "indexes": { + "issue_recovery_actions_source_run_idx": { + "name": "issue_recovery_actions_source_run_idx", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_issue_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "(\"evidence\"->>'runId')", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "issue_recovery_actions_system_recovery_due_idx": { + "name": "issue_recovery_actions_system_recovery_due_idx", + "columns": [ + { + "expression": "(\"evidence\"#>'{systemRecovery,nextAttemptAt}')", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"issue_recovery_actions\".\"evidence\" ? 'systemRecovery'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "issue_recovery_actions_system_recovery_adoption_idx": { + "name": "issue_recovery_actions_system_recovery_adoption_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "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, + "method": "btree", + "with": {} + }, "issue_recovery_actions_retained_workspace_recovery_idx": { "name": "issue_recovery_actions_retained_workspace_recovery_idx", "columns": [ @@ -37539,10 +37981,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", @@ -37567,9 +38009,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", @@ -37594,9 +38036,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", @@ -37615,9 +38057,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_recovery_actions_active_source_uq": { "name": "issue_recovery_actions_active_source_uq", @@ -37636,10 +38078,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", @@ -37670,90 +38112,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": {}, @@ -37848,9 +38290,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", @@ -37869,9 +38311,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", @@ -37896,9 +38338,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", @@ -37935,10 +38377,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", @@ -37969,51 +38411,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": {}, @@ -38102,9 +38544,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_relations_company_related_issue_idx": { "name": "issue_relations_company_related_issue_idx", @@ -38123,9 +38565,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_relations_company_type_idx": { "name": "issue_relations_company_type_idx", @@ -38144,9 +38586,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_relations_company_edge_uq": { "name": "issue_relations_company_edge_uq", @@ -38177,63 +38619,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": {}, @@ -38443,9 +38885,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", @@ -38470,9 +38912,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", @@ -38497,9 +38939,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", @@ -38524,10 +38966,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", @@ -38540,9 +38982,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_addressee_agent_idx": { "name": "issue_thread_interactions_addressee_agent_idx", @@ -38555,9 +38997,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_thread_interactions_addressee_user_idx": { "name": "issue_thread_interactions_addressee_user_idx", @@ -38570,115 +39012,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": {}, @@ -38810,9 +39252,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", @@ -38831,9 +39273,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", @@ -38852,89 +39294,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": {}, @@ -39097,9 +39539,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", @@ -39124,89 +39566,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": {}, @@ -39375,9 +39817,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_watchdogs_company_status_idx": { "name": "issue_watchdogs_company_status_idx", @@ -39396,9 +39838,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_watchdogs_company_agent_idx": { "name": "issue_watchdogs_company_agent_idx", @@ -39417,9 +39859,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_watchdogs_company_watchdog_issue_uq": { "name": "issue_watchdogs_company_watchdog_issue_uq", @@ -39438,116 +39880,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": {}, @@ -39717,9 +40159,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", @@ -39744,9 +40186,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", @@ -39771,9 +40213,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issue_work_products_company_updated_idx": { "name": "issue_work_products_company_updated_idx", @@ -39792,89 +40234,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": {}, @@ -40335,9 +40777,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_status_idx": { "name": "issues_company_status_idx", @@ -40356,9 +40798,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_harness_kind_idx": { "name": "issues_company_harness_kind_idx", @@ -40377,9 +40819,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_assignee_status_idx": { "name": "issues_company_assignee_status_idx", @@ -40404,9 +40846,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_assignee_user_status_idx": { "name": "issues_company_assignee_user_status_idx", @@ -40431,9 +40873,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_responsible_user_idx": { "name": "issues_company_responsible_user_idx", @@ -40452,9 +40894,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_parent_idx": { "name": "issues_company_parent_idx", @@ -40473,9 +40915,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_privacy_parent_idx": { "name": "issues_company_privacy_parent_idx", @@ -40494,9 +40936,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_privacy_root_idx": { "name": "issues_company_privacy_root_idx", @@ -40515,9 +40957,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_project_idx": { "name": "issues_company_project_idx", @@ -40536,9 +40978,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_origin_idx": { "name": "issues_company_origin_idx", @@ -40563,9 +41005,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_project_workspace_idx": { "name": "issues_company_project_workspace_idx", @@ -40584,9 +41026,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_execution_workspace_idx": { "name": "issues_company_execution_workspace_idx", @@ -40605,9 +41047,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_monitor_due_idx": { "name": "issues_company_monitor_due_idx", @@ -40626,9 +41068,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_updated_idx": { "name": "issues_company_updated_idx", @@ -40647,9 +41089,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_company_created_idx": { "name": "issues_company_created_idx", @@ -40668,9 +41110,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_open_normalized_title_created_idx": { "name": "issues_open_normalized_title_created_idx", @@ -40689,8 +41131,8 @@ }, { "expression": "lower(regexp_replace(btrim(\"title\"), '\\s+', ' ', 'g'))", - "isExpression": true, "asc": true, + "isExpression": true, "nulls": "last" }, { @@ -40701,10 +41143,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", @@ -40723,9 +41165,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_identifier_idx": { "name": "issues_identifier_idx", @@ -40738,9 +41180,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "issues_title_search_idx": { "name": "issues_title_search_idx", @@ -40754,9 +41196,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "issues_identifier_search_idx": { "name": "issues_identifier_search_idx", @@ -40770,9 +41212,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "issues_description_search_idx": { "name": "issues_description_search_idx", @@ -40786,9 +41228,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "gin", - "concurrently": false + "with": {} }, "issues_open_routine_execution_uq": { "name": "issues_open_routine_execution_uq", @@ -40819,10 +41261,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", @@ -40847,10 +41289,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", @@ -40875,10 +41317,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", @@ -40903,10 +41345,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", @@ -40931,10 +41373,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", @@ -40959,10 +41401,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", @@ -40987,10 +41429,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", @@ -41003,192 +41445,192 @@ } ], "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_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": {}, @@ -41357,9 +41799,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", @@ -41390,9 +41832,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "join_requests_pending_human_user_uq": { "name": "join_requests_pending_human_user_uq", @@ -41411,10 +41853,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", @@ -41427,57 +41869,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": {}, @@ -41542,9 +41984,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "labels_company_name_idx": { "name": "labels_company_name_idx", @@ -41563,24 +42005,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": {}, @@ -41730,9 +42172,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "managed_agent_profiles_company_key_uq": { "name": "managed_agent_profiles_company_key_uq", @@ -41751,9 +42193,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "managed_agent_profiles_company_resource_uq": { "name": "managed_agent_profiles_company_resource_uq", @@ -41784,37 +42226,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": {}, @@ -42000,99 +42442,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", @@ -42100,7 +42543,6 @@ "assessment_id", "decision_id" ], - "tableTo": "status_decisions", "columnsTo": [ "company_id", "issue_id", @@ -42108,8 +42550,8 @@ "assessment_id", "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -42236,9 +42678,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", @@ -42257,9 +42699,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", @@ -42278,88 +42720,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": {}, @@ -42477,9 +42919,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_company_case_idx": { "name": "pipeline_automation_executions_company_case_idx", @@ -42498,9 +42940,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_routine_idx": { "name": "pipeline_automation_executions_routine_idx", @@ -42513,9 +42955,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_automation_executions_execution_issue_idx": { "name": "pipeline_automation_executions_execution_issue_idx", @@ -42528,9 +42970,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", @@ -42543,63 +42985,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": {}, @@ -42675,9 +43117,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_blockers_blocked_by_idx": { "name": "pipeline_case_blockers_blocked_by_idx", @@ -42690,9 +43132,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_blockers_company_case_idx": { "name": "pipeline_case_blockers_company_case_idx", @@ -42711,50 +43153,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": {}, @@ -42842,9 +43284,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_documents_document_uq": { "name": "pipeline_case_documents_document_uq", @@ -42857,9 +43299,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", @@ -42884,50 +43326,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": {}, @@ -43041,9 +43483,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_events_company_case_idx": { "name": "pipeline_case_events_company_case_idx", @@ -43062,76 +43504,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": {}, @@ -43251,9 +43693,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_case_issue_links_issue_idx": { "name": "pipeline_case_issue_links_issue_idx", @@ -43266,9 +43708,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", @@ -43287,9 +43729,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", @@ -43302,50 +43744,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": {}, @@ -43587,9 +44029,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_parent_request_key_uq": { "name": "pipeline_cases_parent_request_key_uq", @@ -43608,10 +44050,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", @@ -43624,9 +44066,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_pipeline_stage_idx": { "name": "pipeline_cases_pipeline_stage_idx", @@ -43645,9 +44087,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_parent_idx": { "name": "pipeline_cases_parent_idx", @@ -43660,9 +44102,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_automation_attempt_idx": { "name": "pipeline_cases_automation_attempt_idx", @@ -43675,9 +44117,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_retired_idx": { "name": "pipeline_cases_retired_idx", @@ -43696,9 +44138,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_cases_lease_expires_idx": { "name": "pipeline_cases_lease_expires_idx", @@ -43711,90 +44153,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": {}, @@ -43886,9 +44328,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_documents_document_uq": { "name": "pipeline_documents_document_uq", @@ -43901,9 +44343,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_documents_company_pipeline_updated_idx": { "name": "pipeline_documents_company_pipeline_updated_idx", @@ -43928,50 +44370,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": {}, @@ -44061,9 +44503,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_stages_pipeline_position_idx": { "name": "pipeline_stages_pipeline_position_idx", @@ -44082,24 +44524,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": {}, @@ -44187,9 +44629,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_transitions_pipeline_from_idx": { "name": "pipeline_transitions_pipeline_from_idx", @@ -44208,9 +44650,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipeline_transitions_pipeline_to_idx": { "name": "pipeline_transitions_pipeline_to_idx", @@ -44229,50 +44671,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": {}, @@ -44380,9 +44822,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipelines_company_idx": { "name": "pipelines_company_idx", @@ -44395,9 +44837,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "pipelines_company_project_idx": { "name": "pipelines_company_project_idx", @@ -44416,50 +44858,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": {}, @@ -44538,9 +44980,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_company_settings_plugin_idx": { "name": "plugin_company_settings_plugin_idx", @@ -44553,9 +44995,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_company_settings_company_plugin_uq": { "name": "plugin_company_settings_company_plugin_uq", @@ -44574,37 +45016,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": {}, @@ -44682,37 +45124,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": {}, @@ -44791,9 +45233,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_database_namespaces_namespace_idx": { "name": "plugin_database_namespaces_namespace_idx", @@ -44806,9 +45248,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_database_namespaces_status_idx": { "name": "plugin_database_namespaces_status_idx", @@ -44821,24 +45263,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": {}, @@ -44940,9 +45382,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_entities_company_idx": { "name": "plugin_entities_company_idx", @@ -44955,9 +45397,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_entities_type_idx": { "name": "plugin_entities_type_idx", @@ -44970,9 +45412,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_entities_scope_idx": { "name": "plugin_entities_scope_idx", @@ -44991,50 +45433,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": {}, @@ -45134,9 +45576,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_job_runs_plugin_idx": { "name": "plugin_job_runs_plugin_idx", @@ -45149,9 +45591,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_job_runs_company_idx": { "name": "plugin_job_runs_company_idx", @@ -45164,9 +45606,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_job_runs_status_idx": { "name": "plugin_job_runs_status_idx", @@ -45179,50 +45621,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": {}, @@ -45306,9 +45748,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_jobs_next_run_idx": { "name": "plugin_jobs_next_run_idx", @@ -45321,9 +45763,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_jobs_unique_idx": { "name": "plugin_jobs_unique_idx", @@ -45342,24 +45784,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": {}, @@ -45404,37 +45846,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": { @@ -45519,9 +45961,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_logs_company_idx": { "name": "plugin_logs_company_idx", @@ -45534,9 +45976,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_logs_level_idx": { "name": "plugin_logs_level_idx", @@ -45549,37 +45991,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": {}, @@ -45669,9 +46111,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_managed_resources_plugin_idx": { "name": "plugin_managed_resources_plugin_idx", @@ -45684,9 +46126,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_managed_resources_resource_idx": { "name": "plugin_managed_resources_resource_idx", @@ -45705,9 +46147,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", @@ -45738,37 +46180,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": {}, @@ -45868,9 +46310,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_migrations_plugin_idx": { "name": "plugin_migrations_plugin_idx", @@ -45883,9 +46325,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_migrations_status_idx": { "name": "plugin_migrations_status_idx", @@ -45898,24 +46340,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": {}, @@ -45998,38 +46440,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": {}, @@ -46135,9 +46577,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_webhook_deliveries_company_idx": { "name": "plugin_webhook_deliveries_company_idx", @@ -46150,9 +46592,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_webhook_deliveries_status_idx": { "name": "plugin_webhook_deliveries_status_idx", @@ -46165,9 +46607,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugin_webhook_deliveries_key_idx": { "name": "plugin_webhook_deliveries_key_idx", @@ -46180,37 +46622,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": {}, @@ -46320,9 +46762,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "plugins_status_idx": { "name": "plugins_status_idx", @@ -46335,9 +46777,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -46439,9 +46881,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "principal_permission_grants_company_permission_idx": { "name": "principal_permission_grants_company_permission_idx", @@ -46460,24 +46902,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": {}, @@ -46553,9 +46995,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_access_members_subject_lookup_idx": { "name": "project_access_members_subject_lookup_idx", @@ -46586,37 +47028,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": {}, @@ -46679,9 +47121,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_goals_goal_idx": { "name": "project_goals_goal_idx", @@ -46694,9 +47136,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_goals_company_idx": { "name": "project_goals_company_idx", @@ -46709,50 +47151,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": { @@ -46844,9 +47286,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_memberships_company_user_starred_idx": { "name": "project_memberships_company_user_starred_idx", @@ -46871,9 +47313,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_memberships_project_idx": { "name": "project_memberships_project_idx", @@ -46886,9 +47328,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_memberships_company_user_project_uq": { "name": "project_memberships_company_user_project_uq", @@ -46913,37 +47355,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": {}, @@ -47095,9 +47537,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_project_primary_idx": { "name": "project_workspaces_project_primary_idx", @@ -47116,9 +47558,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_project_source_type_idx": { "name": "project_workspaces_project_source_type_idx", @@ -47137,9 +47579,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_company_shared_key_idx": { "name": "project_workspaces_company_shared_key_idx", @@ -47158,9 +47600,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "project_workspaces_project_remote_ref_idx": { "name": "project_workspaces_project_remote_ref_idx", @@ -47185,37 +47627,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": {}, @@ -47355,6 +47797,27 @@ } }, "indexes": { + "projects_company_id_uq": { + "name": "projects_company_id_uq", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, "projects_company_idx": { "name": "projects_company_idx", "columns": [ @@ -47366,9 +47829,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "projects_company_personal_owner_uq": { "name": "projects_company_personal_owner_uq", @@ -47387,51 +47850,51 @@ } ], "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" } }, "compositePrimaryKeys": {}, @@ -47558,9 +48021,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "provider_trace_records_expiry_idx": { "name": "provider_trace_records_expiry_idx", @@ -47579,9 +48042,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "provider_trace_records_company_created_idx": { "name": "provider_trace_records_company_created_idx", @@ -47600,37 +48063,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": {}, @@ -47741,9 +48204,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "remote_agent_profiles_company_key_uq": { "name": "remote_agent_profiles_company_key_uq", @@ -47762,24 +48225,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": {}, @@ -47807,15 +48270,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": { @@ -47874,10 +48337,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", @@ -47896,9 +48359,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "resource_lifecycle_events_resource_order_idx": { "name": "resource_lifecycle_events_resource_order_idx", @@ -47929,24 +48392,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": {}, @@ -48038,9 +48501,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_documents_document_uq": { "name": "routine_documents_document_uq", @@ -48053,9 +48516,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_documents_company_routine_updated_idx": { "name": "routine_documents_company_routine_updated_idx", @@ -48080,50 +48543,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": {}, @@ -48241,9 +48704,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_revisions_company_routine_created_idx": { "name": "routine_revisions_company_routine_created_idx", @@ -48268,9 +48731,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_revisions_company_responsible_user_idx": { "name": "routine_revisions_company_responsible_user_idx", @@ -48295,76 +48758,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": {}, @@ -48515,9 +48978,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_revision_idx": { "name": "routine_runs_revision_idx", @@ -48530,9 +48993,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_company_responsible_user_idx": { "name": "routine_runs_company_responsible_user_idx", @@ -48557,9 +49020,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_trigger_idx": { "name": "routine_runs_trigger_idx", @@ -48578,9 +49041,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_dispatch_fingerprint_idx": { "name": "routine_runs_dispatch_fingerprint_idx", @@ -48599,9 +49062,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_linked_issue_idx": { "name": "routine_runs_linked_issue_idx", @@ -48614,9 +49077,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_runs_trigger_idempotency_idx": { "name": "routine_runs_trigger_idempotency_idx", @@ -48635,76 +49098,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": {}, @@ -48892,9 +49355,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_company_kind_idx": { "name": "routine_triggers_company_kind_idx", @@ -48913,9 +49376,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_next_run_idx": { "name": "routine_triggers_next_run_idx", @@ -48928,9 +49391,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_public_id_idx": { "name": "routine_triggers_public_id_idx", @@ -48943,9 +49406,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routine_triggers_public_id_uq": { "name": "routine_triggers_public_id_uq", @@ -48958,76 +49421,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": {}, @@ -49091,37 +49554,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": {}, @@ -49345,9 +49808,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_assignee_idx": { "name": "routines_company_assignee_idx", @@ -49366,9 +49829,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_project_idx": { "name": "routines_company_project_idx", @@ -49387,9 +49850,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_folder_idx": { "name": "routines_company_folder_idx", @@ -49408,9 +49871,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_responsible_user_idx": { "name": "routines_company_responsible_user_idx", @@ -49429,9 +49892,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "routines_company_origin_idx": { "name": "routines_company_origin_idx", @@ -49456,115 +49919,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": {}, @@ -49677,9 +50140,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "run_identity_contexts_run_correlation_idx": { "name": "run_identity_contexts_run_correlation_idx", @@ -49698,9 +50161,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "run_identity_contexts_company_run_idx": { "name": "run_identity_contexts_company_run_idx", @@ -49719,24 +50182,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": {}, @@ -49800,50 +50263,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": {}, @@ -50010,9 +50473,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_secret_created_idx": { "name": "secret_access_events_secret_created_idx", @@ -50031,9 +50494,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", @@ -50052,9 +50515,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", @@ -50079,9 +50542,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_consumer_idx": { "name": "secret_access_events_consumer_idx", @@ -50106,9 +50569,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "secret_access_events_run_idx": { "name": "secret_access_events_run_idx", @@ -50121,89 +50584,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": {}, @@ -50304,9 +50767,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "smoke_run_steps_company_path_idx": { "name": "smoke_run_steps_company_path_idx", @@ -50325,37 +50788,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": {}, @@ -50447,9 +50910,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "smoke_runs_company_status_idx": { "name": "smoke_runs_company_status_idx", @@ -50468,24 +50931,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": {}, @@ -50625,9 +51088,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_card_updates_generation_issue_idx": { "name": "status_card_updates_generation_issue_idx", @@ -50640,50 +51103,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": {}, @@ -50916,9 +51379,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_cards_company_next_eval_idx": { "name": "status_cards_company_next_eval_idx", @@ -50937,102 +51400,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": {}, @@ -51171,9 +51634,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_decision_effects_company_idempotency_uq": { "name": "status_decision_effects_company_idempotency_uq", @@ -51192,56 +51655,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": {}, @@ -51378,9 +51841,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_decisions_company_assessment_uq": { "name": "status_decisions_company_assessment_uq", @@ -51399,9 +51862,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "status_decisions_company_issue_digest_uq": { "name": "status_decisions_company_issue_digest_uq", @@ -51426,98 +51889,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": {}, @@ -51629,9 +52092,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "summary_slots_company_scope_idx": { "name": "summary_slots_company_scope_idx", @@ -51656,9 +52119,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "summary_slots_company_generating_issue_idx": { "name": "summary_slots_company_generating_issue_idx", @@ -51677,9 +52140,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "summary_slots_company_updated_idx": { "name": "summary_slots_company_updated_idx", @@ -51698,76 +52161,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": {}, @@ -51897,9 +52360,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_access_audit_connection_idx": { "name": "tool_access_audit_connection_idx", @@ -51912,9 +52375,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_access_audit_gateway_idx": { "name": "tool_access_audit_gateway_idx", @@ -51933,76 +52396,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": {}, @@ -52071,63 +52534,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": {}, @@ -52295,9 +52758,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_action_requests_invocation_idx": { "name": "tool_action_requests_invocation_idx", @@ -52310,9 +52773,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_action_requests_issue_idx": { "name": "tool_action_requests_issue_idx", @@ -52331,115 +52794,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": {}, @@ -52554,9 +53017,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_applications_company_status_idx": { "name": "tool_applications_company_status_idx", @@ -52575,9 +53038,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_applications_company_name_uq": { "name": "tool_applications_company_name_uq", @@ -52596,9 +53059,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_applications_company_key_uq": { "name": "tool_applications_company_key_uq", @@ -52617,50 +53080,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": {}, @@ -52955,9 +53418,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_run_idx": { "name": "tool_call_events_run_idx", @@ -52976,9 +53439,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_issue_idx": { "name": "tool_call_events_issue_idx", @@ -52997,9 +53460,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_invocation_idx": { "name": "tool_call_events_invocation_idx", @@ -53012,9 +53475,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_call_events_gateway_idx": { "name": "tool_call_events_gateway_idx", @@ -53033,167 +53496,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": {}, @@ -53406,9 +53869,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_application_idx": { "name": "tool_catalog_entries_application_idx", @@ -53421,9 +53884,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_connection_idx": { "name": "tool_catalog_entries_connection_idx", @@ -53436,9 +53899,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_company_status_idx": { "name": "tool_catalog_entries_company_status_idx", @@ -53457,9 +53920,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_catalog_entries_connection_name_uq": { "name": "tool_catalog_entries_connection_name_uq", @@ -53478,63 +53941,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": {}, @@ -53641,39 +54104,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": {}, @@ -53794,39 +54257,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": {}, @@ -53914,9 +54377,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connection_installs_connection_idx": { "name": "tool_connection_installs_connection_idx", @@ -53935,9 +54398,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connection_installs_target_uq": { "name": "tool_connection_installs_target_uq", @@ -53968,50 +54431,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": {}, @@ -54238,9 +54701,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connections_application_idx": { "name": "tool_connections_application_idx", @@ -54253,9 +54716,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connections_company_enabled_idx": { "name": "tool_connections_company_enabled_idx", @@ -54274,9 +54737,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_connections_company_uid_uq": { "name": "tool_connections_company_uid_uq", @@ -54295,61 +54758,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": {}, @@ -54470,9 +54933,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", @@ -54497,24 +54960,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": {}, @@ -54663,9 +55126,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_company_agent_idx": { "name": "tool_gateway_sessions_company_agent_idx", @@ -54684,9 +55147,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_company_expires_idx": { "name": "tool_gateway_sessions_company_expires_idx", @@ -54705,9 +55168,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_run_idx": { "name": "tool_gateway_sessions_run_idx", @@ -54726,9 +55189,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_issue_idx": { "name": "tool_gateway_sessions_issue_idx", @@ -54747,9 +55210,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_gateway_sessions_gateway_idx": { "name": "tool_gateway_sessions_gateway_idx", @@ -54768,102 +55231,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": {}, @@ -55178,9 +55641,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_run_idx": { "name": "tool_invocations_run_idx", @@ -55199,9 +55662,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_issue_idx": { "name": "tool_invocations_issue_idx", @@ -55220,9 +55683,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_gateway_idx": { "name": "tool_invocations_gateway_idx", @@ -55241,9 +55704,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_invocations_company_idempotency_uq": { "name": "tool_invocations_company_idempotency_uq", @@ -55262,128 +55725,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": {}, @@ -55549,9 +56012,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_expiry_idx": { "name": "tool_mcp_gateway_tokens_expiry_idx", @@ -55570,9 +56033,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_gateway_idx": { "name": "tool_mcp_gateway_tokens_gateway_idx", @@ -55591,9 +56054,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateway_tokens_subject_idx": { "name": "tool_mcp_gateway_tokens_subject_idx", @@ -55618,9 +56081,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", @@ -55639,63 +56102,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": {}, @@ -55890,9 +56353,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_company_status_idx": { "name": "tool_mcp_gateways_company_status_idx", @@ -55911,9 +56374,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_profile_idx": { "name": "tool_mcp_gateways_profile_idx", @@ -55932,9 +56395,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_public_id_uq": { "name": "tool_mcp_gateways_public_id_uq", @@ -55947,9 +56410,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_company_slug_uq": { "name": "tool_mcp_gateways_company_slug_uq", @@ -55968,9 +56431,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_mcp_gateways_company_name_uq": { "name": "tool_mcp_gateways_company_name_uq", @@ -55989,102 +56452,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": {}, @@ -56201,9 +56664,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_connection_idx": { "name": "tool_oauth_states_connection_idx", @@ -56216,9 +56679,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_actor_idx": { "name": "tool_oauth_states_actor_idx", @@ -56237,9 +56700,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_subject_agent_idx": { "name": "tool_oauth_states_subject_agent_idx", @@ -56258,9 +56721,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_oauth_states_expires_at_idx": { "name": "tool_oauth_states_expires_at_idx", @@ -56273,50 +56736,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": {}, @@ -56438,9 +56901,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_policies_company_type_idx": { "name": "tool_policies_company_type_idx", @@ -56459,9 +56922,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_policies_company_name_uq": { "name": "tool_policies_company_name_uq", @@ -56480,37 +56943,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": {}, @@ -56619,9 +57082,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_bindings_target_profile_uq": { "name": "tool_profile_bindings_target_profile_uq", @@ -56652,50 +57115,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": {}, @@ -56809,9 +57272,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_entries_application_idx": { "name": "tool_profile_entries_application_idx", @@ -56830,9 +57293,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_entries_connection_idx": { "name": "tool_profile_entries_connection_idx", @@ -56851,9 +57314,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profile_entries_catalog_entry_idx": { "name": "tool_profile_entries_catalog_entry_idx", @@ -56872,76 +57335,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": {}, @@ -57045,9 +57508,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profiles_company_key_uq": { "name": "tool_profiles_company_key_uq", @@ -57066,9 +57529,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_profiles_company_name_uq": { "name": "tool_profiles_company_name_uq", @@ -57087,24 +57550,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": {}, @@ -57211,9 +57674,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_rate_limit_counters_window_uq": { "name": "tool_rate_limit_counters_window_uq", @@ -57250,37 +57713,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": {}, @@ -57364,9 +57827,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_metric_counters_bucket_uq": { "name": "tool_runtime_metric_counters_bucket_uq", @@ -57391,24 +57854,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": {}, @@ -57634,9 +58097,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_slots_connection_idx": { "name": "tool_runtime_slots_connection_idx", @@ -57649,9 +58112,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_slots_execution_workspace_idx": { "name": "tool_runtime_slots_execution_workspace_idx", @@ -57670,9 +58133,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "tool_runtime_slots_slot_key_uq": { "name": "tool_runtime_slots_slot_key_uq", @@ -57691,89 +58154,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": {}, @@ -57896,9 +58359,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", @@ -57917,9 +58380,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", @@ -57938,37 +58401,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": {}, @@ -58046,9 +58509,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_company_preferences_primary_agent_idx": { "name": "user_company_preferences_primary_agent_idx", @@ -58061,37 +58524,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": {}, @@ -58170,9 +58633,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", @@ -58185,24 +58648,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": {}, @@ -58317,9 +58780,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_definition_idx": { "name": "user_secret_declarations_definition_idx", @@ -58332,9 +58795,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_target_idx": { "name": "user_secret_declarations_target_idx", @@ -58359,9 +58822,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_company_required_idx": { "name": "user_secret_declarations_company_required_idx", @@ -58380,9 +58843,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_target_path_uq": { "name": "user_secret_declarations_target_path_uq", @@ -58413,9 +58876,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_declarations_required_override_idx": { "name": "user_secret_declarations_required_override_idx", @@ -58434,38 +58897,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": {}, @@ -58611,9 +59074,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_definitions_company_provider_idx": { "name": "user_secret_definitions_company_provider_idx", @@ -58632,9 +59095,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_definitions_provider_config_idx": { "name": "user_secret_definitions_provider_config_idx", @@ -58647,9 +59110,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "user_secret_definitions_company_key_uq": { "name": "user_secret_definitions_company_key_uq", @@ -58668,64 +59131,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": {}, @@ -58785,9 +59248,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -58942,137 +59405,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": {}, @@ -59084,6 +59547,113 @@ }, "isRLSEnabled": false }, + "public.workflows": { + "name": "workflows", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "company_id": { + "name": "company_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by_agent_id": { + "name": "created_by_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_by_user_id": { + "name": "created_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflows_company_idx": { + "name": "workflows_company_idx", + "columns": [ + { + "expression": "company_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflows_company_id_companies_id_fk": { + "name": "workflows_company_id_companies_id_fk", + "tableFrom": "workflows", + "tableTo": "companies", + "columnsFrom": [ + "company_id" + ], + "columnsTo": [ + "id" + ], + "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" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "public.workspace_operations": { "name": "workspace_operations", "schema": "", @@ -59251,9 +59821,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_operations_company_workspace_started_idx": { "name": "workspace_operations_company_workspace_started_idx", @@ -59278,9 +59848,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", @@ -59311,63 +59881,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": {}, @@ -59590,9 +60160,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", @@ -59617,9 +60187,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", @@ -59644,9 +60214,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_runtime_services_run_idx": { "name": "workspace_runtime_services_run_idx", @@ -59659,9 +60229,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "workspace_runtime_services_company_updated_idx": { "name": "workspace_runtime_services_company_updated_idx", @@ -59680,102 +60250,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": {}, @@ -59923,9 +60493,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_attachment_upload_expiry_idx": { "name": "mcp_attachment_upload_expiry_idx", @@ -59938,50 +60508,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": {}, @@ -60057,9 +60627,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_admissions_grant_idx": { "name": "mcp_event_admissions_grant_idx", @@ -60072,9 +60642,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_admissions_company_idx": { "name": "mcp_event_admissions_company_idx", @@ -60087,37 +60657,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": {}, @@ -60206,9 +60776,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_deliveries_activity_uq": { "name": "mcp_event_deliveries_activity_uq", @@ -60227,9 +60797,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_deliveries_due_idx": { "name": "mcp_event_deliveries_due_idx", @@ -60242,24 +60812,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": {}, @@ -60370,9 +60940,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_event_subscriptions_company_idx": { "name": "mcp_event_subscriptions_company_idx", @@ -60385,37 +60955,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": {}, @@ -60495,9 +61065,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_file_ticket_grant_idx": { "name": "mcp_file_ticket_grant_idx", @@ -60510,50 +61080,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": {}, @@ -60660,9 +61230,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_mutation_receipts_company_idx": { "name": "mcp_mutation_receipts_company_idx", @@ -60675,50 +61245,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": {}, @@ -60884,9 +61454,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_user_code_uq": { "name": "mcp_oauth_user_code_uq", @@ -60899,9 +61469,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_device_expiry_idx": { "name": "mcp_oauth_device_expiry_idx", @@ -60914,37 +61484,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": {}, @@ -61039,63 +61609,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": {}, @@ -61140,9 +61710,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} } }, "foreignKeys": {}, @@ -61254,9 +61824,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_requests_expiry_idx": { "name": "mcp_oauth_requests_expiry_idx", @@ -61269,37 +61839,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": {}, @@ -61369,9 +61939,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_tokens_grant_idx": { "name": "mcp_oauth_tokens_grant_idx", @@ -61384,9 +61954,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "mcp_oauth_tokens_expiry_idx": { "name": "mcp_oauth_tokens_expiry_idx", @@ -61399,24 +61969,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": {}, @@ -61549,9 +62119,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "external_holds_agent_idx": { "name": "external_holds_agent_idx", @@ -61570,37 +62140,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": {}, @@ -61813,10 +62383,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", @@ -61829,9 +62399,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_bindings_active_grant_uq": { "name": "muse_bindings_active_grant_uq", @@ -61844,51 +62414,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": {}, @@ -61982,9 +62552,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_credentials_binding_idx": { "name": "muse_credentials_binding_idx", @@ -62003,37 +62573,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": {}, @@ -62121,37 +62691,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": {}, @@ -62251,9 +62821,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_input_source_uq": { "name": "muse_input_source_uq", @@ -62272,37 +62842,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": {}, @@ -62408,9 +62978,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_mailbox_cursor_idx": { "name": "muse_mailbox_cursor_idx", @@ -62435,50 +63005,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": {}, @@ -62610,37 +63180,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": {}, @@ -62809,9 +63379,9 @@ } ], "isUnique": true, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "muse_assignments_live_binding_uq": { "name": "muse_assignments_live_binding_uq", @@ -62824,10 +63394,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", @@ -62840,63 +63410,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": {}, @@ -63004,37 +63574,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": {}, @@ -63092,15 +63662,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": {}, @@ -63314,9 +63884,9 @@ } ], "isUnique": false, - "with": {}, + "concurrently": false, "method": "btree", - "concurrently": false + "with": {} }, "prompt_injection_invocations_pending_idx": { "name": "prompt_injection_invocations_pending_idx", @@ -63329,10 +63899,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", @@ -63345,37 +63915,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": {}, @@ -63396,21 +63966,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 acca050f264..67c16d4df80 100644 --- a/packages/db/src/migrations/meta/_journal.json +++ b/packages/db/src/migrations/meta/_journal.json @@ -2591,6 +2591,13 @@ "when": 1792597792969, "tag": "0371_furry_red_shift", "breakpoints": true + }, + { + "idx": 372, + "version": "7", + "when": 1792707356696, + "tag": "0372_mature_the_initiative", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema/execution_workspace_restore_points.ts b/packages/db/src/schema/execution_workspace_restore_points.ts new file mode 100644 index 00000000000..80f3f55483a --- /dev/null +++ b/packages/db/src/schema/execution_workspace_restore_points.ts @@ -0,0 +1,46 @@ +import { sql } from "drizzle-orm"; +import { bigint, index, integer, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core"; + +export const EXECUTION_WORKSPACE_RESTORE_POINT_STATUSES = [ + "pending", + "active", + "expiring", + "superseded", + "delete_requested", + "deleted", +] as const; +export type ExecutionWorkspaceRestorePointStatus = (typeof EXECUTION_WORKSPACE_RESTORE_POINT_STATUSES)[number]; + +export const executionWorkspaceRestorePoints = pgTable( + "execution_workspace_restore_points", + { + id: uuid("id").primaryKey().defaultRandom(), + companyId: uuid("company_id").notNull(), + executionWorkspaceId: uuid("execution_workspace_id").notNull(), + sourceIssueId: uuid("source_issue_id"), + generation: integer("generation").notNull(), + objectKey: text("object_key").notNull(), + sha256: text("sha256").notNull(), + byteSize: bigint("byte_size", { mode: "number" }).notNull(), + status: text("status").$type().notNull().default("pending"), + activatedAt: timestamp("activated_at", { withTimezone: true }), + treeClosedAt: timestamp("tree_closed_at", { withTimezone: true }), + deleteAfter: timestamp("delete_after", { withTimezone: true }), + reviewGeneration: integer("review_generation").notNull().default(0), + deletedAt: timestamp("deleted_at", { withTimezone: true }), + lastError: text("last_error"), + createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), + updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(), + }, + (table) => ({ + objectKeyUniqueIdx: uniqueIndex("execution_workspace_restore_points_object_key_uniq").on(table.objectKey), + liveGenerationUniqueIdx: uniqueIndex("execution_workspace_restore_points_live_generation_uniq") + .on(table.executionWorkspaceId, table.generation) + .where(sql`${table.status} <> 'deleted'`), + statusDeleteAfterIdx: index("execution_workspace_restore_points_status_delete_after_idx").on(table.status, table.deleteAfter), + companyIdx: index("execution_workspace_restore_points_company_idx").on(table.companyId), + sourceIssueIdx: index("execution_workspace_restore_points_source_issue_idx").on(table.companyId, table.sourceIssueId), + activeSourceIdx: index("execution_workspace_restore_points_active_source_idx").on(table.sourceIssueId) + .where(sql`${table.status} = 'active'`), + }), +); diff --git a/packages/db/src/schema/index.ts b/packages/db/src/schema/index.ts index 47615fcaec0..5be5f2d8c88 100644 --- a/packages/db/src/schema/index.ts +++ b/packages/db/src/schema/index.ts @@ -32,6 +32,11 @@ export { projectAccessMembers } from "./project_access_members.js"; export { documentMemberships } from "./document_memberships.js"; export { projectWorkspaces } from "./project_workspaces.js"; export { executionWorkspaces } from "./execution_workspaces.js"; +export { + executionWorkspaceRestorePoints, + EXECUTION_WORKSPACE_RESTORE_POINT_STATUSES, + type ExecutionWorkspaceRestorePointStatus, +} from "./execution_workspace_restore_points.js"; export { executionWorkspaceRuntimeLeases } from "./execution_workspace_runtime_leases.js"; export { environments } from "./environments.js"; export { environmentLeases } from "./environment_leases.js"; diff --git a/server/src/__tests__/git-restore-point-ledger-config.test.ts b/server/src/__tests__/git-restore-point-ledger-config.test.ts new file mode 100644 index 00000000000..17690127a9b --- /dev/null +++ b/server/src/__tests__/git-restore-point-ledger-config.test.ts @@ -0,0 +1,25 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; +import { loadConfig } from "../config.ts"; + +describe("git restore point retention config parsing", () => { + afterEach(() => { + vi.unstubAllEnvs(); + }); + + it("keeps restore points 90 days after their issue tree closes by default", () => { + vi.stubEnv("PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS", undefined); + expect(loadConfig()).toMatchObject({ gitRestorePointRetentionDays: 90 }); + }); + + it("accepts an explicit retention and never goes below one day", () => { + vi.stubEnv("PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS", "30"); + expect(loadConfig()).toMatchObject({ gitRestorePointRetentionDays: 30 }); + vi.stubEnv("PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS", "0"); + expect(loadConfig()).toMatchObject({ gitRestorePointRetentionDays: 1 }); + }); + + it.each(["", "-1", "many"])("falls back to 90 days for %j", (value) => { + vi.stubEnv("PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS", value); + expect(loadConfig()).toMatchObject({ gitRestorePointRetentionDays: 90 }); + }); +}); diff --git a/server/src/__tests__/git-restore-point-ledger.test.ts b/server/src/__tests__/git-restore-point-ledger.test.ts new file mode 100644 index 00000000000..8b2e894dc44 --- /dev/null +++ b/server/src/__tests__/git-restore-point-ledger.test.ts @@ -0,0 +1,381 @@ +import { randomUUID } from "node:crypto"; +import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import { eq } from "drizzle-orm"; +import { agents, companies, createDb, executionWorkspaceRestorePoints, issues } from "@paperclipai/db"; +import { + getEmbeddedPostgresTestSupport, + startEmbeddedPostgresTestDatabase, +} from "./helpers/embedded-postgres.js"; +import { + GIT_RESTORE_POINT_RETRY_MS, + gitRestorePointRetentionService, + registerGitRestorePointWork, + requestRestorePointDeletion, +} from "../services/git-restore-point-ledger.ts"; +import { issueService } from "../services/issues.ts"; +import { deleteCompany } from "../services/company-deletion.ts"; +import type { StorageService } from "../storage/types.ts"; + +const embeddedPostgresSupport = await getEmbeddedPostgresTestSupport(); +const describeEmbeddedPostgres = embeddedPostgresSupport.supported ? describe : describe.skip; + +if (!embeddedPostgresSupport.supported) { + console.warn( + `Skipping embedded Postgres git restore point ledger tests on this host: ${embeddedPostgresSupport.reason ?? "unsupported environment"}`, + ); +} + +const DAY_MS = 24 * 60 * 60 * 1000; + +describeEmbeddedPostgres("git restore point retention", () => { + let db!: ReturnType; + let tempDb: Awaited> | null = null; + const now = new Date(); + let deleted: string[] = []; + let failDeletes = false; + let silentlyKeep = false; + const storage = { + deleteObject: async (_companyId: string, objectKey: string) => { + if (failDeletes) throw new Error("storage unavailable"); + if (!silentlyKeep) deleted.push(objectKey); + }, + headObject: async (_companyId: string, objectKey: string) => ({ exists: silentlyKeep && !deleted.includes(objectKey) }), + } as unknown as StorageService; + + beforeAll(async () => { + tempDb = await startEmbeddedPostgresTestDatabase("paperclip-git-restore-point-ledger-"); + db = createDb(tempDb.connectionString); + }, 20_000); + + afterEach(async () => { + deleted = []; + failDeletes = false; + silentlyKeep = false; + await db.delete(executionWorkspaceRestorePoints); + await db.delete(issues); + await db.delete(agents); + await db.delete(companies); + }); + + afterAll(async () => { + await tempDb?.cleanup(); + }); + + async function seed(input: { + status?: "pending" | "active" | "superseded" | "delete_requested"; + issueStatus?: string; + closedDaysAgo?: number; + openChild?: boolean; + createdHoursAgo?: number; + withoutIssue?: boolean; + deleteAfter?: Date | null; + companyId?: string; + } = {}) { + const companyId = input.companyId ?? randomUUID(); + if (!input.companyId) { + await db.insert(companies).values({ id: companyId, name: "Restore", issuePrefix: `R${companyId.slice(0, 6)}` }); + } + const issueStatus = input.issueStatus ?? "done"; + const closedAt = new Date(now.getTime() - (input.closedDaysAgo ?? 10) * DAY_MS); + const [issue] = await db.insert(issues).values({ + companyId, + title: "Work", + status: issueStatus, + completedAt: issueStatus === "done" ? closedAt : null, + cancelledAt: issueStatus === "cancelled" ? closedAt : null, + }).returning(); + if (input.openChild) { + await db.insert(issues).values({ companyId, title: "Child", status: "blocked", parentId: issue!.id }); + } + const workspaceId = randomUUID(); + const [row] = await db.insert(executionWorkspaceRestorePoints).values({ + companyId, + executionWorkspaceId: workspaceId, + sourceIssueId: input.withoutIssue ? randomUUID() : issue!.id, + generation: 1, + objectKey: `${companyId}/git-restore-points/${workspaceId}/1/${randomUUID()}.pcrp`, + sha256: "a".repeat(64), + byteSize: 1024, + status: input.status ?? "active", + deleteAfter: input.deleteAfter ?? null, + createdAt: new Date(now.getTime() - (input.createdHoursAgo ?? 0) * 60 * 60 * 1000), + }).returning(); + return row!; + } + + function service(options: { at?: Date; beforeExpire?: (row: typeof executionWorkspaceRestorePoints.$inferSelect) => Promise } = {}) { + return gitRestorePointRetentionService(db, { storage, now: () => options.at ?? now, beforeExpire: options.beforeExpire }); + } + + async function reload(id: string) { + const [row] = await db.select().from(executionWorkspaceRestorePoints).where(eq(executionWorkspaceRestorePoints.id, id)); + return row!; + } + + const due = () => new Date(now.getTime() - 1000); + + it("waits without a deadline while its tree is open", async () => { + const row = await seed({ openChild: true, deleteAfter: due() }); + expect(await service().tick()).toMatchObject({ scheduled: 1, deleted: 0 }); + expect(await reload(row.id)).toMatchObject({ status: "active", treeClosedAt: null, deleteAfter: null }); + expect(await service().nextDeadlineAt()).toBeNull(); + }); + + it("schedules deletion 90 days after the tree closes", async () => { + const row = await seed({ closedDaysAgo: 10, deleteAfter: due() }); + await service().tick(); + const reloaded = await reload(row.id); + expect(reloaded.status).toBe("active"); + expect(reloaded.deleteAfter!.getTime() - reloaded.treeClosedAt!.getTime()).toBe(90 * DAY_MS); + expect(deleted).toEqual([]); + }); + + it("expires and deletes a restore point at its deadline once the tree has been closed long enough", async () => { + const row = await seed({ closedDaysAgo: 91, deleteAfter: new Date(now.getTime() - 1000) }); + const beforeExpire = vi.fn(async () => {}); + expect(await service({ beforeExpire }).tick()).toMatchObject({ expired: 1, deleted: 1 }); + expect(beforeExpire).toHaveBeenCalledOnce(); + expect(deleted).toEqual([row.objectKey]); + expect(await reload(row.id)).toMatchObject({ status: "deleted" }); + }); + + it("keeps a restore point expiring, and its object, until the expiry hook succeeds", async () => { + const row = await seed({ closedDaysAgo: 91, deleteAfter: due() }); + expect(await service({ beforeExpire: async () => { throw new Error("recipe busy"); } }).tick()).toMatchObject({ failed: 1, expired: 0, deleted: 0 }); + expect(await reload(row.id)).toMatchObject({ status: "expiring", lastError: "recipe busy" }); + expect(await service().tick()).toMatchObject({ expired: 0, deleted: 0 }); + expect(await service().nextDeadlineAt()).toBe((await reload(row.id)).updatedAt.getTime() + GIT_RESTORE_POINT_RETRY_MS); + const beforeExpire = vi.fn(async () => {}); + const later = service({ at: new Date(now.getTime() + GIT_RESTORE_POINT_RETRY_MS + 1000), beforeExpire }); + expect(await later.tick()).toMatchObject({ expired: 1, deleted: 1 }); + expect(beforeExpire).toHaveBeenCalledOnce(); + expect(deleted).toEqual([row.objectKey]); + }); + + it("resumes the expiry hook after a restart instead of deleting the object directly", async () => { + const row = await seed({ closedDaysAgo: 91, status: "active" }); + await db.update(executionWorkspaceRestorePoints).set({ status: "expiring" }).where(eq(executionWorkspaceRestorePoints.id, row.id)); + const beforeExpire = vi.fn(async () => {}); + expect(await service().nextDeadlineAt()).toBe(now.getTime()); + expect(await service({ beforeExpire }).tick()).toMatchObject({ expired: 1, deleted: 1 }); + expect(beforeExpire).toHaveBeenCalledOnce(); + expect(await reload(row.id)).toMatchObject({ status: "deleted" }); + }); + + it("never deletes the object of an expiring restore point whose hook has not run", async () => { + const row = await seed({ closedDaysAgo: 91, status: "active" }); + await db.update(executionWorkspaceRestorePoints).set({ status: "expiring" }).where(eq(executionWorkspaceRestorePoints.id, row.id)); + await service({ beforeExpire: async () => { throw new Error("recipe busy"); } }).tick(); + expect(deleted).toEqual([]); + }); + + it("deletes restore points whose source issue no longer exists at review", async () => { + const row = await seed({ withoutIssue: true, deleteAfter: due() }); + expect(await service().tick()).toMatchObject({ orphaned: 1, deleted: 1 }); + expect(await reload(row.id)).toMatchObject({ status: "deleted" }); + }); + + it("evaluates only restore points that are due, so retained ones cause no rescans", async () => { + for (let index = 0; index < 60; index += 1) await seed({ closedDaysAgo: 10, deleteAfter: new Date(now.getTime() + DAY_MS) }); + expect(await service().tick()).toMatchObject({ scheduled: 0, expired: 0, truncated: false }); + expect(await service().nextDeadlineAt()).toBe(now.getTime() + DAY_MS); + }); + + it("works through a backlog of due restore points in bounded batches", async () => { + for (let index = 0; index < 60; index += 1) await seed({ closedDaysAgo: 10, deleteAfter: due() }); + expect(await service().tick()).toMatchObject({ scheduled: 50, truncated: true }); + expect(await service().tick()).toMatchObject({ scheduled: 10, truncated: false }); + expect(await service().tick()).toMatchObject({ scheduled: 0, truncated: false }); + }); + + it("cleans up abandoned pending restore points but leaves recent ones", async () => { + const stale = await seed({ status: "pending", createdHoursAgo: 2 }); + const recent = await seed({ status: "pending", createdHoursAgo: 0 }); + await service().tick(); + expect(await reload(stale.id)).toMatchObject({ status: "deleted" }); + expect(await reload(recent.id)).toMatchObject({ status: "pending" }); + }); + + it("deletes superseded restore points", async () => { + const row = await seed({ status: "superseded" }); + await service().tick(); + expect(await reload(row.id)).toMatchObject({ status: "deleted" }); + }); + + it("does not mark an object deleted when it is still present after deletion", async () => { + const row = await seed({ status: "delete_requested" }); + silentlyKeep = true; + expect(await service().tick()).toMatchObject({ failed: 1, deleted: 0 }); + expect(await reload(row.id)).toMatchObject({ status: "delete_requested", lastError: "restore_point_object_still_present" }); + }); + + it("retries a failed deletion only after its retry deadline", async () => { + const row = await seed({ status: "delete_requested" }); + failDeletes = true; + expect(await service().tick()).toMatchObject({ failed: 1 }); + failDeletes = false; + expect(await service().tick()).toMatchObject({ failed: 0, deleted: 0 }); + expect(await service().nextDeadlineAt()).toBe((await reload(row.id)).updatedAt.getTime() + GIT_RESTORE_POINT_RETRY_MS); + expect(await service({ at: new Date(now.getTime() + GIT_RESTORE_POINT_RETRY_MS + 1000) }).tick()).toMatchObject({ deleted: 1 }); + expect(await reload(row.id)).toMatchObject({ status: "deleted", lastError: null }); + }); + + it("reports the real next deadline, and none when idle", async () => { + expect(await service().nextDeadlineAt()).toBeNull(); + await seed({ openChild: true }); + expect(await service().nextDeadlineAt()).toBeNull(); + const reviewed = await seed({ closedDaysAgo: 10, deleteAfter: due() }); + expect(await service().nextDeadlineAt()).toBe(due().getTime()); + await service().tick(); + expect(await service().nextDeadlineAt()).toBe((await reload(reviewed.id)).deleteAfter!.getTime()); + const pending = await seed({ status: "pending", createdHoursAgo: 0 }); + expect(await service().nextDeadlineAt()).toBe((await reload(pending.id)).createdAt.getTime() + 60 * 60 * 1000); + await seed({ status: "delete_requested" }); + expect(await service().nextDeadlineAt()).toBe(now.getTime()); + }); + + it("marks only the deleted issue's restore points when an issue is removed", async () => { + const removed = await seed({ deleteAfter: new Date(now.getTime() + 80 * DAY_MS) }); + const kept = await seed({ deleteAfter: new Date(now.getTime() + 80 * DAY_MS) }); + await issueService(db).remove(removed.sourceIssueId!); + expect(await reload(removed.id)).toMatchObject({ status: "delete_requested" }); + expect(await reload(kept.id)).toMatchObject({ status: "active" }); + await service().tick(); + expect(deleted).toEqual([removed.objectKey]); + }); + + it("marks every restore point of a deleted company", async () => { + const first = await seed({ deleteAfter: new Date(now.getTime() + 80 * DAY_MS) }); + const second = await seed({ companyId: first.companyId, status: "pending" }); + const other = await seed({ deleteAfter: new Date(now.getTime() + 80 * DAY_MS) }); + await deleteCompany(db, first.companyId); + expect(await reload(first.id)).toMatchObject({ status: "delete_requested" }); + expect(await reload(second.id)).toMatchObject({ status: "delete_requested" }); + expect(await reload(other.id)).toMatchObject({ status: "active" }); + await service().tick(); + expect(deleted.sort()).toEqual([first.objectKey, second.objectKey].sort()); + }); + + it("requests deletion by issue without touching superseded rows", async () => { + const row = await seed({ status: "superseded" }); + await db.transaction(async (tx) => requestRestorePointDeletion(tx, { sourceIssueId: row.sourceIssueId! })); + expect(await reload(row.id)).toMatchObject({ status: "superseded" }); + }); + + it("schedules nothing when idle, and only the next deadline when restore points exist", async () => { + let task!: { run: (signal: AbortSignal) => Promise; nextRunAt?: () => number | null }; + const coordinator = { register: (_queue: string, registered: typeof task) => { task = registered; return { ready: Promise.resolve(), wake: vi.fn() }; } }; + registerGitRestorePointWork(coordinator as never, service(), () => {}); + await task.run(new AbortController().signal); + expect(task.nextRunAt?.()).toBeNull(); + const row = await seed({ closedDaysAgo: 10, deleteAfter: due() }); + await task.run(new AbortController().signal); + expect(task.nextRunAt?.()).toBe((await reload(row.id)).deleteAfter!.getTime()); + }); + + it("wakes on issue changes only while restore points exist", async () => { + let task!: { run: (signal: AbortSignal) => Promise; nextRunAt?: () => number | null }; + const wake = vi.fn(); + const coordinator = { register: (_queue: string, registered: typeof task) => { task = registered; return { ready: Promise.resolve(), wake }; } }; + const worker = registerGitRestorePointWork(coordinator as never, service(), () => {}); + await task.run(new AbortController().signal); + worker.issuesChanged(); + expect(wake).not.toHaveBeenCalled(); + await seed({ openChild: true }); + await task.run(new AbortController().signal); + worker.issuesChanged(); + expect(wake).toHaveBeenCalledOnce(); + }); + + describe("issue tree trigger", () => { + async function child(parentId: string, companyId: string, status = "blocked") { + const [row] = await db.insert(issues).values({ companyId, title: "Child", status, parentId }).returning(); + return row!; + } + + it("marks a parent's restore point due when its last open child closes", async () => { + const row = await seed(); + const open = await child(row.sourceIssueId!, row.companyId); + await db.update(executionWorkspaceRestorePoints).set({ deleteAfter: null }).where(eq(executionWorkspaceRestorePoints.id, row.id)); + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, open.id)); + expect((await reload(row.id)).deleteAfter!.getTime()).toBeLessThanOrEqual(Date.now()); + }); + + it("marks the former parent when a child is deleted or moved", async () => { + const deletedFrom = await seed(); + const movedFrom = await seed(); + const deleting = await child(deletedFrom.sourceIssueId!, deletedFrom.companyId); + const moving = await child(movedFrom.sourceIssueId!, movedFrom.companyId); + const [elsewhere] = await db.insert(issues).values({ companyId: movedFrom.companyId, title: "Other", status: "todo" }).returning(); + await db.update(executionWorkspaceRestorePoints).set({ deleteAfter: null }); + await db.delete(issues).where(eq(issues.id, deleting.id)); + await db.update(issues).set({ parentId: elsewhere!.id }).where(eq(issues.id, moving.id)); + expect((await reload(deletedFrom.id)).deleteAfter).not.toBeNull(); + expect((await reload(movedFrom.id)).deleteAfter).not.toBeNull(); + }); + + it("marks a restore point when its own source issue changes status", async () => { + const row = await seed({ issueStatus: "in_progress" }); + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, row.sourceIssueId!)); + expect((await reload(row.id)).deleteAfter).not.toBeNull(); + }); + + it("leaves unrelated, inactive and already due restore points alone", async () => { + const unrelated = await seed({ issueStatus: "in_progress" }); + const superseded = await seed({ status: "superseded", issueStatus: "in_progress" }); + const alreadyDue = await seed({ issueStatus: "in_progress", deleteAfter: new Date(now.getTime() - DAY_MS) }); + const [other] = await db.insert(issues).values({ companyId: unrelated.companyId, title: "Other", status: "todo" }).returning(); + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, other!.id)); + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, superseded.sourceIssueId!)); + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, alreadyDue.sourceIssueId!)); + expect((await reload(unrelated.id)).deleteAfter).toBeNull(); + expect((await reload(superseded.id)).deleteAfter).toBeNull(); + expect((await reload(alreadyDue.id)).deleteAfter!.getTime()).toBe(now.getTime() - DAY_MS); + }); + + it("keeps a restore point due when its tree closes between the worker's read and write", async () => { + const row = await seed({ deleteAfter: due() }); + const open = await child(row.sourceIssueId!, row.companyId); + const racing = gitRestorePointRetentionService(db, { + storage, + afterTreeRead: async () => { + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, open.id)); + }, + }); + expect(await racing.tick()).toMatchObject({ raced: 1, scheduled: 0 }); + const stillDue = await reload(row.id); + expect(stillDue.deleteAfter!.getTime()).toBeLessThanOrEqual(Date.now()); + await gitRestorePointRetentionService(db, { storage }).tick(); + const reviewed = await reload(row.id); + expect(reviewed.deleteAfter!.getTime() - reviewed.treeClosedAt!.getTime()).toBe(90 * DAY_MS); + }); + + it("does not expire a restore point whose tree reopens between the worker's read and write", async () => { + const row = await seed({ closedDaysAgo: 120, deleteAfter: due() }); + const racing = gitRestorePointRetentionService(db, { + storage, + afterTreeRead: async () => { + await db.update(issues).set({ status: "todo", completedAt: null }).where(eq(issues.id, row.sourceIssueId!)); + }, + }); + expect(await racing.tick()).toMatchObject({ raced: 1, expired: 0, deleted: 0 }); + expect(await reload(row.id)).toMatchObject({ status: "active" }); + await gitRestorePointRetentionService(db, { storage }).tick(); + expect(await reload(row.id)).toMatchObject({ status: "active", deleteAfter: null }); + expect(deleted).toEqual([]); + }); + + it("lets the worker schedule expiry once an open tree closes", async () => { + const row = await seed(); + const open = await child(row.sourceIssueId!, row.companyId); + await db.update(executionWorkspaceRestorePoints).set({ deleteAfter: due() }).where(eq(executionWorkspaceRestorePoints.id, row.id)); + const live = gitRestorePointRetentionService(db, { storage }); + await live.tick(); + expect((await reload(row.id)).deleteAfter).toBeNull(); + await db.update(issues).set({ status: "done", completedAt: new Date() }).where(eq(issues.id, open.id)); + await live.tick(); + const reviewed = await reload(row.id); + expect(reviewed.deleteAfter!.getTime() - reviewed.treeClosedAt!.getTime()).toBe(90 * DAY_MS); + }); + }); +}); diff --git a/server/src/config.ts b/server/src/config.ts index 62c40bbbcf1..23b1ee84c51 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -91,6 +91,7 @@ export interface Config { nativeHarnessBackupExpirationEnabled: boolean; nativeHarnessBackupExpirationDryRun: boolean; nativeHarnessBackupExpirationDays: number; + gitRestorePointRetentionDays: number; serveUi: boolean; uiDevMiddleware: boolean; secretsProvider: SecretProvider; @@ -337,6 +338,7 @@ export function loadConfig(): Config { const skillVersionRetentionKeepNewest = nonNegativeIntegerEnv("PAPERCLIP_SKILL_VERSION_RETENTION_KEEP", 0); const skillVersionRetentionGraceMinutes = nonNegativeIntegerEnv("PAPERCLIP_SKILL_VERSION_RETENTION_GRACE_MINUTES", 60); const nativeHarnessBackupExpirationDays = Math.max(1, nonNegativeIntegerEnv("PAPERCLIP_NATIVE_HARNESS_BACKUP_EXPIRATION_DAYS", 7)); + const gitRestorePointRetentionDays = Math.max(1, nonNegativeIntegerEnv("PAPERCLIP_GIT_RESTORE_POINT_RETENTION_DAYS", 90)); const bindValidationErrors = validateConfiguredBindMode({ deploymentMode, deploymentExposure, @@ -394,6 +396,7 @@ export function loadConfig(): Config { nativeHarnessBackupExpirationEnabled: process.env.PAPERCLIP_NATIVE_HARNESS_BACKUP_EXPIRATION_ENABLED !== "false", nativeHarnessBackupExpirationDryRun: process.env.PAPERCLIP_NATIVE_HARNESS_BACKUP_EXPIRATION_DRY_RUN === "true", nativeHarnessBackupExpirationDays, + gitRestorePointRetentionDays, serveUi: process.env.SERVE_UI !== undefined ? process.env.SERVE_UI === "true" diff --git a/server/src/index.ts b/server/src/index.ts index ed7417f4915..6b6de3cb71b 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -12,6 +12,7 @@ import { NATIVE_HARNESS_BACKUP_EXPIRATION_STARTUP_DELAY_MS, nativeHarnessBackupExpirationService, } from "./services/native-runtime/native-harness-backup-expiration.js"; +import { gitRestorePointRetentionService, registerGitRestorePointWork } from "./services/git-restore-point-ledger.js"; import { subscribeAllCompanyLiveEvents } from "./services/live-events.js"; import { DELIVERY_QUEUES } from "./services/delivery-work-notifications.js"; import { registerBudgetEnforcementWork, registerCostAccountingWork } from "./services/budget-enforcement-worker.js"; @@ -1497,9 +1498,21 @@ async function startServerWithDatabaseTeardown( logger.error({ err }, "merged pull-request confirmation sweep failed"); })); }; + const gitRestorePointWorker = registerGitRestorePointWork(deliveryWork, gitRestorePointRetentionService(db as any, { + storage: storageService, + retentionDays: config.gitRestorePointRetentionDays, + }), (result) => { + if (result.abandoned > 0 || result.expired > 0 || result.orphaned > 0 || result.deleted > 0 || result.failed > 0) { + logger.info(result, "git restore point retention"); + } + }); let lastTerminalWorkspaceSkipLogAt = 0; const terminalWorkspaceWorker = registerTerminalWorkspaceWork(deliveryWork, { ...terminalWorkspaces, + terminalWorkspaceWorkSettled: (hints) => { + terminalWorkspaces.terminalWorkspaceWorkSettled?.(hints); + gitRestorePointWorker.issuesChanged(); + }, sweepTerminalWorkspaces: async (limit, signal, options) => { const result = await terminalWorkspaces.sweepTerminalWorkspaces(limit, signal, options); if (result.archived > 0 || result.cleanupFailed > 0 || result.compacted > 0 || result.compactionFailed > 0) { diff --git a/server/src/services/company-deletion.ts b/server/src/services/company-deletion.ts index 30c524db9c2..432cad76e7a 100644 --- a/server/src/services/company-deletion.ts +++ b/server/src/services/company-deletion.ts @@ -4,6 +4,7 @@ import { withAccountHomeSecretMutationLock } from "@paperclipai/adapter-codex-lo import type { Db } from "@paperclipai/db"; import { eq, inArray } from "drizzle-orm"; import { createAgentLifecycle, processAgentLifecycle } from "./agent-lifecycle.js"; +import { requestRestorePointDeletion } from "./git-restore-point-ledger.js"; import { agentLifecycleCompanyDeletion } from "../modules/agent-lifecycle/company-deletion.js"; import { companies, @@ -109,6 +110,7 @@ export async function deleteCompany(db: Db, id: string) { await tx.delete(companyLogos).where(eq(companyLogos.companyId, id)); await tx.delete(assets).where(eq(assets.companyId, id)); await tx.delete(goals).where(eq(goals.companyId, id)); + await requestRestorePointDeletion(tx, { companyId: id }); await tx.delete(executionWorkspaces).where(eq(executionWorkspaces.companyId, id)); await tx.delete(projects).where(eq(projects.companyId, id)); await agentLifecycleCompanyDeletion.deleteCompanyData(tx, id); diff --git a/server/src/services/delivery-work-notifications.ts b/server/src/services/delivery-work-notifications.ts index f91df0318f1..2f3cb3d7a4d 100644 --- a/server/src/services/delivery-work-notifications.ts +++ b/server/src/services/delivery-work-notifications.ts @@ -38,6 +38,7 @@ export const DELIVERY_QUEUES = { feedback: "feedback-exports", chatCompletion: "chat-completions", connection: "connection-continuations", + gitRestorePoints: "git-restore-points", question: "question-responses", pluginLifecycle: "plugin-resource-lifecycle", toolAction: "tool-action-receipts", diff --git a/server/src/services/git-restore-point-ledger.ts b/server/src/services/git-restore-point-ledger.ts new file mode 100644 index 00000000000..2070e2f1b1e --- /dev/null +++ b/server/src/services/git-restore-point-ledger.ts @@ -0,0 +1,238 @@ +import { and, asc, eq, inArray, isNull, lt, lte, or, sql } from "drizzle-orm"; +import { executionWorkspaceRestorePoints, type Db } from "@paperclipai/db"; +import type { StorageService } from "../storage/types.js"; +import type { createDeliveryWorkCoordinator } from "./delivery-work-coordinator.js"; +import { DELIVERY_QUEUES, notifyDeliveryWork } from "./delivery-work-notifications.js"; + +export const GIT_RESTORE_POINT_RETRY_MS = 15 * 60 * 1000; +export const GIT_RESTORE_POINT_DEFAULT_RETENTION_DAYS = 90; +const DAY_MS = 24 * 60 * 60 * 1000; +const DEFAULT_PENDING_GRACE_MS = 60 * 60 * 1000; +const DEFAULT_BATCH = 50; + +type RestorePoint = typeof executionWorkspaceRestorePoints.$inferSelect; + +export type GitRestorePointRetentionResult = { + abandoned: number; + scheduled: number; + expired: number; + orphaned: number; + deleted: number; + failed: number; + raced: number; + truncated: boolean; +}; + +export type GitRestorePointRetentionOptions = { + storage: StorageService; + retentionDays?: number; + pendingGraceMs?: number; + batchSize?: number; + now?: () => Date; + beforeExpire?: (restorePoint: RestorePoint) => Promise; + afterTreeRead?: (restorePoint: RestorePoint) => Promise; +}; + +type TreeState = { exists: boolean; open: boolean; closedAt: Date | null }; + +export function gitRestorePointRetentionService(db: Db, options: GitRestorePointRetentionOptions) { + const retentionMs = Math.max(1, options.retentionDays ?? GIT_RESTORE_POINT_DEFAULT_RETENTION_DAYS) * DAY_MS; + const pendingGraceMs = options.pendingGraceMs ?? DEFAULT_PENDING_GRACE_MS; + const batchSize = options.batchSize ?? DEFAULT_BATCH; + const now = options.now ?? (() => new Date()); + + async function issueTreeState(row: RestorePoint): Promise { + if (!row.sourceIssueId) return { exists: false, open: false, closedAt: null }; + const result = await db.execute<{ total: number; open: number; closed_at: string | null }>(sql` + WITH RECURSIVE tree AS ( + SELECT id, status, completed_at, cancelled_at, updated_at FROM issues + WHERE company_id = ${row.companyId} AND id = ${row.sourceIssueId} + UNION + SELECT c.id, c.status, c.completed_at, c.cancelled_at, c.updated_at FROM issues c + JOIN tree p ON c.parent_id = p.id WHERE c.company_id = ${row.companyId} + ) + SELECT count(*)::int AS total, + count(*) FILTER (WHERE status NOT IN ('done', 'cancelled'))::int AS open, + max(CASE WHEN status = 'done' THEN coalesce(completed_at, updated_at) + WHEN status = 'cancelled' THEN coalesce(cancelled_at, updated_at) END) AS closed_at + FROM tree`); + const state = result[0]; + if (!state || state.total === 0) return { exists: false, open: false, closedAt: null }; + return { exists: true, open: state.open > 0, closedAt: state.closed_at ? new Date(state.closed_at) : null }; + } + + async function requestDeletion(ids: string[], at: Date) { + if (ids.length === 0) return; + await db.update(executionWorkspaceRestorePoints) + .set({ status: "delete_requested", updatedAt: at }) + .where(and(inArray(executionWorkspaceRestorePoints.id, ids), + inArray(executionWorkspaceRestorePoints.status, ["pending", "active"]))); + } + + async function evaluateActive(row: RestorePoint, at: Date, result: GitRestorePointRetentionResult) { + const tree = await issueTreeState(row); + await options.afterTreeRead?.(row); + const unchanged = and( + eq(executionWorkspaceRestorePoints.id, row.id), + eq(executionWorkspaceRestorePoints.status, "active"), + eq(executionWorkspaceRestorePoints.reviewGeneration, row.reviewGeneration), + ); + const deleteAfter = !tree.exists || tree.open || !tree.closedAt ? null : new Date(tree.closedAt.getTime() + retentionMs); + if (!tree.exists || (deleteAfter && deleteAfter.getTime() <= at.getTime())) { + const claimed = await db.update(executionWorkspaceRestorePoints) + .set({ status: tree.exists ? "expiring" : "delete_requested", lastError: null, updatedAt: at }) + .where(unchanged) + .returning(); + if (claimed.length === 0) { + result.raced += 1; + return; + } + if (!tree.exists) { + result.orphaned += 1; + return; + } + await finishExpiry(claimed[0]!, at, result); + return; + } + const updated = await db.update(executionWorkspaceRestorePoints) + .set({ treeClosedAt: tree.open ? null : tree.closedAt, deleteAfter, updatedAt: at }) + .where(unchanged) + .returning({ id: executionWorkspaceRestorePoints.id }); + if (updated.length === 0) result.raced += 1; + else result.scheduled += 1; + } + + async function finishExpiry(row: RestorePoint, at: Date, result: GitRestorePointRetentionResult) { + try { + await options.beforeExpire?.(row); + } catch (error) { + await db.update(executionWorkspaceRestorePoints) + .set({ lastError: error instanceof Error ? error.message.slice(0, 500) : "expire_failed", updatedAt: at }) + .where(and(eq(executionWorkspaceRestorePoints.id, row.id), eq(executionWorkspaceRestorePoints.status, "expiring"))); + result.failed += 1; + return; + } + await db.update(executionWorkspaceRestorePoints) + .set({ status: "delete_requested", lastError: null, updatedAt: at }) + .where(and(eq(executionWorkspaceRestorePoints.id, row.id), eq(executionWorkspaceRestorePoints.status, "expiring"))); + result.expired += 1; + } + + function retryable(status: "expiring" | "superseded" | "delete_requested" | Array<"superseded" | "delete_requested">, at: Date) { + return and( + Array.isArray(status) ? inArray(executionWorkspaceRestorePoints.status, status) : eq(executionWorkspaceRestorePoints.status, status), + or(isNull(executionWorkspaceRestorePoints.lastError), + lte(executionWorkspaceRestorePoints.updatedAt, new Date(at.getTime() - GIT_RESTORE_POINT_RETRY_MS))), + ); + } + + async function tick() { + const at = now(); + const result: GitRestorePointRetentionResult = { abandoned: 0, scheduled: 0, expired: 0, orphaned: 0, deleted: 0, failed: 0, raced: 0, truncated: false }; + + const abandoned = await db.select({ id: executionWorkspaceRestorePoints.id }).from(executionWorkspaceRestorePoints) + .where(and(eq(executionWorkspaceRestorePoints.status, "pending"), + lt(executionWorkspaceRestorePoints.createdAt, new Date(at.getTime() - pendingGraceMs)))) + .orderBy(asc(executionWorkspaceRestorePoints.createdAt)).limit(batchSize); + await requestDeletion(abandoned.map((row) => row.id), at); + result.abandoned = abandoned.length; + + const due = await db.select().from(executionWorkspaceRestorePoints) + .where(and(eq(executionWorkspaceRestorePoints.status, "active"), + sql`${executionWorkspaceRestorePoints.deleteAfter} <= greatest(${at.toISOString()}::timestamptz, clock_timestamp())`)) + .orderBy(asc(executionWorkspaceRestorePoints.deleteAfter), asc(executionWorkspaceRestorePoints.id)).limit(batchSize); + for (const row of due) await evaluateActive(row, at, result); + + const expiring = await db.select().from(executionWorkspaceRestorePoints) + .where(retryable("expiring", at)) + .orderBy(asc(executionWorkspaceRestorePoints.updatedAt), asc(executionWorkspaceRestorePoints.id)).limit(batchSize); + for (const row of expiring) await finishExpiry(row, at, result); + + const doomed = await db.select().from(executionWorkspaceRestorePoints) + .where(retryable(["superseded", "delete_requested"], at)) + .orderBy(asc(executionWorkspaceRestorePoints.updatedAt), asc(executionWorkspaceRestorePoints.id)).limit(batchSize); + for (const row of doomed) { + try { + await options.storage.deleteObject(row.companyId, row.objectKey); + if ((await options.storage.headObject(row.companyId, row.objectKey)).exists) throw new Error("restore_point_object_still_present"); + await db.update(executionWorkspaceRestorePoints) + .set({ status: "deleted", deletedAt: at, lastError: null, updatedAt: at }) + .where(eq(executionWorkspaceRestorePoints.id, row.id)); + result.deleted += 1; + } catch (error) { + await db.update(executionWorkspaceRestorePoints) + .set({ lastError: error instanceof Error ? error.message.slice(0, 500) : "delete_failed", updatedAt: at }) + .where(eq(executionWorkspaceRestorePoints.id, row.id)); + result.failed += 1; + } + } + result.truncated = abandoned.length === batchSize || due.length === batchSize + || expiring.length === batchSize || doomed.length === batchSize; + return result; + } + + async function nextDeadlineAt(): Promise { + const [row] = await db.select({ + deleteNow: sql`count(*) FILTER (WHERE ${executionWorkspaceRestorePoints.status} IN ('expiring', 'superseded', 'delete_requested') AND ${executionWorkspaceRestorePoints.lastError} IS NULL)::int`, + retryFrom: sql`min(${executionWorkspaceRestorePoints.updatedAt}) FILTER (WHERE ${executionWorkspaceRestorePoints.status} IN ('expiring', 'superseded', 'delete_requested') AND ${executionWorkspaceRestorePoints.lastError} IS NOT NULL)`, + pendingFrom: sql`min(${executionWorkspaceRestorePoints.createdAt}) FILTER (WHERE ${executionWorkspaceRestorePoints.status} = 'pending')`, + expiresAt: sql`min(${executionWorkspaceRestorePoints.deleteAfter}) FILTER (WHERE ${executionWorkspaceRestorePoints.status} = 'active')`, + }).from(executionWorkspaceRestorePoints); + const at = now().getTime(); + const deadlines: number[] = []; + if (row && row.deleteNow > 0) deadlines.push(at); + if (row?.retryFrom) deadlines.push(new Date(row.retryFrom).getTime() + GIT_RESTORE_POINT_RETRY_MS); + if (row?.pendingFrom) deadlines.push(new Date(row.pendingFrom).getTime() + pendingGraceMs); + if (row?.expiresAt) deadlines.push(new Date(row.expiresAt).getTime()); + return deadlines.length > 0 ? Math.min(...deadlines) : null; + } + + async function hasActive(): Promise { + const [row] = await db.select({ id: executionWorkspaceRestorePoints.id }).from(executionWorkspaceRestorePoints) + .where(eq(executionWorkspaceRestorePoints.status, "active")).limit(1); + return Boolean(row); + } + + return { tick, nextDeadlineAt, hasActive }; +} + +export function notifyGitRestorePointWork(transaction: object, hint?: string) { + return notifyDeliveryWork(transaction, DELIVERY_QUEUES.gitRestorePoints, hint); +} + +export async function requestRestorePointDeletion( + tx: Pick, + scope: { sourceIssueId: string } | { companyId: string }, +) { + await notifyGitRestorePointWork(tx, "sourceIssueId" in scope ? `issue:${scope.sourceIssueId}` : `company:${scope.companyId}`); + await tx.update(executionWorkspaceRestorePoints) + .set({ status: "delete_requested", updatedAt: new Date() }) + .where(and( + "sourceIssueId" in scope + ? eq(executionWorkspaceRestorePoints.sourceIssueId, scope.sourceIssueId) + : eq(executionWorkspaceRestorePoints.companyId, scope.companyId), + inArray(executionWorkspaceRestorePoints.status, ["pending", "active", "expiring"]), + )); +} + +export function registerGitRestorePointWork( + coordinator: ReturnType, + service: ReturnType, + onResult: (result: GitRestorePointRetentionResult) => void, +) { + let next: number | null = null; + let tracksActive = true; + const worker = coordinator.register(DELIVERY_QUEUES.gitRestorePoints, { + retryMs: GIT_RESTORE_POINT_RETRY_MS, + run: async () => { + next = null; + const result = await service.tick(); + onResult(result); + next = result.truncated ? Date.now() + 1000 : await service.nextDeadlineAt(); + tracksActive = await service.hasActive(); + }, + hasPending: async () => false, + nextRunAt: () => next, + }); + return { ...worker, issuesChanged: () => { if (tracksActive) worker.wake(); } }; +} diff --git a/server/src/services/issues.ts b/server/src/services/issues.ts index 9acfdf86074..b95d7058b04 100644 --- a/server/src/services/issues.ts +++ b/server/src/services/issues.ts @@ -12,6 +12,7 @@ import { type TaskWorkspaceSelection, type TaskWorkspaceIntent } from "@papercli import { executionWorkspaceService } from "./execution-workspaces.js"; import { notifyChatPublicationWork } from "./chat-work-notifications.js"; import { notifyTerminalWorkspaceWork } from "./terminal-workspace-work.js"; +import { requestRestorePointDeletion } from "./git-restore-point-ledger.js"; import { DELIVERY_QUEUES, notifyDeliveryWork } from "./delivery-work-notifications.js"; import { recordChatHandoff, recordChatCompletion, existingChatCompletionReply, acknowledgeChatCompletionReply } from "./chat-completion-delivery.js"; import { mirrorSlackBoardComment, slackBoardReplyBindings } from "./slack-board-messages.js"; @@ -11696,6 +11697,7 @@ export function issueService(db: Db) { let removedIssue; try { await notifyTerminalWorkspaceWork(tx, `issue:${id}`); + await requestRestorePointDeletion(tx, { sourceIssueId: id }); removedIssue = await tx .delete(issues) .where(eq(issues.id, id))