CREATE TABLE connect_credentials (
  node_id     INTEGER NOT NULL,
  dp_uuid     TEXT NOT NULL,
  protocol    INTEGER NOT NULL DEFAULT 3,          -- agentv1.ProtocolBoth = 3
  flow        TEXT NOT NULL DEFAULT 'xtls-rprx-vision',
  expires_at  DATETIME NOT NULL,
  created_at  DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (node_id, dp_uuid),
  CONSTRAINT fk_cc_node FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE
);
CREATE INDEX idx_cc_node_expires ON connect_credentials (node_id, expires_at);
