Chelabase
ManagementBranches

Fix one item of a branch's review

POST
/v1/databases/{id}/branches/{branch_id}/review/fix

The worker scans the branch again, checks hash against it, and runs one fix in the item's database in its own transaction with lock_timeout 5 s: reassign gives the item's function (a trigger's function; a rule's relation) to the owner (ALTER … OWNER TO), after which the Admin answers for its code and a SECURITY DEFINER function runs as the owner; drop drops the function, trigger or rule RESTRICT (never cascading). Answers with the SQL it ran and the review after it.

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Database id

Formatuuid
branch_id*string

Branch id

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST …/review/fix.

action*FixAction

What a fix does to an item.

Value in

  • "reassign"
  • "drop"
hash*string
key*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/review/fix" \  -H "Content-Type: application/json" \  -d '{    "action": "reassign",    "hash": "string",    "key": "string"  }'
{  "review": {    "acknowledged_hash": "string",    "hash": "string",    "items": [      {        "database": "string",        "digest": "string",        "function": "string",        "identity": "string",        "key": "string",        "kind": "function",        "name": "string",        "new": true,        "opaque_body": true,        "owner": "string",        "reasons": [          {            "kind": "security_definer",            "via": "string"          }        ],        "schema": "string"      }    ]  },  "sql": "string"}