diff --git a/apps/server/database-grants.sql b/apps/server/database-grants.sql index ecb2c666..d7acad8e 100644 --- a/apps/server/database-grants.sql +++ b/apps/server/database-grants.sql @@ -77,7 +77,10 @@ ALTER TABLE connectors.connector_write OWNER TO test_owner; ALTER TABLE connectors.project_connection OWNER TO test_owner; ALTER TABLE copies.copy OWNER TO test_owner; ALTER TABLE copies.copy_proposal OWNER TO test_owner; +ALTER TABLE copies.copy_proposal_source OWNER TO test_owner; ALTER TABLE copies.copy_run OWNER TO test_owner; +ALTER TABLE copies.copy_source OWNER TO test_owner; +ALTER TABLE copies.copy_table_left OWNER TO test_owner; ALTER TABLE copies.project_copy OWNER TO test_owner; ALTER TABLE drizzle.__drizzle_migrations OWNER TO test_owner; ALTER SEQUENCE drizzle.__drizzle_migrations_id_seq OWNER TO test_owner; @@ -341,7 +344,9 @@ GRANT SELECT,INSERT,DELETE ON TABLE connectors.project_connection TO hub_company -- Capacity 2, U2, with the founder's word in the pull request of its own (data D11): a company's -- routes and its copies' runs turn a copy on, hold its run's lease and save where its pass stands, -- record each run and keep the newest, and release a copy to a Projeto and take it back. -GRANT SELECT,INSERT ON TABLE copies.copy TO hub_company; +-- O Sync de qualquer conector, with the founder's word in the pull request of its own (data D11): +-- Desligar ends, in the transaction that deletes the connection, the copy left with no source. +GRANT SELECT,INSERT,DELETE ON TABLE copies.copy TO hub_company; GRANT UPDATE(claim_token) ON TABLE copies.copy TO hub_company; GRANT UPDATE(claimed_until) ON TABLE copies.copy TO hub_company; GRANT UPDATE(pass) ON TABLE copies.copy TO hub_company; @@ -356,6 +361,9 @@ GRANT UPDATE(last_run_id) ON TABLE copies.copy TO hub_company; GRANT SELECT,INSERT ON TABLE copies.copy_proposal TO hub_company; GRANT UPDATE(state) ON TABLE copies.copy_proposal TO hub_company; GRANT UPDATE(copy_id) ON TABLE copies.copy_proposal TO hub_company; +-- O Sync de qualquer conector, with the founder's word in the pull request of its own (data D11): the +-- Builder's run proposes a copy over several connections; a proposal's source leaves by cascade. +GRANT SELECT,INSERT ON TABLE copies.copy_proposal_source TO hub_company; GRANT SELECT,INSERT,DELETE ON TABLE copies.copy_run TO hub_company; GRANT UPDATE(ended_at) ON TABLE copies.copy_run TO hub_company; GRANT UPDATE(outcome) ON TABLE copies.copy_run TO hub_company; @@ -363,6 +371,17 @@ GRANT UPDATE(reason) ON TABLE copies.copy_run TO hub_company; GRANT UPDATE(pages) ON TABLE copies.copy_run TO hub_company; GRANT UPDATE(read) ON TABLE copies.copy_run TO hub_company; GRANT UPDATE(written) ON TABLE copies.copy_run TO hub_company; +-- O Sync de qualquer conector, with the founder's word in the pull request of its own (data D11): a +-- copy's runs read and save where each of its connections stands and until when the provider asked +-- it to wait; a source leaves by cascade. Desligar writes down the table of a copy that ended while +-- the company's database did not answer, and drains the row once the table is dropped. +GRANT SELECT,INSERT ON TABLE copies.copy_source TO hub_company; +GRANT UPDATE(pass) ON TABLE copies.copy_source TO hub_company; +GRANT UPDATE(pass_started_at) ON TABLE copies.copy_source TO hub_company; +GRANT UPDATE("position") ON TABLE copies.copy_source TO hub_company; +GRANT UPDATE(watermark) ON TABLE copies.copy_source TO hub_company; +GRANT UPDATE(wait_until) ON TABLE copies.copy_source TO hub_company; +GRANT SELECT,INSERT,DELETE ON TABLE copies.copy_table_left TO hub_company; GRANT SELECT,INSERT,DELETE ON TABLE copies.project_copy TO hub_company; GRANT SELECT ON TABLE drizzle.__drizzle_migrations TO hub_runtime; GRANT SELECT,INSERT ON TABLE hub.starts TO hub_runtime; diff --git a/apps/server/migrations/20261111234347_sync_copy_sources/migration.sql b/apps/server/migrations/20261111234347_sync_copy_sources/migration.sql new file mode 100644 index 00000000..4d03b4a4 --- /dev/null +++ b/apps/server/migrations/20261111234347_sync_copy_sources/migration.sql @@ -0,0 +1,45 @@ +CREATE TABLE "copies"."copy_proposal_source" ( + "company_id" text NOT NULL, + "proposal_id" uuid, + "connector_id" text NOT NULL, + "connection_id" uuid, + CONSTRAINT "copy_proposal_source_pkey" PRIMARY KEY("proposal_id","connection_id") +); +--> statement-breakpoint +ALTER TABLE "copies"."copy_proposal_source" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE "copies"."copy_source" ( + "company_id" text NOT NULL, + "copy_id" uuid, + "connector_id" text NOT NULL, + "connection_id" uuid, + "account_ref" text, + "pass" integer DEFAULT 0 NOT NULL, + "pass_started_at" timestamp with time zone, + "position" jsonb, + "watermark" timestamp with time zone, + "wait_until" timestamp with time zone, + "created_at" timestamp with time zone NOT NULL, + CONSTRAINT "copy_source_pkey" PRIMARY KEY("copy_id","connection_id"), + CONSTRAINT "copy_source_copy_id_account_ref_key" UNIQUE("copy_id","account_ref"), + CONSTRAINT "copy_source_position" CHECK ("position" IS NULL OR jsonb_typeof("position") = 'object') +); +--> statement-breakpoint +ALTER TABLE "copies"."copy_source" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE "copies"."copy_table_left" ( + "company_id" text, + "copy_id" uuid, + "name" text NOT NULL, + CONSTRAINT "copy_table_left_pkey" PRIMARY KEY("company_id","copy_id"), + CONSTRAINT "copy_table_left_name" CHECK ("name" ~ '^[a-z][a-z0-9_]{0,39}$') +); +--> statement-breakpoint +ALTER TABLE "copies"."copy_table_left" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +ALTER TABLE "copies"."copy_proposal" ADD COLUMN "proved_calls" integer;--> statement-breakpoint +ALTER TABLE "copies"."copy_proposal_source" ADD CONSTRAINT "copy_proposal_source_proposal_fkey" FOREIGN KEY ("proposal_id") REFERENCES "copies"."copy_proposal"("id") ON DELETE CASCADE;--> statement-breakpoint +ALTER TABLE "copies"."copy_proposal_source" ADD CONSTRAINT "copy_proposal_source_connection_fkey" FOREIGN KEY ("company_id","connector_id","connection_id") REFERENCES "connectors"."connection"("company_id","connector_id","id") ON DELETE CASCADE;--> statement-breakpoint +ALTER TABLE "copies"."copy_source" ADD CONSTRAINT "copy_source_copy_fkey" FOREIGN KEY ("company_id","copy_id") REFERENCES "copies"."copy"("company_id","id") ON DELETE CASCADE;--> statement-breakpoint +ALTER TABLE "copies"."copy_source" ADD CONSTRAINT "copy_source_connection_fkey" FOREIGN KEY ("company_id","connector_id","connection_id") REFERENCES "connectors"."connection"("company_id","connector_id","id") ON DELETE CASCADE;--> statement-breakpoint +ALTER TABLE "copies"."copy_table_left" ADD CONSTRAINT "copy_table_left_company_id_fkey" FOREIGN KEY ("company_id") REFERENCES "auth"."company"("id") ON DELETE CASCADE;--> statement-breakpoint +CREATE POLICY "company_all" ON "copies"."copy_proposal_source" AS PERMISSIVE FOR ALL TO "hub_company" USING (company_id = nullif(current_setting('conexus.company_id', true), '')) WITH CHECK (company_id = nullif(current_setting('conexus.company_id', true), ''));--> statement-breakpoint +CREATE POLICY "company_all" ON "copies"."copy_source" AS PERMISSIVE FOR ALL TO "hub_company" USING (company_id = nullif(current_setting('conexus.company_id', true), '')) WITH CHECK (company_id = nullif(current_setting('conexus.company_id', true), ''));--> statement-breakpoint +CREATE POLICY "company_all" ON "copies"."copy_table_left" AS PERMISSIVE FOR ALL TO "hub_company" USING (company_id = nullif(current_setting('conexus.company_id', true), '')) WITH CHECK (company_id = nullif(current_setting('conexus.company_id', true), '')); \ No newline at end of file diff --git a/apps/server/migrations/20261111234347_sync_copy_sources/snapshot.json b/apps/server/migrations/20261111234347_sync_copy_sources/snapshot.json new file mode 100644 index 00000000..b1f63562 --- /dev/null +++ b/apps/server/migrations/20261111234347_sync_copy_sources/snapshot.json @@ -0,0 +1,9539 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "2e2e90ee-e859-4e6b-8f69-54dd30079999", + "prevIds": ["4d36c022-ab8d-4467-ba59-2548cebb07ff"], + "ddl": [ + { + "name": "builder", + "entityType": "schemas" + }, + { + "name": "apps", + "entityType": "schemas" + }, + { + "name": "connectors", + "entityType": "schemas" + }, + { + "name": "copies", + "entityType": "schemas" + }, + { + "name": "auth", + "entityType": "schemas" + }, + { + "name": "notifications", + "entityType": "schemas" + }, + { + "name": "operations", + "entityType": "schemas" + }, + { + "name": "projects", + "entityType": "schemas" + }, + { + "name": "requests", + "entityType": "schemas" + }, + { + "name": "hub", + "entityType": "schemas" + }, + { + "isRlsEnabled": true, + "name": "agent", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_conversation", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_tool", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_version", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_version_tool", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "assistant_conversation", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "conversation", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "company_account_kind", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "company_model", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "company_model_fallback", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "model_account", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "model_account_assignee", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "model_account_sign_in", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "observational_memory_models", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "person_model_default", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "tool", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "tool_version", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "app", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": false, + "name": "app_session", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "app_version", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "blob", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": false, + "name": "handoff", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "version_file", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "connection", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "connection_sign_in", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "connector_write", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "project_connection", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "copy", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_proposal", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_proposal_source", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_run", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_source", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_table_left", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "project_copy", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": false, + "name": "account", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "company", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "invitation", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "member", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "organization_role", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "rate_limit", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "session", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "user", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "verification", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "notification", + "entityType": "tables", + "schema": "notifications" + }, + { + "isRlsEnabled": true, + "name": "request_notice", + "entityType": "tables", + "schema": "notifications" + }, + { + "isRlsEnabled": true, + "name": "client", + "entityType": "tables", + "schema": "operations" + }, + { + "isRlsEnabled": true, + "name": "app_access", + "entityType": "tables", + "schema": "projects" + }, + { + "isRlsEnabled": true, + "name": "company_database", + "entityType": "tables", + "schema": "projects" + }, + { + "isRlsEnabled": true, + "name": "project", + "entityType": "tables", + "schema": "projects" + }, + { + "isRlsEnabled": true, + "name": "request", + "entityType": "tables", + "schema": "requests" + }, + { + "isRlsEnabled": false, + "name": "starts", + "entityType": "tables", + "schema": "hub" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "draft", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "active_version", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "active_by", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_run_at", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "draft", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_version_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "approval", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_revision", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "published_by", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "published_at", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_version_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "approval", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "connections", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "company_account_kind" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "company_account_kind" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "company_model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "builder", + "table": "company_model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'off'", + "generated": null, + "identity": null, + "name": "effort", + "entityType": "columns", + "schema": "builder", + "table": "company_model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "chain", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hint", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_by", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "limited_until", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_until", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "served_models", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "served_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "owner", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "statement_timestamp()", + "generated": null, + "identity": null, + "name": "poll_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "observer", + "entityType": "columns", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reflector", + "entityType": "columns", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effort", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'PRESET'", + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operation", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "current_version", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_id", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "live_version_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "published_version_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sending_version_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimed_until", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "database_ready", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host_label", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hub_session_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "environment", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "manifest", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "digest", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sent_by", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "blob" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sha256", + "entityType": "columns", + "schema": "apps", + "table": "blob" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bytes", + "entityType": "columns", + "schema": "apps", + "table": "blob" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "code_hash", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "binding_hash", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host_label", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hub_session_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "environment", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_id", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sha256", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "media_type", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_version", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_by", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_at", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tested_at", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tested_by", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_test", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_until", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_ref", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_label", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_revision", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "thread_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_call_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operation_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_hash", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_number", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "answer", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "approved_by", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exclusive", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_by", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_at", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "definition", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claim_token", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimed_until", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pass", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pass_started_at", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "watermark", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rows", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_run_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "definition", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proposed_by", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proved_rows", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proved_more", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proved_calls", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proposed_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proposal_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ended_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "outcome", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pages", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "read", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "written", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_ref", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pass", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pass_started_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "watermark", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wait_until", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_table_left" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_table_left" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "copies", + "table": "copy_table_left" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_by", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_at", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token_expires_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token_expires_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logo", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleting_since", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nickname", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "app_role", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inviter_id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mailed_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "superseded_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "replaces", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "permission", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "count", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_request", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "active_organization_id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "impersonated_by", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_verified", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "banned", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ban_reason", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ban_expires", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automation_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automation_name", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_code", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "run_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "read_at", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "read_at", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cnpj", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "legal_name", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "registered_at", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "statement_timestamp()", + "generated": null, + "identity": null, + "name": "granted_at", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "neon_project_id", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimed_until", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host_label", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleting_since", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_by", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "decided_by", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "always", + "name": "starts_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "hub", + "table": "starts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "entityType": "columns", + "schema": "hub", + "table": "starts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "hub", + "table": "starts" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "connector_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"name\" collate \"und-x-icu\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "connection_name_key", + "entityType": "indexes", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "connector_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "account_ref", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"account_ref\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "connection_account_key", + "entityType": "indexes", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "connector_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"exclusive\"", + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_connection_one_key", + "entityType": "indexes", + "schema": "connectors", + "table": "project_connection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" = 'OPEN'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "copy_proposal_open_name_key", + "entityType": "indexes", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "copy_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"ended_at\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "copy_run_open_key", + "entityType": "indexes", + "schema": "copies", + "table": "copy_run" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "copy_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "started_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "copy_run_copy_started_idx", + "entityType": "indexes", + "schema": "copies", + "table": "copy_run" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "account_user_id_idx", + "entityType": "indexes", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"email\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "coalesce(\"project_id\", '')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" = 'pending'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "invitation_pending_email_key", + "entityType": "indexes", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "invitation_email_idx", + "entityType": "indexes", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "member_user_id_idx", + "entityType": "indexes", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "role", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "organization_role_company_id_role_key", + "entityType": "indexes", + "schema": "auth", + "table": "organization_role" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "attempt_key", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "organization_role_company_id_attempt_key_key", + "entityType": "indexes", + "schema": "auth", + "table": "organization_role" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "session_user_id_idx", + "entityType": "indexes", + "schema": "auth", + "table": "session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "identifier", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "verification_identifier_idx", + "entityType": "indexes", + "schema": "auth", + "table": "verification" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "person_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "notification_person_created", + "entityType": "indexes", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "person_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "request_notice_person_created", + "entityType": "indexes", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"name\" collate \"und-x-icu\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_company_name_key", + "entityType": "indexes", + "schema": "projects", + "table": "project" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" = 'PENDING'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "request_open_key", + "entityType": "indexes", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_project_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id", "active_version"], + "schemaTo": "builder", + "tableTo": "agent_version", + "columnsTo": ["company_id", "agent_id", "number"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_active_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_conversation_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id"], + "schemaTo": "builder", + "tableTo": "agent", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_conversation_agent_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_conversation_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id"], + "schemaTo": "builder", + "tableTo": "agent", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_tool_agent_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["tool_id", "tool_version_id"], + "schemaTo": "builder", + "tableTo": "tool_version", + "columnsTo": ["tool_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_tool_tool_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "tool_version_id"], + "schemaTo": "builder", + "tableTo": "tool_version", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_tool_company_tool_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id"], + "schemaTo": "builder", + "tableTo": "agent", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_version_agent_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id", "number"], + "schemaTo": "builder", + "tableTo": "agent_version", + "columnsTo": ["company_id", "agent_id", "number"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_version_tool_agent_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "tool_version_id"], + "schemaTo": "builder", + "tableTo": "tool_version", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_version_tool_tool_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "assistant_conversation_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "assistant_conversation_project_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "assistant_conversation_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_project_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "company_account_kind_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "company_account_kind" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "company_model_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "company_model" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "company_model_fallback_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account" + }, + { + "nameExplicit": true, + "columns": ["account_id"], + "schemaTo": "builder", + "tableTo": "model_account", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_assignee_account_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_assignee_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_sign_in_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "observational_memory_models_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "person_model_default_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "person_model_default" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tool_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "tool_id"], + "schemaTo": "builder", + "tableTo": "tool", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tool_version_tool_fkey", + "entityType": "fks", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_project_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["project_id", "live_version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["project_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "app_live_version_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["project_id", "published_version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["project_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "app_published_version_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["project_id", "sending_version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["project_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "app_sending_version_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["hub_session_id"], + "schemaTo": "auth", + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_session_hub_session_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app_session" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "apps", + "tableTo": "app", + "columnsTo": ["project_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_version_project_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["hub_session_id"], + "schemaTo": "auth", + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "handoff_hub_session_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "handoff" + }, + { + "nameExplicit": true, + "columns": ["version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "version_file_version_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "version_file" + }, + { + "nameExplicit": true, + "columns": ["company_id", "sha256"], + "schemaTo": "apps", + "tableTo": "blob", + "columnsTo": ["company_id", "sha256"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "version_file_blob_fkey", + "entityType": "fks", + "schema": "apps", + "table": "version_file" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connection_company_id_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connection_sign_in_member_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connection_sign_in_company_id_connector_id_connection_id_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connector_write_company_id_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connector_write" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_connection_connection_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "project_connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_connection_project_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "project_connection" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_company_id_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_company_id_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_project_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "copy_proposal_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["proposal_id"], + "schemaTo": "copies", + "tableTo": "copy_proposal", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_source_proposal_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_source_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_run_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_run" + }, + { + "nameExplicit": true, + "columns": ["company_id", "copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_source_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_source_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_source" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_table_left_company_id_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_table_left" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_copy_project_fkey", + "entityType": "fks", + "schema": "copies", + "table": "project_copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_copy_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "project_copy" + }, + { + "nameExplicit": false, + "columns": ["user_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "account_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": false, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "invitation_company_id_company_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": false, + "columns": ["inviter_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "invitation_inviter_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": false, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "member_company_id_company_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": false, + "columns": ["user_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "member_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": false, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "organization_role_company_id_company_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "organization_role" + }, + { + "nameExplicit": false, + "columns": ["user_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "session_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "session" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "notification_company_id_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "notification_member_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_notice_member_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": ["request_id"], + "schemaTo": "requests", + "tableTo": "request", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_notice_request_id_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_access_company_id_project_id_fkey", + "entityType": "fks", + "schema": "projects", + "table": "app_access" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_company_id_fkey", + "entityType": "fks", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": true, + "columns": ["company_id", "requested_by"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_member_fkey", + "entityType": "fks", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_project_id_fkey", + "entityType": "fks", + "schema": "requests", + "table": "request" + }, + { + "columns": ["agent_id", "tool_version_id"], + "nameExplicit": true, + "name": "agent_tool_pkey", + "entityType": "pks", + "schema": "builder", + "table": "agent_tool" + }, + { + "columns": ["agent_id", "number"], + "nameExplicit": true, + "name": "agent_version_pkey", + "entityType": "pks", + "schema": "builder", + "table": "agent_version" + }, + { + "columns": ["agent_id", "number", "tool_version_id"], + "nameExplicit": true, + "name": "agent_version_tool_pkey", + "entityType": "pks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "columns": ["company_id", "kind"], + "nameExplicit": false, + "name": "company_account_kind_pkey", + "entityType": "pks", + "schema": "builder", + "table": "company_account_kind" + }, + { + "columns": ["account_id", "person_id"], + "nameExplicit": false, + "name": "model_account_assignee_pkey", + "entityType": "pks", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "columns": ["company_id", "person_id"], + "nameExplicit": false, + "name": "person_model_default_pkey", + "entityType": "pks", + "schema": "builder", + "table": "person_model_default" + }, + { + "columns": ["company_id", "sha256"], + "nameExplicit": true, + "name": "blob_pkey", + "entityType": "pks", + "schema": "apps", + "table": "blob" + }, + { + "columns": ["version_id", "path"], + "nameExplicit": true, + "name": "version_file_pkey", + "entityType": "pks", + "schema": "apps", + "table": "version_file" + }, + { + "columns": ["company_id", "thread_id", "tool_call_id"], + "nameExplicit": false, + "name": "connector_write_pkey", + "entityType": "pks", + "schema": "connectors", + "table": "connector_write" + }, + { + "columns": ["project_id", "connection_id"], + "nameExplicit": false, + "name": "project_connection_pkey", + "entityType": "pks", + "schema": "connectors", + "table": "project_connection" + }, + { + "columns": ["proposal_id", "connection_id"], + "nameExplicit": false, + "name": "copy_proposal_source_pkey", + "entityType": "pks", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "columns": ["copy_id", "connection_id"], + "nameExplicit": false, + "name": "copy_source_pkey", + "entityType": "pks", + "schema": "copies", + "table": "copy_source" + }, + { + "columns": ["company_id", "copy_id"], + "nameExplicit": false, + "name": "copy_table_left_pkey", + "entityType": "pks", + "schema": "copies", + "table": "copy_table_left" + }, + { + "columns": ["project_id", "copy_id"], + "nameExplicit": false, + "name": "project_copy_pkey", + "entityType": "pks", + "schema": "copies", + "table": "project_copy" + }, + { + "columns": ["project_id", "person_id"], + "nameExplicit": false, + "name": "app_access_pkey", + "entityType": "pks", + "schema": "projects", + "table": "app_access" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "agent_pkey", + "schema": "builder", + "table": "agent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "agent_conversation_pkey", + "schema": "builder", + "table": "agent_conversation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "assistant_conversation_pkey", + "schema": "builder", + "table": "assistant_conversation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "conversation_pkey", + "schema": "builder", + "table": "conversation", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "company_model_pkey", + "schema": "builder", + "table": "company_model", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "company_model_fallback_pkey", + "schema": "builder", + "table": "company_model_fallback", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "model_account_pkey", + "schema": "builder", + "table": "model_account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "model_account_sign_in_pkey", + "schema": "builder", + "table": "model_account_sign_in", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "observational_memory_models_pkey", + "schema": "builder", + "table": "observational_memory_models", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "tool_pkey", + "schema": "builder", + "table": "tool", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "tool_version_pkey", + "schema": "builder", + "table": "tool_version", + "entityType": "pks" + }, + { + "columns": ["project_id"], + "nameExplicit": false, + "name": "app_pkey", + "schema": "apps", + "table": "app", + "entityType": "pks" + }, + { + "columns": ["token_hash"], + "nameExplicit": false, + "name": "app_session_pkey", + "schema": "apps", + "table": "app_session", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "app_version_pkey", + "schema": "apps", + "table": "app_version", + "entityType": "pks" + }, + { + "columns": ["code_hash"], + "nameExplicit": false, + "name": "handoff_pkey", + "schema": "apps", + "table": "handoff", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "connection_pkey", + "schema": "connectors", + "table": "connection", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "connection_sign_in_pkey", + "schema": "connectors", + "table": "connection_sign_in", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "copy_pkey", + "schema": "copies", + "table": "copy", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "copy_proposal_pkey", + "schema": "copies", + "table": "copy_proposal", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "copy_run_pkey", + "schema": "copies", + "table": "copy_run", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "account_pkey", + "schema": "auth", + "table": "account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "company_pkey", + "schema": "auth", + "table": "company", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "invitation_pkey", + "schema": "auth", + "table": "invitation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "member_pkey", + "schema": "auth", + "table": "member", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "organization_role_pkey", + "schema": "auth", + "table": "organization_role", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "rate_limit_pkey", + "schema": "auth", + "table": "rate_limit", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "session_pkey", + "schema": "auth", + "table": "session", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "user_pkey", + "schema": "auth", + "table": "user", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "verification_pkey", + "schema": "auth", + "table": "verification", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "notification_pkey", + "schema": "notifications", + "table": "notification", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "request_notice_pkey", + "schema": "notifications", + "table": "request_notice", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "client_pkey", + "schema": "operations", + "table": "client", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "company_database_pkey", + "schema": "projects", + "table": "company_database", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "project_pkey", + "schema": "projects", + "table": "project", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "request_pkey", + "schema": "requests", + "table": "request", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "starts_pkey", + "schema": "hub", + "table": "starts", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "agent_company_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["agent_id", "tool_id"], + "nullsNotDistinct": false, + "name": "agent_tool_agent_id_tool_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["agent_id", "source_revision"], + "nullsNotDistinct": false, + "name": "agent_version_agent_id_source_revision_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id", "number"], + "nullsNotDistinct": false, + "name": "agent_version_company_id_agent_id_number_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "conversation_attempt_key", + "entityType": "uniques", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "model_account_attempt_key", + "entityType": "uniques", + "schema": "builder", + "table": "model_account" + }, + { + "nameExplicit": true, + "columns": ["company_id", "slug"], + "nullsNotDistinct": false, + "name": "tool_company_id_slug_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "tool_company_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool" + }, + { + "nameExplicit": true, + "columns": ["tool_id", "number"], + "nullsNotDistinct": false, + "name": "tool_version_tool_id_number_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["tool_id", "id"], + "nullsNotDistinct": false, + "name": "tool_version_tool_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "tool_version_company_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["project_id", "number"], + "nullsNotDistinct": false, + "name": "app_version_project_id_number_key", + "entityType": "uniques", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["project_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "app_version_project_id_attempt_key_key", + "entityType": "uniques", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["project_id", "id"], + "nullsNotDistinct": false, + "name": "app_version_project_id_id_key", + "entityType": "uniques", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "connection_attempt_key", + "entityType": "uniques", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "id"], + "nullsNotDistinct": false, + "name": "connection_company_connector_id_key", + "entityType": "uniques", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "name"], + "nullsNotDistinct": false, + "name": "copy_company_id_name_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "copy_company_id_attempt_key_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "copy_company_id_id_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["copy_id", "account_ref"], + "nullsNotDistinct": false, + "name": "copy_source_copy_id_account_ref_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "invitation_company_id_attempt_key_key", + "entityType": "uniques", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "user_id"], + "nullsNotDistinct": false, + "name": "member_company_id_user_id_key", + "entityType": "uniques", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": true, + "columns": ["company_id", "run_id"], + "nullsNotDistinct": false, + "name": "notification_run_key", + "entityType": "uniques", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": ["request_id", "person_id", "kind"], + "nullsNotDistinct": false, + "name": "request_notice_key", + "entityType": "uniques", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "project_company_id_attempt_key_key", + "entityType": "uniques", + "schema": "projects", + "table": "project" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "project_company_id_id_key", + "entityType": "uniques", + "schema": "projects", + "table": "project" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "request_attempt_key", + "entityType": "uniques", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": false, + "columns": ["slug"], + "nullsNotDistinct": false, + "name": "company_slug_key", + "schema": "auth", + "table": "company", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["attempt_key"], + "nullsNotDistinct": false, + "name": "company_attempt_key_key", + "schema": "auth", + "table": "company", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["nickname"], + "nullsNotDistinct": false, + "name": "company_nickname_key", + "schema": "auth", + "table": "company", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["key"], + "nullsNotDistinct": false, + "name": "rate_limit_key_key", + "schema": "auth", + "table": "rate_limit", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["token"], + "nullsNotDistinct": false, + "name": "session_token_key", + "schema": "auth", + "table": "session", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["email"], + "nullsNotDistinct": false, + "name": "user_email_key", + "schema": "auth", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["cnpj"], + "nullsNotDistinct": false, + "name": "client_cnpj_key", + "schema": "operations", + "table": "client", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["attempt_key"], + "nullsNotDistinct": false, + "name": "client_attempt_key_key", + "schema": "operations", + "table": "client", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["neon_project_id"], + "nullsNotDistinct": false, + "name": "company_database_neon_project_id_key", + "schema": "projects", + "table": "company_database", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["host_label"], + "nullsNotDistinct": false, + "name": "project_host_label_key", + "schema": "projects", + "table": "project", + "entityType": "uniques" + }, + { + "value": "\"revision\" > 0", + "name": "agent_revision_positive", + "entityType": "checks", + "schema": "builder", + "table": "agent" + }, + { + "value": "\"approval\" in ('ASK', 'AUTO')", + "name": "agent_tool_approval", + "entityType": "checks", + "schema": "builder", + "table": "agent_tool" + }, + { + "value": "\"number\" > 0", + "name": "agent_version_number_positive", + "entityType": "checks", + "schema": "builder", + "table": "agent_version" + }, + { + "value": "\"approval\" in ('ASK', 'AUTO')", + "name": "agent_version_tool_approval", + "entityType": "checks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "value": "\"kind\" IN ('claude_subscription', 'google_cliproxy', 'openai_codex')", + "name": "company_account_kind_kind", + "entityType": "checks", + "schema": "builder", + "table": "company_account_kind" + }, + { + "value": "\"effort\" IN ('off', 'low', 'medium', 'high', 'xhigh', 'max')", + "name": "company_model_effort", + "entityType": "checks", + "schema": "builder", + "table": "company_model" + }, + { + "value": "\"kind\" IN ('api_key', 'claude_subscription', 'google_cliproxy', 'openai_codex')", + "name": "model_account_kind", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "\"state\" IN ('ready', 'paused', 'refused')", + "name": "model_account_state", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "char_length(\"label\") BETWEEN 1 AND 60", + "name": "model_account_label_length", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "\"position\" >= 0", + "name": "model_account_position", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "(\"kind\" = 'api_key') = (\"hint\" IS NOT NULL)", + "name": "model_account_hint", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "\"owner\" IN ('company', 'me')", + "name": "model_account_sign_in_owner", + "entityType": "checks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "value": "\"kind\" IN ('claude_subscription', 'google_cliproxy', 'openai_codex')", + "name": "model_account_sign_in_kind", + "entityType": "checks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "value": "char_length(\"label\") BETWEEN 1 AND 60", + "name": "model_account_sign_in_label_length", + "entityType": "checks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "value": "\"effort\" IN ('off', 'low', 'medium', 'high', 'xhigh', 'max')", + "name": "person_model_default_effort", + "entityType": "checks", + "schema": "builder", + "table": "person_model_default" + }, + { + "value": "\"kind\" in ('PRESET', 'CODE')", + "name": "tool_kind", + "entityType": "checks", + "schema": "builder", + "table": "tool" + }, + { + "value": "(\"kind\" = 'PRESET') = (\"operation\" is not null)", + "name": "tool_operation_by_kind", + "entityType": "checks", + "schema": "builder", + "table": "tool" + }, + { + "value": "(\"sending_version_id\" IS NULL) = (\"claimed_until\" IS NULL)", + "name": "app_sending_has_claim", + "entityType": "checks", + "schema": "apps", + "table": "app" + }, + { + "value": "\"environment\" IN ('preview', 'published')", + "name": "app_session_environment", + "entityType": "checks", + "schema": "apps", + "table": "app_session" + }, + { + "value": "\"state\" IN ('sending', 'ready', 'failed', 'pruning')", + "name": "app_version_state", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"state\" <> 'failed' OR \"failure\" IS NOT NULL", + "name": "app_version_failed_has_failure", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"number\" > 0", + "name": "app_version_number_positive", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"digest\" ~ '^[0-9a-f]{64}$'", + "name": "app_version_digest_form", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"sha256\" ~ '^[0-9a-f]{64}$'", + "name": "blob_sha256_form", + "entityType": "checks", + "schema": "apps", + "table": "blob" + }, + { + "value": "octet_length(\"bytes\") <= 10485760", + "name": "blob_size", + "entityType": "checks", + "schema": "apps", + "table": "blob" + }, + { + "value": "\"environment\" IN ('preview', 'published')", + "name": "handoff_environment", + "entityType": "checks", + "schema": "apps", + "table": "handoff" + }, + { + "value": "\"size\" BETWEEN 0 AND 10485760", + "name": "version_file_size", + "entityType": "checks", + "schema": "apps", + "table": "version_file" + }, + { + "value": "char_length(\"name\") BETWEEN 1 AND 60 AND \"name\" = btrim(\"name\")", + "name": "connection_name", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "\"state\" IN ('NEW', 'ACTIVE', 'NEEDS_REAUTH')", + "name": "connection_state", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "(\"account_ref\" IS NULL) = (\"account_label\" IS NULL)\n AND (\"account_label\" IS NULL OR char_length(\"account_label\") BETWEEN 1 AND 120)", + "name": "connection_account", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "jsonb_typeof(\"notes\") = 'object' AND octet_length(\"notes\"::text) <= 32768", + "name": "connection_notes", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "\"connector_id\" ~ '^[a-z][a-z0-9-]{1,31}$'", + "name": "connection_connector_id", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "\"name\" IS NULL OR (char_length(\"name\") BETWEEN 1 AND 60 AND \"name\" = btrim(\"name\"))", + "name": "connection_sign_in_name", + "entityType": "checks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "value": "(\"connection_id\" IS NULL) <> (\"name\" IS NULL)\n AND (\"connection_id\" IS NULL) = (\"connection_revision\" IS NULL)", + "name": "connection_sign_in_target", + "entityType": "checks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "value": "(\"agent_id\" is not null and \"version_number\" is not null and \"person_id\" is null) or (\"agent_id\" is null and \"version_number\" is null and \"person_id\" is not null)", + "name": "connector_write_speaker", + "entityType": "checks", + "schema": "connectors", + "table": "connector_write" + }, + { + "value": "\"state\" in ('SENDING', 'DONE', 'REFUSED', 'UNCERTAIN')", + "name": "connector_write_state", + "entityType": "checks", + "schema": "connectors", + "table": "connector_write" + }, + { + "value": "(\"claim_token\" IS NULL) = (\"claimed_until\" IS NULL)", + "name": "copy_claim", + "entityType": "checks", + "schema": "copies", + "table": "copy" + }, + { + "value": "\"name\" ~ '^[a-z][a-z0-9_]{0,39}$'", + "name": "copy_name", + "entityType": "checks", + "schema": "copies", + "table": "copy" + }, + { + "value": "jsonb_typeof(\"definition\") = 'object'", + "name": "copy_definition", + "entityType": "checks", + "schema": "copies", + "table": "copy" + }, + { + "value": "\"name\" ~ '^[a-z][a-z0-9_]{0,39}$'", + "name": "copy_proposal_name", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "jsonb_typeof(\"definition\") = 'object'", + "name": "copy_proposal_definition", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "\"proved_rows\" BETWEEN 0 AND 50", + "name": "copy_proposal_proved_rows", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "\"state\" IN ('OPEN', 'ACCEPTED', 'DISMISSED')", + "name": "copy_proposal_state", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "\"state\" = 'ACCEPTED' OR \"copy_id\" IS NULL", + "name": "copy_proposal_copy", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "(\"ended_at\" IS NULL) = (\"outcome\" IS NULL)", + "name": "copy_run_ended", + "entityType": "checks", + "schema": "copies", + "table": "copy_run" + }, + { + "value": "\"outcome\" IS NULL OR \"outcome\" IN ('COMPLETE', 'PARTIAL', 'ERROR', 'INTERRUPTED')", + "name": "copy_run_outcome", + "entityType": "checks", + "schema": "copies", + "table": "copy_run" + }, + { + "value": "\"position\" IS NULL OR jsonb_typeof(\"position\") = 'object'", + "name": "copy_source_position", + "entityType": "checks", + "schema": "copies", + "table": "copy_source" + }, + { + "value": "\"name\" ~ '^[a-z][a-z0-9_]{0,39}$'", + "name": "copy_table_left_name", + "entityType": "checks", + "schema": "copies", + "table": "copy_table_left" + }, + { + "value": "\"nickname\" ~ '^[a-z0-9]+(-[a-z0-9]+)*$' and char_length(\"nickname\") BETWEEN 3 AND 30", + "name": "company_nickname_form", + "entityType": "checks", + "schema": "auth", + "table": "company" + }, + { + "value": "(\"project_id\" is null) = (\"role\" is not null)", + "name": "invitation_kind", + "entityType": "checks", + "schema": "auth", + "table": "invitation" + }, + { + "value": "\"kind\" in ('AUTOMATION_DONE', 'AUTOMATION_FAILED', 'AUTOMATION_PAUSED')", + "name": "notification_kind", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" <> 'AUTOMATION_DONE' or (\"conversation_id\" is not null and \"failure_code\" is null)", + "name": "notification_done", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" <> 'AUTOMATION_FAILED' or (\"failure_code\" is not null and \"failure_code\" in ('MODEL_NO_ACCOUNT', 'MODEL_CALL_FAILED', 'MODEL_REFUSED', 'MODEL_ANSWER_CUT', 'MACHINE_UNAVAILABLE', 'MACHINE_LOST', 'HUB_UPDATED', 'INTERNAL_UNEXPECTED', 'DATABASE_UNAVAILABLE', 'INTERRUPTED', 'SCHEDULE_PUBLISH_FAILED'))", + "name": "notification_failed", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" <> 'AUTOMATION_PAUSED' or (\"conversation_id\" is null and \"failure_code\" is null)", + "name": "notification_paused", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" in ('REQUEST_OPENED', 'REQUEST_DECIDED')", + "name": "request_notice_kind", + "entityType": "checks", + "schema": "notifications", + "table": "request_notice" + }, + { + "value": "\"cnpj\" ~ '^[0-9A-Z]{12}[0-9]{2}$'", + "name": "client_cnpj_format", + "entityType": "checks", + "schema": "operations", + "table": "client" + }, + { + "value": "char_length(\"legal_name\") BETWEEN 1 AND 150", + "name": "client_legal_name_length", + "entityType": "checks", + "schema": "operations", + "table": "client" + }, + { + "value": "\"revision\" >= 0", + "name": "client_revision_not_negative", + "entityType": "checks", + "schema": "operations", + "table": "client" + }, + { + "value": "\"state\" IN ('creating', 'ready')", + "name": "company_database_state", + "entityType": "checks", + "schema": "projects", + "table": "company_database" + }, + { + "value": "(\"state\" = 'ready') = (\"neon_project_id\" IS NOT NULL)", + "name": "company_database_ready_has_project", + "entityType": "checks", + "schema": "projects", + "table": "company_database" + }, + { + "value": "(\"state\" = 'creating') = (\"claimed_until\" IS NOT NULL)", + "name": "company_database_creating_has_claim", + "entityType": "checks", + "schema": "projects", + "table": "company_database" + }, + { + "value": "\"host_label\" ~ '^[a-z0-9]+(-[a-z0-9]+)*--[a-z0-9]+(-[a-z0-9]+)*$' and char_length(\"host_label\") <= 63", + "name": "project_host_label_form", + "entityType": "checks", + "schema": "projects", + "table": "project" + }, + { + "value": "char_length(\"name\") BETWEEN 1 AND 100", + "name": "project_name_length", + "entityType": "checks", + "schema": "projects", + "table": "project" + }, + { + "value": "\"kind\" in ('PUBLISH_APP_VERSION')", + "name": "request_kind", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"number\" > 0", + "name": "request_number", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "char_length(\"message\") <= 280", + "name": "request_message", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"state\" in ('PENDING', 'APPROVED', 'DECLINED', 'CANCELLED', 'SUPERSEDED')", + "name": "request_state", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "(\"state\" in ('PENDING', 'CANCELLED')) = (\"decided_by\" is null)", + "name": "request_decided", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"reason\" is null or \"state\" = 'DECLINED'", + "name": "request_reason", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"version\" ~ '^v[0-9]+\\.[0-9]+\\.[0-9]+$'", + "name": "starts_version_format", + "entityType": "checks", + "schema": "hub", + "table": "starts" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_agent_companies"], + "using": "true", + "withCheck": null, + "name": "agent_companies_select", + "entityType": "policies", + "schema": "builder", + "table": "agent" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_conversation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_tool" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_version" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "conversation" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "company_select", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "operator_insert", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "company_model" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id is null or person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id is null or person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "model_account" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_model_seals"], + "using": "true", + "withCheck": null, + "name": "model_seals_select", + "entityType": "policies", + "schema": "builder", + "table": "model_account" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_model_seals"], + "using": "true", + "withCheck": null, + "name": "model_seals_select", + "entityType": "policies", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "person_model_default" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "tool" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "tool_version" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_companies"], + "using": "true", + "withCheck": null, + "name": "companies_select", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "app_version" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "app_version" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "app_version" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "blob" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "blob" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "blob" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "version_file" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "version_file" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "version_file" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "connection" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_connection_seals"], + "using": "true", + "withCheck": null, + "name": "connection_seals_select", + "entityType": "policies", + "schema": "connectors", + "table": "connection" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "connector_write" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "project_connection" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_proposal" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_run" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_source" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_table_left" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "project_copy" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_people"], + "using": "true", + "withCheck": null, + "name": "app_people_select", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_person"], + "using": "exists (select 1 from auth.member m where m.company_id = company.id and m.user_id = nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "person_select", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = company.id)", + "withCheck": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = company.id)", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_insert", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and id = nullif(current_setting('conexus.company_id', true), '')", + "name": "operator_update", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_person"], + "using": "inviter_id = nullif(current_setting('conexus.person_id', true), '')\n or lower(email) = (select u.email from auth.\"user\" u where u.id = nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "person_select", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "id = nullif(current_setting('conexus.invitation_id', true), '')", + "withCheck": "id = nullif(current_setting('conexus.invitation_id', true), '')", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'owner' or company_id = nullif(current_setting('conexus.company_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and role = 'owner'", + "name": "operator_insert", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and role = 'owner'", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and role = 'owner'", + "name": "operator_update", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_person"], + "using": "user_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": null, + "name": "person_select", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = member.company_id)", + "withCheck": null, + "name": "invitation_select", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_invitation"], + "using": null, + "withCheck": "user_id = nullif(current_setting('conexus.person_id', true), '')\n and exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = member.company_id)", + "name": "invitation_insert", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'owner' or company_id = nullif(current_setting('conexus.company_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "organization_role" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_insert", + "entityType": "policies", + "schema": "auth", + "table": "organization_role" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_runtime"], + "using": "true", + "withCheck": "true", + "name": "runtime_all", + "entityType": "policies", + "schema": "auth", + "table": "session" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "user_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "user_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "session" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "user_id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i join auth.\"user\" u on u.email = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and u.id = session.user_id)", + "withCheck": "user_id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i join auth.\"user\" u on u.email = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and u.id = session.user_id)", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "session" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_runtime"], + "using": "true", + "withCheck": "true", + "name": "runtime_sign_in", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from auth.invitation i where i.inviter_id = \"user\".id and i.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from projects.app_access a where a.person_id = \"user\".id and a.company_id = nullif(current_setting('conexus.company_id', true), ''))", + "withCheck": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from auth.invitation i where i.inviter_id = \"user\".id and i.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from projects.app_access a where a.person_id = \"user\".id and a.company_id = nullif(current_setting('conexus.company_id', true), ''))", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_person"], + "using": "id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "id = nullif(current_setting('conexus.person_id', true), '')", + "name": "person_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '')\n and (i.inviter_id = \"user\".id or lower(i.email) = \"user\".email))", + "withCheck": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '')\n and (i.inviter_id = \"user\".id or lower(i.email) = \"user\".email))", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_administrators"], + "using": "role = 'admin'", + "withCheck": null, + "name": "administrators_select", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'admin'\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.role = 'owner'))", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'admin'\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.role = 'owner'))", + "name": "operator_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "notifications", + "table": "notification" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": null, + "name": "company_select", + "entityType": "policies", + "schema": "notifications", + "table": "request_notice" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_update", + "entityType": "policies", + "schema": "notifications", + "table": "request_notice" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_company"], + "using": null, + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_insert", + "entityType": "policies", + "schema": "notifications", + "table": "request_notice" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_insert", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_update", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_invitation"], + "using": null, + "withCheck": "exists (select 1 from auth.invitation i\n join auth.\"user\" u on lower(u.email) = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = app_access.company_id\n and i.project_id = app_access.project_id and i.app_role is not distinct from app_access.role\n and u.id = app_access.person_id)", + "name": "invitation_insert", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i\n join auth.\"user\" u on lower(u.email) = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.project_id = app_access.project_id\n and u.id = app_access.person_id)", + "withCheck": null, + "name": "invitation_select", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_people"], + "using": "true", + "withCheck": null, + "name": "app_people_select", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "projects", + "table": "company_database" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "projects", + "table": "company_database" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "projects", + "table": "company_database" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_hosts"], + "using": "true", + "withCheck": null, + "name": "hosts_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_people"], + "using": "true", + "withCheck": null, + "name": "app_people_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '')\n and i.company_id = project.company_id and i.project_id = project.id)", + "withCheck": null, + "name": "invitation_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "requests", + "table": "request" + } + ], + "renames": [] +} diff --git a/apps/server/migrations/20261111234429_sync_copy_sources_grants/migration.sql b/apps/server/migrations/20261111234429_sync_copy_sources_grants/migration.sql new file mode 100644 index 00000000..c3ad61b8 --- /dev/null +++ b/apps/server/migrations/20261111234429_sync_copy_sources_grants/migration.sql @@ -0,0 +1,15 @@ +-- Custom SQL: Drizzle cannot generate a grant (data D5). O Sync de qualquer conector, with the founder's +-- word in the pull request of its own (data D11): a copy's runs read and save where each of its +-- connections stands and until when the provider asked it to wait; Desligar ends, in the transaction +-- that deletes the connection, the copy left with no source, writes down its table when the company's +-- database does not answer, and drains those rows once each table is dropped; the Builder's run +-- proposes a copy over several connections. A source leaves only by its foreign keys' cascade. +GRANT SELECT, INSERT ON TABLE copies.copy_source TO hub_company; +--> statement-breakpoint +GRANT UPDATE (pass, pass_started_at, position, watermark, wait_until) ON TABLE copies.copy_source TO hub_company; +--> statement-breakpoint +GRANT DELETE ON TABLE copies.copy TO hub_company; +--> statement-breakpoint +GRANT SELECT, INSERT, DELETE ON TABLE copies.copy_table_left TO hub_company; +--> statement-breakpoint +GRANT SELECT, INSERT ON TABLE copies.copy_proposal_source TO hub_company; diff --git a/apps/server/migrations/20261111234429_sync_copy_sources_grants/snapshot.json b/apps/server/migrations/20261111234429_sync_copy_sources_grants/snapshot.json new file mode 100644 index 00000000..42ab4f90 --- /dev/null +++ b/apps/server/migrations/20261111234429_sync_copy_sources_grants/snapshot.json @@ -0,0 +1,9539 @@ +{ + "id": "a3baed99-717a-4048-a477-9d35df6a0cee", + "prevIds": ["2e2e90ee-e859-4e6b-8f69-54dd30079999"], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "name": "builder", + "entityType": "schemas" + }, + { + "name": "apps", + "entityType": "schemas" + }, + { + "name": "connectors", + "entityType": "schemas" + }, + { + "name": "copies", + "entityType": "schemas" + }, + { + "name": "auth", + "entityType": "schemas" + }, + { + "name": "notifications", + "entityType": "schemas" + }, + { + "name": "operations", + "entityType": "schemas" + }, + { + "name": "projects", + "entityType": "schemas" + }, + { + "name": "requests", + "entityType": "schemas" + }, + { + "name": "hub", + "entityType": "schemas" + }, + { + "isRlsEnabled": true, + "name": "agent", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_conversation", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_tool", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_version", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "agent_version_tool", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "assistant_conversation", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "conversation", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "company_account_kind", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "company_model", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "company_model_fallback", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "model_account", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "model_account_assignee", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "model_account_sign_in", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "observational_memory_models", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "person_model_default", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "tool", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "tool_version", + "entityType": "tables", + "schema": "builder" + }, + { + "isRlsEnabled": true, + "name": "app", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": false, + "name": "app_session", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "app_version", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "blob", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": false, + "name": "handoff", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "version_file", + "entityType": "tables", + "schema": "apps" + }, + { + "isRlsEnabled": true, + "name": "connection", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "connection_sign_in", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "connector_write", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "project_connection", + "entityType": "tables", + "schema": "connectors" + }, + { + "isRlsEnabled": true, + "name": "copy", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_proposal", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_proposal_source", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_run", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_source", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "copy_table_left", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": true, + "name": "project_copy", + "entityType": "tables", + "schema": "copies" + }, + { + "isRlsEnabled": false, + "name": "account", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "company", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "invitation", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "member", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "organization_role", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "rate_limit", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "session", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "user", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "verification", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": true, + "name": "notification", + "entityType": "tables", + "schema": "notifications" + }, + { + "isRlsEnabled": true, + "name": "request_notice", + "entityType": "tables", + "schema": "notifications" + }, + { + "isRlsEnabled": true, + "name": "client", + "entityType": "tables", + "schema": "operations" + }, + { + "isRlsEnabled": true, + "name": "app_access", + "entityType": "tables", + "schema": "projects" + }, + { + "isRlsEnabled": true, + "name": "company_database", + "entityType": "tables", + "schema": "projects" + }, + { + "isRlsEnabled": true, + "name": "project", + "entityType": "tables", + "schema": "projects" + }, + { + "isRlsEnabled": true, + "name": "request", + "entityType": "tables", + "schema": "requests" + }, + { + "isRlsEnabled": false, + "name": "starts", + "entityType": "tables", + "schema": "hub" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "draft", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "active_version", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "active_by", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_run_at", + "entityType": "columns", + "schema": "builder", + "table": "agent" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "draft", + "entityType": "columns", + "schema": "builder", + "table": "agent_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_version_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "approval", + "entityType": "columns", + "schema": "builder", + "table": "agent_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_revision", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "published_by", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "published_at", + "entityType": "columns", + "schema": "builder", + "table": "agent_version" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_version_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "approval", + "entityType": "columns", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "connections", + "entityType": "columns", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "company_account_kind" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "company_account_kind" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "company_model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "builder", + "table": "company_model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'off'", + "generated": null, + "identity": null, + "name": "effort", + "entityType": "columns", + "schema": "builder", + "table": "company_model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "chain", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hint", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_by", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "limited_until", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_until", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "served_models", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "served_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "owner", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "statement_timestamp()", + "generated": null, + "identity": null, + "name": "poll_at", + "entityType": "columns", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "observer", + "entityType": "columns", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reflector", + "entityType": "columns", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effort", + "entityType": "columns", + "schema": "builder", + "table": "person_model_default" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'PRESET'", + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operation", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "current_version", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "builder", + "table": "tool" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_id", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "builder", + "table": "tool_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "live_version_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "published_version_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sending_version_id", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimed_until", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "database_ready", + "entityType": "columns", + "schema": "apps", + "table": "app" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host_label", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hub_session_id", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "environment", + "entityType": "columns", + "schema": "apps", + "table": "app_session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "manifest", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "digest", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sent_by", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "apps", + "table": "app_version" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "blob" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sha256", + "entityType": "columns", + "schema": "apps", + "table": "blob" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bytes", + "entityType": "columns", + "schema": "apps", + "table": "blob" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "code_hash", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "binding_hash", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host_label", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hub_session_id", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "environment", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "apps", + "table": "handoff" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_id", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sha256", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "media_type", + "entityType": "columns", + "schema": "apps", + "table": "version_file" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_version", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_by", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linked_at", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tested_at", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tested_by", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_test", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_until", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_ref", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_label", + "entityType": "columns", + "schema": "connectors", + "table": "connection" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_revision", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sealed", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "thread_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_call_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operation_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_hash", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_number", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "answer", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "approved_by", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "connectors", + "table": "connector_write" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exclusive", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_by", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_at", + "entityType": "columns", + "schema": "connectors", + "table": "project_connection" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "definition", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_hash", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claim_token", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimed_until", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pass", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pass_started_at", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "watermark", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rows", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_run_id", + "entityType": "columns", + "schema": "copies", + "table": "copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "definition", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proposed_by", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proved_rows", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proved_more", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proved_calls", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proposed_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "proposal_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ended_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "outcome", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pages", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "read", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "written", + "entityType": "columns", + "schema": "copies", + "table": "copy_run" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connector_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_ref", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pass", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pass_started_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "watermark", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wait_until", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "copies", + "table": "copy_source" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_table_left" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "copy_table_left" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "copies", + "table": "copy_table_left" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "copy_id", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_by", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "granted_at", + "entityType": "columns", + "schema": "copies", + "table": "project_copy" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token_expires_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token_expires_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logo", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleting_since", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nickname", + "entityType": "columns", + "schema": "auth", + "table": "company" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "app_role", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inviter_id", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mailed_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "superseded_at", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "replaces", + "entityType": "columns", + "schema": "auth", + "table": "invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "member" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "permission", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "organization_role" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "count", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_request", + "entityType": "columns", + "schema": "auth", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "active_organization_id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "impersonated_by", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_verified", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "banned", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ban_reason", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ban_expires", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automation_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automation_name", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_code", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "run_id", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "read_at", + "entityType": "columns", + "schema": "notifications", + "table": "notification" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "read_at", + "entityType": "columns", + "schema": "notifications", + "table": "request_notice" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cnpj", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "legal_name", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "revision", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "registered_at", + "entityType": "columns", + "schema": "operations", + "table": "client" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "person_id", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "statement_timestamp()", + "generated": null, + "identity": null, + "name": "granted_at", + "entityType": "columns", + "schema": "projects", + "table": "app_access" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "neon_project_id", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimed_until", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host", + "entityType": "columns", + "schema": "projects", + "table": "company_database" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host_label", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleting_since", + "entityType": "columns", + "schema": "projects", + "table": "project" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attempt_key", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "company_id", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_by", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "decided_by", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "requests", + "table": "request" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "always", + "name": "starts_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "hub", + "table": "starts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "entityType": "columns", + "schema": "hub", + "table": "starts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "hub", + "table": "starts" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "connector_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"name\" collate \"und-x-icu\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "connection_name_key", + "entityType": "indexes", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "connector_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "account_ref", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"account_ref\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "connection_account_key", + "entityType": "indexes", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "connector_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"exclusive\"", + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_connection_one_key", + "entityType": "indexes", + "schema": "connectors", + "table": "project_connection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" = 'OPEN'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "copy_proposal_open_name_key", + "entityType": "indexes", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "copy_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"ended_at\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "copy_run_open_key", + "entityType": "indexes", + "schema": "copies", + "table": "copy_run" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "copy_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "started_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "copy_run_copy_started_idx", + "entityType": "indexes", + "schema": "copies", + "table": "copy_run" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "account_user_id_idx", + "entityType": "indexes", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"email\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "coalesce(\"project_id\", '')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" = 'pending'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "invitation_pending_email_key", + "entityType": "indexes", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "invitation_email_idx", + "entityType": "indexes", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "member_user_id_idx", + "entityType": "indexes", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "role", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "organization_role_company_id_role_key", + "entityType": "indexes", + "schema": "auth", + "table": "organization_role" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "attempt_key", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "organization_role_company_id_attempt_key_key", + "entityType": "indexes", + "schema": "auth", + "table": "organization_role" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "session_user_id_idx", + "entityType": "indexes", + "schema": "auth", + "table": "session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "identifier", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "verification_identifier_idx", + "entityType": "indexes", + "schema": "auth", + "table": "verification" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "person_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "notification_person_created", + "entityType": "indexes", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "person_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "request_notice_person_created", + "entityType": "indexes", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"name\" collate \"und-x-icu\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_company_name_key", + "entityType": "indexes", + "schema": "projects", + "table": "project" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "company_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" = 'PENDING'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "request_open_key", + "entityType": "indexes", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_project_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id", "active_version"], + "schemaTo": "builder", + "tableTo": "agent_version", + "columnsTo": ["company_id", "agent_id", "number"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_active_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_conversation_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id"], + "schemaTo": "builder", + "tableTo": "agent", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_conversation_agent_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_conversation_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id"], + "schemaTo": "builder", + "tableTo": "agent", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_tool_agent_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["tool_id", "tool_version_id"], + "schemaTo": "builder", + "tableTo": "tool_version", + "columnsTo": ["tool_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_tool_tool_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "tool_version_id"], + "schemaTo": "builder", + "tableTo": "tool_version", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_tool_company_tool_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id"], + "schemaTo": "builder", + "tableTo": "agent", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_version_agent_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id", "number"], + "schemaTo": "builder", + "tableTo": "agent_version", + "columnsTo": ["company_id", "agent_id", "number"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "agent_version_tool_agent_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "tool_version_id"], + "schemaTo": "builder", + "tableTo": "tool_version", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "agent_version_tool_tool_version_fkey", + "entityType": "fks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "assistant_conversation_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "assistant_conversation_project_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "assistant_conversation_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_project_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "company_account_kind_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "company_account_kind" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "company_model_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "company_model" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "company_model_fallback_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account" + }, + { + "nameExplicit": true, + "columns": ["account_id"], + "schemaTo": "builder", + "tableTo": "model_account", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_assignee_account_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_assignee_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_account_sign_in_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "observational_memory_models_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "person_model_default_member_fkey", + "entityType": "fks", + "schema": "builder", + "table": "person_model_default" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tool_company_id_fkey", + "entityType": "fks", + "schema": "builder", + "table": "tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "tool_id"], + "schemaTo": "builder", + "tableTo": "tool", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tool_version_tool_fkey", + "entityType": "fks", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_project_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["project_id", "live_version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["project_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "app_live_version_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["project_id", "published_version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["project_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "app_published_version_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["project_id", "sending_version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["project_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "app_sending_version_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app" + }, + { + "nameExplicit": true, + "columns": ["hub_session_id"], + "schemaTo": "auth", + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_session_hub_session_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app_session" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "apps", + "tableTo": "app", + "columnsTo": ["project_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_version_project_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["hub_session_id"], + "schemaTo": "auth", + "tableTo": "session", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "handoff_hub_session_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "handoff" + }, + { + "nameExplicit": true, + "columns": ["version_id"], + "schemaTo": "apps", + "tableTo": "app_version", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "version_file_version_id_fkey", + "entityType": "fks", + "schema": "apps", + "table": "version_file" + }, + { + "nameExplicit": true, + "columns": ["company_id", "sha256"], + "schemaTo": "apps", + "tableTo": "blob", + "columnsTo": ["company_id", "sha256"], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "version_file_blob_fkey", + "entityType": "fks", + "schema": "apps", + "table": "version_file" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connection_company_id_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connection_sign_in_member_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connection_sign_in_company_id_connector_id_connection_id_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "connector_write_company_id_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "connector_write" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_connection_connection_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "project_connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_connection_project_fkey", + "entityType": "fks", + "schema": "connectors", + "table": "project_connection" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_company_id_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_company_id_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_project_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "copy_proposal_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "nameExplicit": true, + "columns": ["proposal_id"], + "schemaTo": "copies", + "tableTo": "copy_proposal", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_source_proposal_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_proposal_source_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_run_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_run" + }, + { + "nameExplicit": true, + "columns": ["company_id", "copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_source_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "connection_id"], + "schemaTo": "connectors", + "tableTo": "connection", + "columnsTo": ["company_id", "connector_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_source_connection_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_source" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "copy_table_left_company_id_fkey", + "entityType": "fks", + "schema": "copies", + "table": "copy_table_left" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_copy_project_fkey", + "entityType": "fks", + "schema": "copies", + "table": "project_copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "copy_id"], + "schemaTo": "copies", + "tableTo": "copy", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_copy_copy_fkey", + "entityType": "fks", + "schema": "copies", + "table": "project_copy" + }, + { + "nameExplicit": false, + "columns": ["user_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "account_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": false, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "invitation_company_id_company_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": false, + "columns": ["inviter_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "invitation_inviter_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": false, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "member_company_id_company_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": false, + "columns": ["user_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "RESTRICT", + "name": "member_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": false, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "organization_role_company_id_company_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "organization_role" + }, + { + "nameExplicit": false, + "columns": ["user_id"], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "session_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "session" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "notification_company_id_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "notification_member_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_notice_member_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": ["request_id"], + "schemaTo": "requests", + "tableTo": "request", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_notice_request_id_fkey", + "entityType": "fks", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": ["company_id", "project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["company_id", "id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "app_access_company_id_project_id_fkey", + "entityType": "fks", + "schema": "projects", + "table": "app_access" + }, + { + "nameExplicit": true, + "columns": ["company_id"], + "schemaTo": "auth", + "tableTo": "company", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_company_id_fkey", + "entityType": "fks", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": true, + "columns": ["company_id", "requested_by"], + "schemaTo": "auth", + "tableTo": "member", + "columnsTo": ["company_id", "user_id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_member_fkey", + "entityType": "fks", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": true, + "columns": ["project_id"], + "schemaTo": "projects", + "tableTo": "project", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "request_project_id_fkey", + "entityType": "fks", + "schema": "requests", + "table": "request" + }, + { + "columns": ["agent_id", "tool_version_id"], + "nameExplicit": true, + "name": "agent_tool_pkey", + "entityType": "pks", + "schema": "builder", + "table": "agent_tool" + }, + { + "columns": ["agent_id", "number"], + "nameExplicit": true, + "name": "agent_version_pkey", + "entityType": "pks", + "schema": "builder", + "table": "agent_version" + }, + { + "columns": ["agent_id", "number", "tool_version_id"], + "nameExplicit": true, + "name": "agent_version_tool_pkey", + "entityType": "pks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "columns": ["company_id", "kind"], + "nameExplicit": false, + "name": "company_account_kind_pkey", + "entityType": "pks", + "schema": "builder", + "table": "company_account_kind" + }, + { + "columns": ["account_id", "person_id"], + "nameExplicit": false, + "name": "model_account_assignee_pkey", + "entityType": "pks", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "columns": ["company_id", "person_id"], + "nameExplicit": false, + "name": "person_model_default_pkey", + "entityType": "pks", + "schema": "builder", + "table": "person_model_default" + }, + { + "columns": ["company_id", "sha256"], + "nameExplicit": true, + "name": "blob_pkey", + "entityType": "pks", + "schema": "apps", + "table": "blob" + }, + { + "columns": ["version_id", "path"], + "nameExplicit": true, + "name": "version_file_pkey", + "entityType": "pks", + "schema": "apps", + "table": "version_file" + }, + { + "columns": ["company_id", "thread_id", "tool_call_id"], + "nameExplicit": false, + "name": "connector_write_pkey", + "entityType": "pks", + "schema": "connectors", + "table": "connector_write" + }, + { + "columns": ["project_id", "connection_id"], + "nameExplicit": false, + "name": "project_connection_pkey", + "entityType": "pks", + "schema": "connectors", + "table": "project_connection" + }, + { + "columns": ["proposal_id", "connection_id"], + "nameExplicit": false, + "name": "copy_proposal_source_pkey", + "entityType": "pks", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "columns": ["copy_id", "connection_id"], + "nameExplicit": false, + "name": "copy_source_pkey", + "entityType": "pks", + "schema": "copies", + "table": "copy_source" + }, + { + "columns": ["company_id", "copy_id"], + "nameExplicit": false, + "name": "copy_table_left_pkey", + "entityType": "pks", + "schema": "copies", + "table": "copy_table_left" + }, + { + "columns": ["project_id", "copy_id"], + "nameExplicit": false, + "name": "project_copy_pkey", + "entityType": "pks", + "schema": "copies", + "table": "project_copy" + }, + { + "columns": ["project_id", "person_id"], + "nameExplicit": false, + "name": "app_access_pkey", + "entityType": "pks", + "schema": "projects", + "table": "app_access" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "agent_pkey", + "schema": "builder", + "table": "agent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "agent_conversation_pkey", + "schema": "builder", + "table": "agent_conversation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "assistant_conversation_pkey", + "schema": "builder", + "table": "assistant_conversation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "conversation_pkey", + "schema": "builder", + "table": "conversation", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "company_model_pkey", + "schema": "builder", + "table": "company_model", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "company_model_fallback_pkey", + "schema": "builder", + "table": "company_model_fallback", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "model_account_pkey", + "schema": "builder", + "table": "model_account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "model_account_sign_in_pkey", + "schema": "builder", + "table": "model_account_sign_in", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "observational_memory_models_pkey", + "schema": "builder", + "table": "observational_memory_models", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "tool_pkey", + "schema": "builder", + "table": "tool", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "tool_version_pkey", + "schema": "builder", + "table": "tool_version", + "entityType": "pks" + }, + { + "columns": ["project_id"], + "nameExplicit": false, + "name": "app_pkey", + "schema": "apps", + "table": "app", + "entityType": "pks" + }, + { + "columns": ["token_hash"], + "nameExplicit": false, + "name": "app_session_pkey", + "schema": "apps", + "table": "app_session", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "app_version_pkey", + "schema": "apps", + "table": "app_version", + "entityType": "pks" + }, + { + "columns": ["code_hash"], + "nameExplicit": false, + "name": "handoff_pkey", + "schema": "apps", + "table": "handoff", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "connection_pkey", + "schema": "connectors", + "table": "connection", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "connection_sign_in_pkey", + "schema": "connectors", + "table": "connection_sign_in", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "copy_pkey", + "schema": "copies", + "table": "copy", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "copy_proposal_pkey", + "schema": "copies", + "table": "copy_proposal", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "copy_run_pkey", + "schema": "copies", + "table": "copy_run", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "account_pkey", + "schema": "auth", + "table": "account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "company_pkey", + "schema": "auth", + "table": "company", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "invitation_pkey", + "schema": "auth", + "table": "invitation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "member_pkey", + "schema": "auth", + "table": "member", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "organization_role_pkey", + "schema": "auth", + "table": "organization_role", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "rate_limit_pkey", + "schema": "auth", + "table": "rate_limit", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "session_pkey", + "schema": "auth", + "table": "session", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "user_pkey", + "schema": "auth", + "table": "user", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "verification_pkey", + "schema": "auth", + "table": "verification", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "notification_pkey", + "schema": "notifications", + "table": "notification", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "request_notice_pkey", + "schema": "notifications", + "table": "request_notice", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "client_pkey", + "schema": "operations", + "table": "client", + "entityType": "pks" + }, + { + "columns": ["company_id"], + "nameExplicit": false, + "name": "company_database_pkey", + "schema": "projects", + "table": "company_database", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "project_pkey", + "schema": "projects", + "table": "project", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "request_pkey", + "schema": "requests", + "table": "request", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "starts_pkey", + "schema": "hub", + "table": "starts", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "agent_company_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent" + }, + { + "nameExplicit": true, + "columns": ["agent_id", "tool_id"], + "nullsNotDistinct": false, + "name": "agent_tool_agent_id_tool_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent_tool" + }, + { + "nameExplicit": true, + "columns": ["agent_id", "source_revision"], + "nullsNotDistinct": false, + "name": "agent_version_agent_id_source_revision_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "agent_id", "number"], + "nullsNotDistinct": false, + "name": "agent_version_company_id_agent_id_number_key", + "entityType": "uniques", + "schema": "builder", + "table": "agent_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "person_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "conversation_attempt_key", + "entityType": "uniques", + "schema": "builder", + "table": "conversation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "model_account_attempt_key", + "entityType": "uniques", + "schema": "builder", + "table": "model_account" + }, + { + "nameExplicit": true, + "columns": ["company_id", "slug"], + "nullsNotDistinct": false, + "name": "tool_company_id_slug_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "tool_company_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool" + }, + { + "nameExplicit": true, + "columns": ["tool_id", "number"], + "nullsNotDistinct": false, + "name": "tool_version_tool_id_number_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["tool_id", "id"], + "nullsNotDistinct": false, + "name": "tool_version_tool_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "tool_version_company_id_id_key", + "entityType": "uniques", + "schema": "builder", + "table": "tool_version" + }, + { + "nameExplicit": true, + "columns": ["project_id", "number"], + "nullsNotDistinct": false, + "name": "app_version_project_id_number_key", + "entityType": "uniques", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["project_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "app_version_project_id_attempt_key_key", + "entityType": "uniques", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["project_id", "id"], + "nullsNotDistinct": false, + "name": "app_version_project_id_id_key", + "entityType": "uniques", + "schema": "apps", + "table": "app_version" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "connection_attempt_key", + "entityType": "uniques", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "connector_id", "id"], + "nullsNotDistinct": false, + "name": "connection_company_connector_id_key", + "entityType": "uniques", + "schema": "connectors", + "table": "connection" + }, + { + "nameExplicit": true, + "columns": ["company_id", "name"], + "nullsNotDistinct": false, + "name": "copy_company_id_name_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "copy_company_id_attempt_key_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "copy_company_id_id_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy" + }, + { + "nameExplicit": true, + "columns": ["copy_id", "account_ref"], + "nullsNotDistinct": false, + "name": "copy_source_copy_id_account_ref_key", + "entityType": "uniques", + "schema": "copies", + "table": "copy_source" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "invitation_company_id_attempt_key_key", + "entityType": "uniques", + "schema": "auth", + "table": "invitation" + }, + { + "nameExplicit": true, + "columns": ["company_id", "user_id"], + "nullsNotDistinct": false, + "name": "member_company_id_user_id_key", + "entityType": "uniques", + "schema": "auth", + "table": "member" + }, + { + "nameExplicit": true, + "columns": ["company_id", "run_id"], + "nullsNotDistinct": false, + "name": "notification_run_key", + "entityType": "uniques", + "schema": "notifications", + "table": "notification" + }, + { + "nameExplicit": true, + "columns": ["request_id", "person_id", "kind"], + "nullsNotDistinct": false, + "name": "request_notice_key", + "entityType": "uniques", + "schema": "notifications", + "table": "request_notice" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "project_company_id_attempt_key_key", + "entityType": "uniques", + "schema": "projects", + "table": "project" + }, + { + "nameExplicit": true, + "columns": ["company_id", "id"], + "nullsNotDistinct": false, + "name": "project_company_id_id_key", + "entityType": "uniques", + "schema": "projects", + "table": "project" + }, + { + "nameExplicit": true, + "columns": ["company_id", "attempt_key"], + "nullsNotDistinct": false, + "name": "request_attempt_key", + "entityType": "uniques", + "schema": "requests", + "table": "request" + }, + { + "nameExplicit": false, + "columns": ["slug"], + "nullsNotDistinct": false, + "name": "company_slug_key", + "schema": "auth", + "table": "company", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["attempt_key"], + "nullsNotDistinct": false, + "name": "company_attempt_key_key", + "schema": "auth", + "table": "company", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["nickname"], + "nullsNotDistinct": false, + "name": "company_nickname_key", + "schema": "auth", + "table": "company", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["key"], + "nullsNotDistinct": false, + "name": "rate_limit_key_key", + "schema": "auth", + "table": "rate_limit", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["token"], + "nullsNotDistinct": false, + "name": "session_token_key", + "schema": "auth", + "table": "session", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["email"], + "nullsNotDistinct": false, + "name": "user_email_key", + "schema": "auth", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["cnpj"], + "nullsNotDistinct": false, + "name": "client_cnpj_key", + "schema": "operations", + "table": "client", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["attempt_key"], + "nullsNotDistinct": false, + "name": "client_attempt_key_key", + "schema": "operations", + "table": "client", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["neon_project_id"], + "nullsNotDistinct": false, + "name": "company_database_neon_project_id_key", + "schema": "projects", + "table": "company_database", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": ["host_label"], + "nullsNotDistinct": false, + "name": "project_host_label_key", + "schema": "projects", + "table": "project", + "entityType": "uniques" + }, + { + "value": "\"revision\" > 0", + "name": "agent_revision_positive", + "entityType": "checks", + "schema": "builder", + "table": "agent" + }, + { + "value": "\"approval\" in ('ASK', 'AUTO')", + "name": "agent_tool_approval", + "entityType": "checks", + "schema": "builder", + "table": "agent_tool" + }, + { + "value": "\"number\" > 0", + "name": "agent_version_number_positive", + "entityType": "checks", + "schema": "builder", + "table": "agent_version" + }, + { + "value": "\"approval\" in ('ASK', 'AUTO')", + "name": "agent_version_tool_approval", + "entityType": "checks", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "value": "\"kind\" IN ('claude_subscription', 'google_cliproxy', 'openai_codex')", + "name": "company_account_kind_kind", + "entityType": "checks", + "schema": "builder", + "table": "company_account_kind" + }, + { + "value": "\"effort\" IN ('off', 'low', 'medium', 'high', 'xhigh', 'max')", + "name": "company_model_effort", + "entityType": "checks", + "schema": "builder", + "table": "company_model" + }, + { + "value": "\"kind\" IN ('api_key', 'claude_subscription', 'google_cliproxy', 'openai_codex')", + "name": "model_account_kind", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "\"state\" IN ('ready', 'paused', 'refused')", + "name": "model_account_state", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "char_length(\"label\") BETWEEN 1 AND 60", + "name": "model_account_label_length", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "\"position\" >= 0", + "name": "model_account_position", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "(\"kind\" = 'api_key') = (\"hint\" IS NOT NULL)", + "name": "model_account_hint", + "entityType": "checks", + "schema": "builder", + "table": "model_account" + }, + { + "value": "\"owner\" IN ('company', 'me')", + "name": "model_account_sign_in_owner", + "entityType": "checks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "value": "\"kind\" IN ('claude_subscription', 'google_cliproxy', 'openai_codex')", + "name": "model_account_sign_in_kind", + "entityType": "checks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "value": "char_length(\"label\") BETWEEN 1 AND 60", + "name": "model_account_sign_in_label_length", + "entityType": "checks", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "value": "\"effort\" IN ('off', 'low', 'medium', 'high', 'xhigh', 'max')", + "name": "person_model_default_effort", + "entityType": "checks", + "schema": "builder", + "table": "person_model_default" + }, + { + "value": "\"kind\" in ('PRESET', 'CODE')", + "name": "tool_kind", + "entityType": "checks", + "schema": "builder", + "table": "tool" + }, + { + "value": "(\"kind\" = 'PRESET') = (\"operation\" is not null)", + "name": "tool_operation_by_kind", + "entityType": "checks", + "schema": "builder", + "table": "tool" + }, + { + "value": "(\"sending_version_id\" IS NULL) = (\"claimed_until\" IS NULL)", + "name": "app_sending_has_claim", + "entityType": "checks", + "schema": "apps", + "table": "app" + }, + { + "value": "\"environment\" IN ('preview', 'published')", + "name": "app_session_environment", + "entityType": "checks", + "schema": "apps", + "table": "app_session" + }, + { + "value": "\"state\" IN ('sending', 'ready', 'failed', 'pruning')", + "name": "app_version_state", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"state\" <> 'failed' OR \"failure\" IS NOT NULL", + "name": "app_version_failed_has_failure", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"number\" > 0", + "name": "app_version_number_positive", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"digest\" ~ '^[0-9a-f]{64}$'", + "name": "app_version_digest_form", + "entityType": "checks", + "schema": "apps", + "table": "app_version" + }, + { + "value": "\"sha256\" ~ '^[0-9a-f]{64}$'", + "name": "blob_sha256_form", + "entityType": "checks", + "schema": "apps", + "table": "blob" + }, + { + "value": "octet_length(\"bytes\") <= 10485760", + "name": "blob_size", + "entityType": "checks", + "schema": "apps", + "table": "blob" + }, + { + "value": "\"environment\" IN ('preview', 'published')", + "name": "handoff_environment", + "entityType": "checks", + "schema": "apps", + "table": "handoff" + }, + { + "value": "\"size\" BETWEEN 0 AND 10485760", + "name": "version_file_size", + "entityType": "checks", + "schema": "apps", + "table": "version_file" + }, + { + "value": "char_length(\"name\") BETWEEN 1 AND 60 AND \"name\" = btrim(\"name\")", + "name": "connection_name", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "\"state\" IN ('NEW', 'ACTIVE', 'NEEDS_REAUTH')", + "name": "connection_state", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "(\"account_ref\" IS NULL) = (\"account_label\" IS NULL)\n AND (\"account_label\" IS NULL OR char_length(\"account_label\") BETWEEN 1 AND 120)", + "name": "connection_account", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "jsonb_typeof(\"notes\") = 'object' AND octet_length(\"notes\"::text) <= 32768", + "name": "connection_notes", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "\"connector_id\" ~ '^[a-z][a-z0-9-]{1,31}$'", + "name": "connection_connector_id", + "entityType": "checks", + "schema": "connectors", + "table": "connection" + }, + { + "value": "\"name\" IS NULL OR (char_length(\"name\") BETWEEN 1 AND 60 AND \"name\" = btrim(\"name\"))", + "name": "connection_sign_in_name", + "entityType": "checks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "value": "(\"connection_id\" IS NULL) <> (\"name\" IS NULL)\n AND (\"connection_id\" IS NULL) = (\"connection_revision\" IS NULL)", + "name": "connection_sign_in_target", + "entityType": "checks", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "value": "(\"agent_id\" is not null and \"version_number\" is not null and \"person_id\" is null) or (\"agent_id\" is null and \"version_number\" is null and \"person_id\" is not null)", + "name": "connector_write_speaker", + "entityType": "checks", + "schema": "connectors", + "table": "connector_write" + }, + { + "value": "\"state\" in ('SENDING', 'DONE', 'REFUSED', 'UNCERTAIN')", + "name": "connector_write_state", + "entityType": "checks", + "schema": "connectors", + "table": "connector_write" + }, + { + "value": "(\"claim_token\" IS NULL) = (\"claimed_until\" IS NULL)", + "name": "copy_claim", + "entityType": "checks", + "schema": "copies", + "table": "copy" + }, + { + "value": "\"name\" ~ '^[a-z][a-z0-9_]{0,39}$'", + "name": "copy_name", + "entityType": "checks", + "schema": "copies", + "table": "copy" + }, + { + "value": "jsonb_typeof(\"definition\") = 'object'", + "name": "copy_definition", + "entityType": "checks", + "schema": "copies", + "table": "copy" + }, + { + "value": "\"name\" ~ '^[a-z][a-z0-9_]{0,39}$'", + "name": "copy_proposal_name", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "jsonb_typeof(\"definition\") = 'object'", + "name": "copy_proposal_definition", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "\"proved_rows\" BETWEEN 0 AND 50", + "name": "copy_proposal_proved_rows", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "\"state\" IN ('OPEN', 'ACCEPTED', 'DISMISSED')", + "name": "copy_proposal_state", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "\"state\" = 'ACCEPTED' OR \"copy_id\" IS NULL", + "name": "copy_proposal_copy", + "entityType": "checks", + "schema": "copies", + "table": "copy_proposal" + }, + { + "value": "(\"ended_at\" IS NULL) = (\"outcome\" IS NULL)", + "name": "copy_run_ended", + "entityType": "checks", + "schema": "copies", + "table": "copy_run" + }, + { + "value": "\"outcome\" IS NULL OR \"outcome\" IN ('COMPLETE', 'PARTIAL', 'ERROR', 'INTERRUPTED')", + "name": "copy_run_outcome", + "entityType": "checks", + "schema": "copies", + "table": "copy_run" + }, + { + "value": "\"position\" IS NULL OR jsonb_typeof(\"position\") = 'object'", + "name": "copy_source_position", + "entityType": "checks", + "schema": "copies", + "table": "copy_source" + }, + { + "value": "\"name\" ~ '^[a-z][a-z0-9_]{0,39}$'", + "name": "copy_table_left_name", + "entityType": "checks", + "schema": "copies", + "table": "copy_table_left" + }, + { + "value": "\"nickname\" ~ '^[a-z0-9]+(-[a-z0-9]+)*$' and char_length(\"nickname\") BETWEEN 3 AND 30", + "name": "company_nickname_form", + "entityType": "checks", + "schema": "auth", + "table": "company" + }, + { + "value": "(\"project_id\" is null) = (\"role\" is not null)", + "name": "invitation_kind", + "entityType": "checks", + "schema": "auth", + "table": "invitation" + }, + { + "value": "\"kind\" in ('AUTOMATION_DONE', 'AUTOMATION_FAILED', 'AUTOMATION_PAUSED')", + "name": "notification_kind", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" <> 'AUTOMATION_DONE' or (\"conversation_id\" is not null and \"failure_code\" is null)", + "name": "notification_done", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" <> 'AUTOMATION_FAILED' or (\"failure_code\" is not null and \"failure_code\" in ('MODEL_NO_ACCOUNT', 'MODEL_CALL_FAILED', 'MODEL_REFUSED', 'MODEL_ANSWER_CUT', 'MACHINE_UNAVAILABLE', 'MACHINE_LOST', 'HUB_UPDATED', 'INTERNAL_UNEXPECTED', 'DATABASE_UNAVAILABLE', 'INTERRUPTED', 'SCHEDULE_PUBLISH_FAILED'))", + "name": "notification_failed", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" <> 'AUTOMATION_PAUSED' or (\"conversation_id\" is null and \"failure_code\" is null)", + "name": "notification_paused", + "entityType": "checks", + "schema": "notifications", + "table": "notification" + }, + { + "value": "\"kind\" in ('REQUEST_OPENED', 'REQUEST_DECIDED')", + "name": "request_notice_kind", + "entityType": "checks", + "schema": "notifications", + "table": "request_notice" + }, + { + "value": "\"cnpj\" ~ '^[0-9A-Z]{12}[0-9]{2}$'", + "name": "client_cnpj_format", + "entityType": "checks", + "schema": "operations", + "table": "client" + }, + { + "value": "char_length(\"legal_name\") BETWEEN 1 AND 150", + "name": "client_legal_name_length", + "entityType": "checks", + "schema": "operations", + "table": "client" + }, + { + "value": "\"revision\" >= 0", + "name": "client_revision_not_negative", + "entityType": "checks", + "schema": "operations", + "table": "client" + }, + { + "value": "\"state\" IN ('creating', 'ready')", + "name": "company_database_state", + "entityType": "checks", + "schema": "projects", + "table": "company_database" + }, + { + "value": "(\"state\" = 'ready') = (\"neon_project_id\" IS NOT NULL)", + "name": "company_database_ready_has_project", + "entityType": "checks", + "schema": "projects", + "table": "company_database" + }, + { + "value": "(\"state\" = 'creating') = (\"claimed_until\" IS NOT NULL)", + "name": "company_database_creating_has_claim", + "entityType": "checks", + "schema": "projects", + "table": "company_database" + }, + { + "value": "\"host_label\" ~ '^[a-z0-9]+(-[a-z0-9]+)*--[a-z0-9]+(-[a-z0-9]+)*$' and char_length(\"host_label\") <= 63", + "name": "project_host_label_form", + "entityType": "checks", + "schema": "projects", + "table": "project" + }, + { + "value": "char_length(\"name\") BETWEEN 1 AND 100", + "name": "project_name_length", + "entityType": "checks", + "schema": "projects", + "table": "project" + }, + { + "value": "\"kind\" in ('PUBLISH_APP_VERSION')", + "name": "request_kind", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"number\" > 0", + "name": "request_number", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "char_length(\"message\") <= 280", + "name": "request_message", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"state\" in ('PENDING', 'APPROVED', 'DECLINED', 'CANCELLED', 'SUPERSEDED')", + "name": "request_state", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "(\"state\" in ('PENDING', 'CANCELLED')) = (\"decided_by\" is null)", + "name": "request_decided", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"reason\" is null or \"state\" = 'DECLINED'", + "name": "request_reason", + "entityType": "checks", + "schema": "requests", + "table": "request" + }, + { + "value": "\"version\" ~ '^v[0-9]+\\.[0-9]+\\.[0-9]+$'", + "name": "starts_version_format", + "entityType": "checks", + "schema": "hub", + "table": "starts" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_agent_companies"], + "using": "true", + "withCheck": null, + "name": "agent_companies_select", + "entityType": "policies", + "schema": "builder", + "table": "agent" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_conversation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_tool" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_version" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "agent_version_tool" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "assistant_conversation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "conversation" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "company_select", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "operator_insert", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "builder", + "table": "company_account_kind" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "company_model" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "company_model_fallback" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id is null or person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id is null or person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "model_account" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_model_seals"], + "using": "true", + "withCheck": null, + "name": "model_seals_select", + "entityType": "policies", + "schema": "builder", + "table": "model_account" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "model_account_assignee" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_model_seals"], + "using": "true", + "withCheck": null, + "name": "model_seals_select", + "entityType": "policies", + "schema": "builder", + "table": "model_account_sign_in" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "observational_memory_models" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "person_model_default" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "tool" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "builder", + "table": "tool_version" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_companies"], + "using": "true", + "withCheck": null, + "name": "companies_select", + "entityType": "policies", + "schema": "apps", + "table": "app" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "app_version" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "app_version" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "app_version" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "blob" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "blob" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "blob" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "apps", + "table": "version_file" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "apps", + "table": "version_file" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "apps", + "table": "version_file" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "connection" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_connection_seals"], + "using": "true", + "withCheck": null, + "name": "connection_seals_select", + "entityType": "policies", + "schema": "connectors", + "table": "connection" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')\n and (person_id = nullif(current_setting('conexus.person_id', true), '') or nullif(current_setting('conexus.person_id', true), '') is null)", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "connection_sign_in" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "connector_write" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "connectors", + "table": "project_connection" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_proposal" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_proposal_source" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_run" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_source" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "copy_table_left" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "copies", + "table": "project_copy" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_people"], + "using": "true", + "withCheck": null, + "name": "app_people_select", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_person"], + "using": "exists (select 1 from auth.member m where m.company_id = company.id and m.user_id = nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "person_select", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = company.id)", + "withCheck": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = company.id)", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_insert", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and id = nullif(current_setting('conexus.company_id', true), '')", + "name": "operator_update", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "auth", + "table": "company" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_person"], + "using": "inviter_id = nullif(current_setting('conexus.person_id', true), '')\n or lower(email) = (select u.email from auth.\"user\" u where u.id = nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "person_select", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "id = nullif(current_setting('conexus.invitation_id', true), '')", + "withCheck": "id = nullif(current_setting('conexus.invitation_id', true), '')", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'owner' or company_id = nullif(current_setting('conexus.company_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and role = 'owner'", + "name": "operator_insert", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and role = 'owner'", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and role = 'owner'", + "name": "operator_update", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "auth", + "table": "invitation" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_person"], + "using": "user_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": null, + "name": "person_select", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = member.company_id)", + "withCheck": null, + "name": "invitation_select", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_invitation"], + "using": null, + "withCheck": "user_id = nullif(current_setting('conexus.person_id', true), '')\n and exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = member.company_id)", + "name": "invitation_insert", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'owner' or company_id = nullif(current_setting('conexus.company_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "auth", + "table": "member" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "organization_role" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_insert", + "entityType": "policies", + "schema": "auth", + "table": "organization_role" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_runtime"], + "using": "true", + "withCheck": "true", + "name": "runtime_all", + "entityType": "policies", + "schema": "auth", + "table": "session" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "user_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "user_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "session" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "user_id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i join auth.\"user\" u on u.email = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and u.id = session.user_id)", + "withCheck": "user_id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i join auth.\"user\" u on u.email = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and u.id = session.user_id)", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "session" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_runtime"], + "using": "true", + "withCheck": "true", + "name": "runtime_sign_in", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from auth.invitation i where i.inviter_id = \"user\".id and i.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from projects.app_access a where a.person_id = \"user\".id and a.company_id = nullif(current_setting('conexus.company_id', true), ''))", + "withCheck": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from auth.invitation i where i.inviter_id = \"user\".id and i.company_id = nullif(current_setting('conexus.company_id', true), ''))\n or exists (select 1 from projects.app_access a where a.person_id = \"user\".id and a.company_id = nullif(current_setting('conexus.company_id', true), ''))", + "name": "company_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_person"], + "using": "id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "id = nullif(current_setting('conexus.person_id', true), '')", + "name": "person_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_invitation"], + "using": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '')\n and (i.inviter_id = \"user\".id or lower(i.email) = \"user\".email))", + "withCheck": "id = nullif(current_setting('conexus.person_id', true), '')\n or exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '')\n and (i.inviter_id = \"user\".id or lower(i.email) = \"user\".email))", + "name": "invitation_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_administrators"], + "using": "role = 'admin'", + "withCheck": null, + "name": "administrators_select", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'admin'\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.role = 'owner'))", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and (role = 'admin'\n or exists (select 1 from auth.member m where m.user_id = \"user\".id and m.role = 'owner'))", + "name": "operator_all", + "entityType": "policies", + "schema": "auth", + "table": "user" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "notifications", + "table": "notification" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": null, + "name": "company_select", + "entityType": "policies", + "schema": "notifications", + "table": "request_notice" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '') and person_id = nullif(current_setting('conexus.person_id', true), '')", + "name": "company_update", + "entityType": "policies", + "schema": "notifications", + "table": "request_notice" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_company"], + "using": null, + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_insert", + "entityType": "policies", + "schema": "notifications", + "table": "request_notice" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_operator"], + "using": null, + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_insert", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "UPDATE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "withCheck": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), ''))", + "name": "operator_update", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "operations", + "table": "client" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "INSERT", + "roles": ["hub_invitation"], + "using": null, + "withCheck": "exists (select 1 from auth.invitation i\n join auth.\"user\" u on lower(u.email) = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.company_id = app_access.company_id\n and i.project_id = app_access.project_id and i.app_role is not distinct from app_access.role\n and u.id = app_access.person_id)", + "name": "invitation_insert", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i\n join auth.\"user\" u on lower(u.email) = lower(i.email)\n where i.id = nullif(current_setting('conexus.invitation_id', true), '') and i.project_id = app_access.project_id\n and u.id = app_access.person_id)", + "withCheck": null, + "name": "invitation_select", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_people"], + "using": "true", + "withCheck": null, + "name": "app_people_select", + "entityType": "policies", + "schema": "projects", + "table": "app_access" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "projects", + "table": "company_database" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "projects", + "table": "company_database" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "projects", + "table": "company_database" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "DELETE", + "roles": ["hub_operator"], + "using": "auth.is_installation_administrator(nullif(current_setting('conexus.person_id', true), '')) and company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": null, + "name": "operator_delete", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_hosts"], + "using": "true", + "withCheck": null, + "name": "hosts_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_app_people"], + "using": "true", + "withCheck": null, + "name": "app_people_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "SELECT", + "roles": ["hub_invitation"], + "using": "exists (select 1 from auth.invitation i where i.id = nullif(current_setting('conexus.invitation_id', true), '')\n and i.company_id = project.company_id and i.project_id = project.id)", + "withCheck": null, + "name": "invitation_select", + "entityType": "policies", + "schema": "projects", + "table": "project" + }, + { + "as": "PERMISSIVE", + "for": "ALL", + "roles": ["hub_company"], + "using": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "withCheck": "company_id = nullif(current_setting('conexus.company_id', true), '')", + "name": "company_all", + "entityType": "policies", + "schema": "requests", + "table": "request" + } + ], + "renames": [] +} diff --git a/apps/server/src/hub/copies/tables.ts b/apps/server/src/hub/copies/tables.ts index eed32ef0..ba69d60e 100644 --- a/apps/server/src/hub/copies/tables.ts +++ b/apps/server/src/hub/copies/tables.ts @@ -176,6 +176,9 @@ export const copyProposal = copies.table( proposedBy: text('proposed_by').notNull(), provedRows: integer('proved_rows').notNull(), provedMore: boolean('proved_more').notNull(), + // The calls a whole pass would spend, summed over the proposal's connections; null when a read + // does not tell its total (O Sync de qualquer conector, U4). + provedCalls: integer('proved_calls'), proposedAt: instant('proposed_at').notNull(), state: text('state', { enum: ['OPEN', 'ACCEPTED', 'DISMISSED'] }).notNull(), // The copy it turned into; null again when that copy is deleted, a row nobody reads (data D15). @@ -217,3 +220,102 @@ export const copyProposal = copies.table( policy(SCOPE_ROLES.COMPANY, 'all', sql`company_id = ${scoped.companyId}`), ], ) + +/** + * Each connection a copy reads, with its account, where its pass stands and until when the provider + * asked it to wait (O Sync de qualquer conector): a copy of two accounts keeps, for each, how far it + * has read. The position, the watermark and the wait are ours (docs/reference/boundaries.md). + */ +export const copySource = copies.table( + 'copy_source', + { + companyId: text('company_id').notNull(), + copyId: uuid('copy_id').notNull(), + // The connection's connector, so the row's connection is its company's (as copy). + connectorId: text('connector_id').notNull(), + connectionId: uuid('connection_id').notNull(), + // The connection's `AccountRef`; null on a connector whose account is `none`. + accountRef: text('account_ref'), + pass: integer('pass').notNull().default(0), + passStartedAt: instant('pass_started_at'), + // `CopyPosition` of the kit, parsed again at each run (code C27). + position: jsonb('position'), + watermark: instant('watermark'), + // The provider asked to wait: no call before this instant. + waitUntil: instant('wait_until'), + createdAt: instant('created_at').notNull(), + }, + (table) => [ + primaryKey({ columns: [table.copyId, table.connectionId] }), + unique('copy_source_copy_id_account_ref_key').on(table.copyId, table.accountRef), + foreignKey({ + name: 'copy_source_copy_fkey', + columns: [table.companyId, table.copyId], + foreignColumns: [copy.companyId, copy.id], + }).onDelete('cascade'), + foreignKey({ + name: 'copy_source_connection_fkey', + columns: [table.companyId, table.connectorId, table.connectionId], + foreignColumns: [connection.companyId, connection.connectorId, connection.id], + }).onDelete('cascade'), + check( + 'copy_source_position', + sql`${table.position} IS NULL OR jsonb_typeof(${table.position}) = 'object'`, + ), + policy(SCOPE_ROLES.COMPANY, 'all', sql`company_id = ${scoped.companyId}`), + ], +) + +/** + * The table of a copy that ended while the company's database did not answer: written in the + * transaction that ended the copy, and gone once its table is dropped. No foreign key to the copy, + * which has already left. + */ +export const copyTableLeft = copies.table( + 'copy_table_left', + { + companyId: text('company_id').notNull(), + copyId: uuid('copy_id').notNull(), + // The table in the company's `sync` schema (`CopyName`). + name: text('name').notNull(), + }, + (table) => [ + primaryKey({ columns: [table.companyId, table.copyId] }), + foreignKey({ + name: 'copy_table_left_company_id_fkey', + columns: [table.companyId], + foreignColumns: [company.id], + }).onDelete('cascade'), + check('copy_table_left_name', sql`${table.name} ~ '^[a-z][a-z0-9_]{0,39}$'`), + policy(SCOPE_ROLES.COMPANY, 'all', sql`company_id = ${scoped.companyId}`), + ], +) + +/** + * Each connection a proposal reads (O Sync de qualquer conector, U4). The proposal's own connection + * stays its first; deleting another connection takes only its row. + */ +export const copyProposalSource = copies.table( + 'copy_proposal_source', + { + companyId: text('company_id').notNull(), + proposalId: uuid('proposal_id').notNull(), + // The connection's connector, so the row's connection is its company's (as copy_proposal). + connectorId: text('connector_id').notNull(), + connectionId: uuid('connection_id').notNull(), + }, + (table) => [ + primaryKey({ columns: [table.proposalId, table.connectionId] }), + foreignKey({ + name: 'copy_proposal_source_proposal_fkey', + columns: [table.proposalId], + foreignColumns: [copyProposal.id], + }).onDelete('cascade'), + foreignKey({ + name: 'copy_proposal_source_connection_fkey', + columns: [table.companyId, table.connectorId, table.connectionId], + foreignColumns: [connection.companyId, connection.connectorId, connection.id], + }).onDelete('cascade'), + policy(SCOPE_ROLES.COMPANY, 'all', sql`company_id = ${scoped.companyId}`), + ], +)