{
  "id": "2bfee8e9-8bdd-4380-923a-1e91307177bc",
  "prevId": "876a9314-fb24-4607-85ce-4bee15878873",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.account": {
      "name": "account",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "account_id": {
          "name": "account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "provider_id": {
          "name": "provider_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "access_token_expires_at": {
          "name": "access_token_expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "refresh_token_expires_at": {
          "name": "refresh_token_expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "account_userId_idx": {
          "name": "account_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "account_user_id_user_id_fk": {
          "name": "account_user_id_user_id_fk",
          "tableFrom": "account",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.api_keys": {
      "name": "api_keys",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "public_id": {
          "name": "public_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "key_hash": {
          "name": "key_hash",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "key_prefix": {
          "name": "key_prefix",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "api_keys_tenant_agent_idx": {
          "name": "api_keys_tenant_agent_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "agent_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "api_keys_prefix_idx": {
          "name": "api_keys_prefix_idx",
          "columns": [
            {
              "expression": "key_prefix",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "api_keys_public_id_idx": {
          "name": "api_keys_public_id_idx",
          "columns": [
            {
              "expression": "public_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "api_keys_organization_fk": {
          "name": "api_keys_organization_fk",
          "tableFrom": "api_keys",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "api_keys_public_id_unique": {
          "name": "api_keys_public_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "public_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.context_cache": {
      "name": "context_cache",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "context_config_id": {
          "name": "context_config_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "context_variable_key": {
          "name": "context_variable_key",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "ref": {
          "name": "ref",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "value": {
          "name": "value",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "request_hash": {
          "name": "request_hash",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "fetched_at": {
          "name": "fetched_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "fetch_source": {
          "name": "fetch_source",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "context_cache_lookup_idx": {
          "name": "context_cache_lookup_idx",
          "columns": [
            {
              "expression": "conversation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "context_config_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "context_variable_key",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "context_cache_conversation_fk": {
          "name": "context_cache_conversation_fk",
          "tableFrom": "context_cache",
          "tableTo": "conversations",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "conversation_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "context_cache_tenant_id_project_id_id_pk": {
          "name": "context_cache_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.conversations": {
      "name": "conversations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "active_sub_agent_id": {
          "name": "active_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "ref": {
          "name": "ref",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "last_context_resolution": {
          "name": "last_context_resolution",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "conversations_tenant_id_project_id_id_pk": {
          "name": "conversations_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dataset_run": {
      "name": "dataset_run",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "dataset_id": {
          "name": "dataset_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "dataset_run_config_id": {
          "name": "dataset_run_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "evaluation_job_config_id": {
          "name": "evaluation_job_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "dataset_run_tenant_id_project_id_id_pk": {
          "name": "dataset_run_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dataset_run_conversation_relations": {
      "name": "dataset_run_conversation_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "dataset_run_id": {
          "name": "dataset_run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "dataset_item_id": {
          "name": "dataset_item_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "dataset_run_conversation_relations_run_fk": {
          "name": "dataset_run_conversation_relations_run_fk",
          "tableFrom": "dataset_run_conversation_relations",
          "tableTo": "dataset_run",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "dataset_run_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dataset_run_conversation_relations_conversation_fk": {
          "name": "dataset_run_conversation_relations_conversation_fk",
          "tableFrom": "dataset_run_conversation_relations",
          "tableTo": "conversations",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "conversation_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dataset_run_conversation_relations_tenant_id_project_id_id_pk": {
          "name": "dataset_run_conversation_relations_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "dataset_run_conversation_relations_unique": {
          "name": "dataset_run_conversation_relations_unique",
          "nullsNotDistinct": false,
          "columns": [
            "dataset_run_id",
            "conversation_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.device_code": {
      "name": "device_code",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "device_code": {
          "name": "device_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_code": {
          "name": "user_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "last_polled_at": {
          "name": "last_polled_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "polling_interval": {
          "name": "polling_interval",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "client_id": {
          "name": "client_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_result": {
      "name": "evaluation_result",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "evaluator_id": {
          "name": "evaluator_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "evaluation_run_id": {
          "name": "evaluation_run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "output": {
          "name": "output",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "evaluation_result_conversation_fk": {
          "name": "evaluation_result_conversation_fk",
          "tableFrom": "evaluation_result",
          "tableTo": "conversations",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "conversation_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "evaluation_result_evaluation_run_fk": {
          "name": "evaluation_result_evaluation_run_fk",
          "tableFrom": "evaluation_result",
          "tableTo": "evaluation_run",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "evaluation_run_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "evaluation_result_tenant_id_project_id_id_pk": {
          "name": "evaluation_result_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evaluation_run": {
      "name": "evaluation_run",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "evaluation_job_config_id": {
          "name": "evaluation_job_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "evaluation_run_config_id": {
          "name": "evaluation_run_config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "evaluation_run_tenant_id_project_id_id_pk": {
          "name": "evaluation_run_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invitation": {
      "name": "invitation",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "inviter_id": {
          "name": "inviter_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "auth_method": {
          "name": "auth_method",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "invitation_organizationId_idx": {
          "name": "invitation_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invitation_email_idx": {
          "name": "invitation_email_idx",
          "columns": [
            {
              "expression": "email",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "invitation_organization_id_organization_id_fk": {
          "name": "invitation_organization_id_organization_id_fk",
          "tableFrom": "invitation",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invitation_inviter_id_user_id_fk": {
          "name": "invitation_inviter_id_user_id_fk",
          "tableFrom": "invitation",
          "tableTo": "user",
          "columnsFrom": [
            "inviter_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.ledger_artifacts": {
      "name": "ledger_artifacts",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "task_id": {
          "name": "task_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "tool_call_id": {
          "name": "tool_call_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "context_id": {
          "name": "context_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true,
          "default": "'source'"
        },
        "name": {
          "name": "name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "parts": {
          "name": "parts",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "summary": {
          "name": "summary",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "mime": {
          "name": "mime",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "visibility": {
          "name": "visibility",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false,
          "default": "'context'"
        },
        "allowed_agents": {
          "name": "allowed_agents",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "derived_from": {
          "name": "derived_from",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "ledger_artifacts_task_id_idx": {
          "name": "ledger_artifacts_task_id_idx",
          "columns": [
            {
              "expression": "task_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "ledger_artifacts_tool_call_id_idx": {
          "name": "ledger_artifacts_tool_call_id_idx",
          "columns": [
            {
              "expression": "tool_call_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "ledger_artifacts_context_id_idx": {
          "name": "ledger_artifacts_context_id_idx",
          "columns": [
            {
              "expression": "context_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "ledger_artifacts_conversation_fk": {
          "name": "ledger_artifacts_conversation_fk",
          "tableFrom": "ledger_artifacts",
          "tableTo": "conversations",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "context_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "ledger_artifacts_tenant_id_project_id_id_task_id_pk": {
          "name": "ledger_artifacts_tenant_id_project_id_id_task_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id",
            "task_id"
          ]
        }
      },
      "uniqueConstraints": {
        "ledger_artifacts_task_context_name_unique": {
          "name": "ledger_artifacts_task_context_name_unique",
          "nullsNotDistinct": false,
          "columns": [
            "task_id",
            "context_id",
            "name"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.member": {
      "name": "member",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'member'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "member_organizationId_idx": {
          "name": "member_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "member_userId_idx": {
          "name": "member_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "member_organization_id_organization_id_fk": {
          "name": "member_organization_id_organization_id_fk",
          "tableFrom": "member",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "member_user_id_user_id_fk": {
          "name": "member_user_id_user_id_fk",
          "tableFrom": "member",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.messages": {
      "name": "messages",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "from_sub_agent_id": {
          "name": "from_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "to_sub_agent_id": {
          "name": "to_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "from_external_sub_agent_id": {
          "name": "from_external_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "to_external_sub_agent_id": {
          "name": "to_external_sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "from_team_agent_id": {
          "name": "from_team_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "to_team_agent_id": {
          "name": "to_team_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "content": {
          "name": "content",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "visibility": {
          "name": "visibility",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true,
          "default": "'user-facing'"
        },
        "message_type": {
          "name": "message_type",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true,
          "default": "'chat'"
        },
        "task_id": {
          "name": "task_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "parent_message_id": {
          "name": "parent_message_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "a2a_task_id": {
          "name": "a2a_task_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "a2a_session_id": {
          "name": "a2a_session_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "messages_conversation_fk": {
          "name": "messages_conversation_fk",
          "tableFrom": "messages",
          "tableTo": "conversations",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "conversation_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "messages_tenant_id_project_id_id_pk": {
          "name": "messages_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.organization": {
      "name": "organization",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "logo": {
          "name": "logo",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "preferred_auth_method": {
          "name": "preferred_auth_method",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "service_account_user_id": {
          "name": "service_account_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "organization_slug_uidx": {
          "name": "organization_slug_uidx",
          "columns": [
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "organization_slug_unique": {
          "name": "organization_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.project_metadata": {
      "name": "project_metadata",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "created_by": {
          "name": "created_by",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "main_branch_name": {
          "name": "main_branch_name",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "project_metadata_tenant_idx": {
          "name": "project_metadata_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "project_metadata_main_branch_idx": {
          "name": "project_metadata_main_branch_idx",
          "columns": [
            {
              "expression": "main_branch_name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "project_metadata_organization_fk": {
          "name": "project_metadata_organization_fk",
          "tableFrom": "project_metadata",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "project_metadata_tenant_id_id_pk": {
          "name": "project_metadata_tenant_id_id_pk",
          "columns": [
            "tenant_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.scheduled_trigger_invocations": {
      "name": "scheduled_trigger_invocations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "scheduled_trigger_id": {
          "name": "scheduled_trigger_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "scheduled_for": {
          "name": "scheduled_for",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "resolved_payload": {
          "name": "resolved_payload",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "conversation_ids": {
          "name": "conversation_ids",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "attempt_number": {
          "name": "attempt_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 1
        },
        "idempotency_key": {
          "name": "idempotency_key",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "sched_invocations_idempotency_idx": {
          "name": "sched_invocations_idempotency_idx",
          "columns": [
            {
              "expression": "idempotency_key",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "scheduled_trigger_invocations_tenant_id_id_pk": {
          "name": "scheduled_trigger_invocations_tenant_id_id_pk",
          "columns": [
            "tenant_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.session": {
      "name": "session",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "active_organization_id": {
          "name": "active_organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "session_userId_idx": {
          "name": "session_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "session_user_id_user_id_fk": {
          "name": "session_user_id_user_id_fk",
          "tableFrom": "session",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "session_token_unique": {
          "name": "session_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sso_provider": {
      "name": "sso_provider",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "issuer": {
          "name": "issuer",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "oidc_config": {
          "name": "oidc_config",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "saml_config": {
          "name": "saml_config",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "provider_id": {
          "name": "provider_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sso_provider_user_id_user_id_fk": {
          "name": "sso_provider_user_id_user_id_fk",
          "tableFrom": "sso_provider",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "sso_provider_provider_id_unique": {
          "name": "sso_provider_provider_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "provider_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.task_relations": {
      "name": "task_relations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "parent_task_id": {
          "name": "parent_task_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "child_task_id": {
          "name": "child_task_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "relation_type": {
          "name": "relation_type",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false,
          "default": "'parent_child'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "task_relations_parent_fk": {
          "name": "task_relations_parent_fk",
          "tableFrom": "task_relations",
          "tableTo": "tasks",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "parent_task_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "task_relations_child_fk": {
          "name": "task_relations_child_fk",
          "tableFrom": "task_relations",
          "tableTo": "tasks",
          "columnsFrom": [
            "tenant_id",
            "project_id",
            "child_task_id"
          ],
          "columnsTo": [
            "tenant_id",
            "project_id",
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "task_relations_tenant_id_project_id_id_pk": {
          "name": "task_relations_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.tasks": {
      "name": "tasks",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "sub_agent_id": {
          "name": "sub_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "context_id": {
          "name": "context_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "ref": {
          "name": "ref",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "tasks_tenant_id_project_id_id_pk": {
          "name": "tasks_tenant_id_project_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.trigger_invocations": {
      "name": "trigger_invocations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "trigger_id": {
          "name": "trigger_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "request_payload": {
          "name": "request_payload",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "transformed_payload": {
          "name": "transformed_payload",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "trigger_invocations_trigger_idx": {
          "name": "trigger_invocations_trigger_idx",
          "columns": [
            {
              "expression": "trigger_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "trigger_invocations_status_idx": {
          "name": "trigger_invocations_status_idx",
          "columns": [
            {
              "expression": "trigger_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "trigger_invocations_tenant_id_project_id_agent_id_id_pk": {
          "name": "trigger_invocations_tenant_id_project_id_agent_id_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "agent_id",
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user": {
      "name": "user",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email_verified": {
          "name": "email_verified",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "image": {
          "name": "image",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "user_email_unique": {
          "name": "user_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_profile": {
      "name": "user_profile",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "timezone": {
          "name": "timezone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "attributes": {
          "name": "attributes",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "user_profile_user_id_user_id_fk": {
          "name": "user_profile_user_id_user_id_fk",
          "tableFrom": "user_profile",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "user_profile_user_id_unique": {
          "name": "user_profile_user_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "user_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.verification": {
      "name": "verification",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "identifier": {
          "name": "identifier",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "verification_identifier_idx": {
          "name": "verification_identifier_idx",
          "columns": [
            {
              "expression": "identifier",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_github_installations": {
      "name": "work_app_github_installations",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "installation_id": {
          "name": "installation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "account_login": {
          "name": "account_login",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "account_id": {
          "name": "account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "account_type": {
          "name": "account_type",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true,
          "default": "'active'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_github_installations_tenant_idx": {
          "name": "work_app_github_installations_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_github_installations_installation_id_idx": {
          "name": "work_app_github_installations_installation_id_idx",
          "columns": [
            {
              "expression": "installation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_github_installations_organization_fk": {
          "name": "work_app_github_installations_organization_fk",
          "tableFrom": "work_app_github_installations",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_github_installations_installation_id_unique": {
          "name": "work_app_github_installations_installation_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "installation_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_github_mcp_tool_access_mode": {
      "name": "work_app_github_mcp_tool_access_mode",
      "schema": "",
      "columns": {
        "tool_id": {
          "name": "tool_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "mode": {
          "name": "mode",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_github_mcp_tool_access_mode_tenant_idx": {
          "name": "work_app_github_mcp_tool_access_mode_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_github_mcp_tool_access_mode_project_idx": {
          "name": "work_app_github_mcp_tool_access_mode_project_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_github_mcp_tool_access_mode_tenant_fk": {
          "name": "work_app_github_mcp_tool_access_mode_tenant_fk",
          "tableFrom": "work_app_github_mcp_tool_access_mode",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "work_app_github_mcp_tool_access_mode_tenant_id_project_id_tool_id_pk": {
          "name": "work_app_github_mcp_tool_access_mode_tenant_id_project_id_tool_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "tool_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_github_mcp_tool_repository_access": {
      "name": "work_app_github_mcp_tool_repository_access",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "tool_id": {
          "name": "tool_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "repository_db_id": {
          "name": "repository_db_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_github_mcp_tool_repository_access_tool_idx": {
          "name": "work_app_github_mcp_tool_repository_access_tool_idx",
          "columns": [
            {
              "expression": "tool_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_github_mcp_tool_repository_access_tenant_idx": {
          "name": "work_app_github_mcp_tool_repository_access_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_github_mcp_tool_repository_access_project_idx": {
          "name": "work_app_github_mcp_tool_repository_access_project_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_github_mcp_tool_repository_access_tenant_fk": {
          "name": "work_app_github_mcp_tool_repository_access_tenant_fk",
          "tableFrom": "work_app_github_mcp_tool_repository_access",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "work_app_github_mcp_tool_repository_access_repo_fk": {
          "name": "work_app_github_mcp_tool_repository_access_repo_fk",
          "tableFrom": "work_app_github_mcp_tool_repository_access",
          "tableTo": "work_app_github_repositories",
          "columnsFrom": [
            "repository_db_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_github_mcp_tool_repository_access_unique": {
          "name": "work_app_github_mcp_tool_repository_access_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tool_id",
            "repository_db_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_github_project_access_mode": {
      "name": "work_app_github_project_access_mode",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "mode": {
          "name": "mode",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "work_app_github_project_access_mode_tenant_fk": {
          "name": "work_app_github_project_access_mode_tenant_fk",
          "tableFrom": "work_app_github_project_access_mode",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "work_app_github_project_access_mode_tenant_id_project_id_pk": {
          "name": "work_app_github_project_access_mode_tenant_id_project_id_pk",
          "columns": [
            "tenant_id",
            "project_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_github_project_repository_access": {
      "name": "work_app_github_project_repository_access",
      "schema": "",
      "columns": {
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "repository_db_id": {
          "name": "repository_db_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_github_project_repository_access_tenant_idx": {
          "name": "work_app_github_project_repository_access_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_github_project_repository_access_project_idx": {
          "name": "work_app_github_project_repository_access_project_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_github_project_repository_access_tenant_fk": {
          "name": "work_app_github_project_repository_access_tenant_fk",
          "tableFrom": "work_app_github_project_repository_access",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "work_app_github_project_repository_access_repo_fk": {
          "name": "work_app_github_project_repository_access_repo_fk",
          "tableFrom": "work_app_github_project_repository_access",
          "tableTo": "work_app_github_repositories",
          "columnsFrom": [
            "repository_db_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_github_project_repository_access_unique": {
          "name": "work_app_github_project_repository_access_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tenant_id",
            "project_id",
            "repository_db_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_github_repositories": {
      "name": "work_app_github_repositories",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": true,
          "notNull": true
        },
        "installation_db_id": {
          "name": "installation_db_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "repository_id": {
          "name": "repository_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "repository_name": {
          "name": "repository_name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "repository_full_name": {
          "name": "repository_full_name",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": true
        },
        "private": {
          "name": "private",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_github_repositories_installation_idx": {
          "name": "work_app_github_repositories_installation_idx",
          "columns": [
            {
              "expression": "installation_db_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_github_repositories_full_name_idx": {
          "name": "work_app_github_repositories_full_name_idx",
          "columns": [
            {
              "expression": "repository_full_name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_github_repositories_installation_fk": {
          "name": "work_app_github_repositories_installation_fk",
          "tableFrom": "work_app_github_repositories",
          "tableTo": "work_app_github_installations",
          "columnsFrom": [
            "installation_db_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_github_repositories_repo_installation_unique": {
          "name": "work_app_github_repositories_repo_installation_unique",
          "nullsNotDistinct": false,
          "columns": [
            "installation_db_id",
            "repository_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_slack_channel_agent_configs": {
      "name": "work_app_slack_channel_agent_configs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": true,
          "notNull": true
        },
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_team_id": {
          "name": "slack_team_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_channel_id": {
          "name": "slack_channel_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_channel_name": {
          "name": "slack_channel_name",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "slack_channel_type": {
          "name": "slack_channel_type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "agent_id": {
          "name": "agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "configured_by_user_id": {
          "name": "configured_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "enabled": {
          "name": "enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "grant_access_to_members": {
          "name": "grant_access_to_members",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_slack_channel_agent_configs_tenant_idx": {
          "name": "work_app_slack_channel_agent_configs_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_channel_agent_configs_team_idx": {
          "name": "work_app_slack_channel_agent_configs_team_idx",
          "columns": [
            {
              "expression": "slack_team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_channel_agent_configs_channel_idx": {
          "name": "work_app_slack_channel_agent_configs_channel_idx",
          "columns": [
            {
              "expression": "slack_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_channel_agent_configs_tenant_team_idx": {
          "name": "work_app_slack_channel_agent_configs_tenant_team_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "slack_team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_channel_agent_configs_agent_idx": {
          "name": "work_app_slack_channel_agent_configs_agent_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "agent_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_channel_agent_configs_project_idx": {
          "name": "work_app_slack_channel_agent_configs_project_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_slack_channel_agent_configs_tenant_id_organization_id_fk": {
          "name": "work_app_slack_channel_agent_configs_tenant_id_organization_id_fk",
          "tableFrom": "work_app_slack_channel_agent_configs",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "work_app_slack_channel_agent_configs_configured_by_user_id_user_id_fk": {
          "name": "work_app_slack_channel_agent_configs_configured_by_user_id_user_id_fk",
          "tableFrom": "work_app_slack_channel_agent_configs",
          "tableTo": "user",
          "columnsFrom": [
            "configured_by_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_slack_channel_agent_configs_unique": {
          "name": "work_app_slack_channel_agent_configs_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tenant_id",
            "slack_team_id",
            "slack_channel_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_slack_mcp_tool_access_config": {
      "name": "work_app_slack_mcp_tool_access_config",
      "schema": "",
      "columns": {
        "tool_id": {
          "name": "tool_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "channel_access_mode": {
          "name": "channel_access_mode",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true
        },
        "dm_enabled": {
          "name": "dm_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "channel_ids": {
          "name": "channel_ids",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'[]'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_slack_mcp_tool_access_config_tenant_idx": {
          "name": "work_app_slack_mcp_tool_access_config_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_mcp_tool_access_config_project_idx": {
          "name": "work_app_slack_mcp_tool_access_config_project_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_slack_mcp_tool_access_config_tenant_fk": {
          "name": "work_app_slack_mcp_tool_access_config_tenant_fk",
          "tableFrom": "work_app_slack_mcp_tool_access_config",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "work_app_slack_mcp_tool_access_config_tenant_id_project_id_tool_id_pk": {
          "name": "work_app_slack_mcp_tool_access_config_tenant_id_project_id_tool_id_pk",
          "columns": [
            "tenant_id",
            "project_id",
            "tool_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_slack_user_mappings": {
      "name": "work_app_slack_user_mappings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": true,
          "notNull": true
        },
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "client_id": {
          "name": "client_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true,
          "default": "'work-apps-slack'"
        },
        "slack_user_id": {
          "name": "slack_user_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_team_id": {
          "name": "slack_team_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_enterprise_id": {
          "name": "slack_enterprise_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "inkeep_user_id": {
          "name": "inkeep_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "slack_username": {
          "name": "slack_username",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "slack_email": {
          "name": "slack_email",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "linked_at": {
          "name": "linked_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_slack_user_mappings_tenant_idx": {
          "name": "work_app_slack_user_mappings_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_user_mappings_user_idx": {
          "name": "work_app_slack_user_mappings_user_idx",
          "columns": [
            {
              "expression": "inkeep_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_user_mappings_team_idx": {
          "name": "work_app_slack_user_mappings_team_idx",
          "columns": [
            {
              "expression": "slack_team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_user_mappings_slack_user_idx": {
          "name": "work_app_slack_user_mappings_slack_user_idx",
          "columns": [
            {
              "expression": "slack_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_user_mappings_tenant_team_idx": {
          "name": "work_app_slack_user_mappings_tenant_team_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "slack_team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_user_mappings_lookup_idx": {
          "name": "work_app_slack_user_mappings_lookup_idx",
          "columns": [
            {
              "expression": "client_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "slack_team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "slack_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_slack_user_mappings_tenant_id_organization_id_fk": {
          "name": "work_app_slack_user_mappings_tenant_id_organization_id_fk",
          "tableFrom": "work_app_slack_user_mappings",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "work_app_slack_user_mappings_inkeep_user_id_user_id_fk": {
          "name": "work_app_slack_user_mappings_inkeep_user_id_user_id_fk",
          "tableFrom": "work_app_slack_user_mappings",
          "tableTo": "user",
          "columnsFrom": [
            "inkeep_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_slack_user_mappings_unique": {
          "name": "work_app_slack_user_mappings_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tenant_id",
            "client_id",
            "slack_team_id",
            "slack_user_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.work_app_slack_workspaces": {
      "name": "work_app_slack_workspaces",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(256)",
          "primaryKey": true,
          "notNull": true
        },
        "tenant_id": {
          "name": "tenant_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_team_id": {
          "name": "slack_team_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "slack_enterprise_id": {
          "name": "slack_enterprise_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "slack_app_id": {
          "name": "slack_app_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "slack_team_name": {
          "name": "slack_team_name",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false
        },
        "nango_provider_config_key": {
          "name": "nango_provider_config_key",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true,
          "default": "'work-apps-slack'"
        },
        "nango_connection_id": {
          "name": "nango_connection_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true,
          "default": "'active'"
        },
        "installed_by_user_id": {
          "name": "installed_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "should_allow_join_from_workspace": {
          "name": "should_allow_join_from_workspace",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "default_agent_id": {
          "name": "default_agent_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "default_project_id": {
          "name": "default_project_id",
          "type": "varchar(256)",
          "primaryKey": false,
          "notNull": false
        },
        "default_grant_access_to_members": {
          "name": "default_grant_access_to_members",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "work_app_slack_workspaces_tenant_idx": {
          "name": "work_app_slack_workspaces_tenant_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_workspaces_team_idx": {
          "name": "work_app_slack_workspaces_team_idx",
          "columns": [
            {
              "expression": "slack_team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "work_app_slack_workspaces_defaults_idx": {
          "name": "work_app_slack_workspaces_defaults_idx",
          "columns": [
            {
              "expression": "tenant_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "default_project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "default_agent_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "work_app_slack_workspaces_tenant_id_organization_id_fk": {
          "name": "work_app_slack_workspaces_tenant_id_organization_id_fk",
          "tableFrom": "work_app_slack_workspaces",
          "tableTo": "organization",
          "columnsFrom": [
            "tenant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "work_app_slack_workspaces_installed_by_user_id_user_id_fk": {
          "name": "work_app_slack_workspaces_installed_by_user_id_user_id_fk",
          "tableFrom": "work_app_slack_workspaces",
          "tableTo": "user",
          "columnsFrom": [
            "installed_by_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "work_app_slack_workspaces_tenant_team_unique": {
          "name": "work_app_slack_workspaces_tenant_team_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tenant_id",
            "slack_team_id"
          ]
        },
        "work_app_slack_workspaces_nango_connection_unique": {
          "name": "work_app_slack_workspaces_nango_connection_unique",
          "nullsNotDistinct": false,
          "columns": [
            "nango_connection_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}