{
  "version": "6",
  "dialect": "sqlite",
  "id": "92716ac2-9f17-4c38-a0c1-bf5c303a65c4",
  "prevId": "1308853c-b9c7-4f4f-a509-a65ca55dfdf2",
  "tables": {
    "input_history": {
      "name": "input_history",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "input": {
          "name": "input",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "compaction_failed_items": {
      "name": "compaction_failed_items",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "docker_launches": {
      "name": "docker_launches",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "kind": {
          "name": "kind",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "container_target": {
          "name": "container_target",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "docker_run_args_json": {
          "name": "docker_run_args_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "config": {
          "name": "config",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "unchained": {
          "name": "unchained",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {
        "docker_launches_kind_args_check": {
          "name": "docker_launches_kind_args_check",
          "value": "(\"docker_launches\".\"kind\" = 'connect' AND \"docker_launches\".\"container_target\" IS NOT NULL AND \"docker_launches\".\"docker_run_args_json\" IS NULL)\n        OR (\"docker_launches\".\"kind\" = 'run' AND \"docker_launches\".\"container_target\" IS NULL AND \"docker_launches\".\"docker_run_args_json\" IS NOT NULL)"
        }
      }
    },
    "history_items": {
      "name": "history_items",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "request_failed_id": {
          "name": "request_failed_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "compaction_failed_id": {
          "name": "compaction_failed_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "notification_id": {
          "name": "notification_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "llm_ir_id": {
          "name": "llm_ir_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "history_items_requestFailedId_unique": {
          "name": "history_items_requestFailedId_unique",
          "columns": ["request_failed_id"],
          "isUnique": true
        },
        "history_items_compactionFailedId_unique": {
          "name": "history_items_compactionFailedId_unique",
          "columns": ["compaction_failed_id"],
          "isUnique": true
        },
        "history_items_notificationId_unique": {
          "name": "history_items_notificationId_unique",
          "columns": ["notification_id"],
          "isUnique": true
        },
        "history_items_llmIrId_unique": {
          "name": "history_items_llmIrId_unique",
          "columns": ["llm_ir_id"],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "history_items_request_failed_id_request_failed_items_id_fk": {
          "name": "history_items_request_failed_id_request_failed_items_id_fk",
          "tableFrom": "history_items",
          "tableTo": "request_failed_items",
          "columnsFrom": ["request_failed_id"],
          "columnsTo": ["id"],
          "onDelete": "restrict",
          "onUpdate": "no action"
        },
        "history_items_compaction_failed_id_compaction_failed_items_id_fk": {
          "name": "history_items_compaction_failed_id_compaction_failed_items_id_fk",
          "tableFrom": "history_items",
          "tableTo": "compaction_failed_items",
          "columnsFrom": ["compaction_failed_id"],
          "columnsTo": ["id"],
          "onDelete": "restrict",
          "onUpdate": "no action"
        },
        "history_items_notification_id_notifications_id_fk": {
          "name": "history_items_notification_id_notifications_id_fk",
          "tableFrom": "history_items",
          "tableTo": "notifications",
          "columnsFrom": ["notification_id"],
          "columnsTo": ["id"],
          "onDelete": "restrict",
          "onUpdate": "no action"
        },
        "history_items_llm_ir_id_llm_irs_id_fk": {
          "name": "history_items_llm_ir_id_llm_irs_id_fk",
          "tableFrom": "history_items",
          "tableTo": "llm_irs",
          "columnsFrom": ["llm_ir_id"],
          "columnsTo": ["id"],
          "onDelete": "restrict",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {
        "history_items_exactly_one_payload_check": {
          "name": "history_items_exactly_one_payload_check",
          "value": "(\"history_items\".\"request_failed_id\" IS NOT NULL)\n        + (\"history_items\".\"compaction_failed_id\" IS NOT NULL)\n        + (\"history_items\".\"notification_id\" IS NOT NULL)\n        + (\"history_items\".\"llm_ir_id\" IS NOT NULL) = 1"
        }
      }
    },
    "launches": {
      "name": "launches",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "docker_launch_id": {
          "name": "docker_launch_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "local_launch_id": {
          "name": "local_launch_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "launches_dockerLaunchId_unique": {
          "name": "launches_dockerLaunchId_unique",
          "columns": ["docker_launch_id"],
          "isUnique": true
        },
        "launches_localLaunchId_unique": {
          "name": "launches_localLaunchId_unique",
          "columns": ["local_launch_id"],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "launches_docker_launch_id_docker_launches_id_fk": {
          "name": "launches_docker_launch_id_docker_launches_id_fk",
          "tableFrom": "launches",
          "tableTo": "docker_launches",
          "columnsFrom": ["docker_launch_id"],
          "columnsTo": ["id"],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "launches_local_launch_id_local_launches_id_fk": {
          "name": "launches_local_launch_id_local_launches_id_fk",
          "tableFrom": "launches",
          "tableTo": "local_launches",
          "columnsFrom": ["local_launch_id"],
          "columnsTo": ["id"],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {
        "launches_exactly_one_kind_check": {
          "name": "launches_exactly_one_kind_check",
          "value": "(\"launches\".\"docker_launch_id\" IS NOT NULL) <> (\"launches\".\"local_launch_id\" IS NOT NULL)"
        }
      }
    },
    "llm_irs": {
      "name": "llm_irs",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "json": {
          "name": "json",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "local_launches": {
      "name": "local_launches",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "config": {
          "name": "config",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "unchained": {
          "name": "unchained",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "notifications": {
      "name": "notifications",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "request_failed_items": {
      "name": "request_failed_items",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "tree_nodes": {
      "name": "tree_nodes",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "history_item_id": {
          "name": "history_item_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tree_id": {
          "name": "tree_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "parent_id": {
          "name": "parent_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_leaf": {
          "name": "is_leaf",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "launch_id": {
          "name": "launch_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "tree_nodes_tree_id_idx": {
          "name": "tree_nodes_tree_id_idx",
          "columns": ["tree_id"],
          "isUnique": false
        },
        "tree_nodes_one_root_unique": {
          "name": "tree_nodes_one_root_unique",
          "columns": ["tree_id"],
          "isUnique": true,
          "where": "\"tree_nodes\".\"parent_id\" IS NULL"
        },
        "tree_nodes_historyItemId_unique": {
          "name": "tree_nodes_historyItemId_unique",
          "columns": ["history_item_id"],
          "isUnique": true
        },
        "tree_nodes_id_treeId_unique": {
          "name": "tree_nodes_id_treeId_unique",
          "columns": ["id", "tree_id"],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "tree_nodes_history_item_id_history_items_id_fk": {
          "name": "tree_nodes_history_item_id_history_items_id_fk",
          "tableFrom": "tree_nodes",
          "tableTo": "history_items",
          "columnsFrom": ["history_item_id"],
          "columnsTo": ["id"],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "tree_nodes_tree_id_trees_id_fk": {
          "name": "tree_nodes_tree_id_trees_id_fk",
          "tableFrom": "tree_nodes",
          "tableTo": "trees",
          "columnsFrom": ["tree_id"],
          "columnsTo": ["id"],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "tree_nodes_launch_id_launches_id_fk": {
          "name": "tree_nodes_launch_id_launches_id_fk",
          "tableFrom": "tree_nodes",
          "tableTo": "launches",
          "columnsFrom": ["launch_id"],
          "columnsTo": ["id"],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "tree_nodes_parent_same_tree_fk": {
          "name": "tree_nodes_parent_same_tree_fk",
          "tableFrom": "tree_nodes",
          "tableTo": "tree_nodes",
          "columnsFrom": ["parent_id", "tree_id"],
          "columnsTo": ["id", "tree_id"],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {
        "tree_nodes_not_own_parent_check": {
          "name": "tree_nodes_not_own_parent_check",
          "value": "\"tree_nodes\".\"parent_id\" IS NULL OR \"tree_nodes\".\"parent_id\" <> \"tree_nodes\".\"id\""
        }
      }
    },
    "trees": {
      "name": "trees",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "cwd": {
          "name": "cwd",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "trees_name_unique": {
          "name": "trees_name_unique",
          "columns": ["name"],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "shown_update_notifs": {
      "name": "shown_update_notifs",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "update": {
          "name": "update",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "update_idx": {
          "name": "update_idx",
          "columns": ["update"],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    }
  },
  "views": {},
  "enums": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "indexes": {}
  }
}
