{
  "id": "512ce1a7-b31d-4644-9639-3e124b22e52e",
  "prevId": "00000000-0000-0000-0000-000000000000",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "trigger_dashboard_agent.chat_sessions": {
      "name": "chat_sessions",
      "schema": "trigger_dashboard_agent",
      "columns": {
        "chat_id": {
          "name": "chat_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "public_access_token": {
          "name": "public_access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "last_event_id": {
          "name": "last_event_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "run_id": {
          "name": "run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "trigger_dashboard_agent.chats": {
      "name": "chats",
      "schema": "trigger_dashboard_agent",
      "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
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'New chat'"
        },
        "messages": {
          "name": "messages",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'[]'::jsonb"
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        },
        "pinned_at": {
          "name": "pinned_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "deleted_at": {
          "name": "deleted_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "last_message_at": {
          "name": "last_message_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "chats_org_user_last_msg_idx": {
          "name": "chats_org_user_last_msg_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "last_message_at",
              "isExpression": false,
              "asc": false,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "where": "\"trigger_dashboard_agent\".\"chats\".\"deleted_at\" is null",
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {
    "trigger_dashboard_agent": "trigger_dashboard_agent"
  },
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}
