Skip to main content

mr relation-type edit

Edit fields on an existing RelationType. --id is required; any other flag left unset keeps the existing value (partial update). --name and --description replace those fields; --reverse-name is accepted but has no effect here, since a reverse type is established at creation time (see relation-type create). --from-category and --to-category rewire the allowed category pairing. Every existing relation of this type whose groups no longer match the new categories is deleted, database-wide, along with the matching back-relation edges, and that is not reversible. Sends POST /v1/relationType/edit and returns the full updated record.

Usage

mr relation-type edit

Examples

Rename a relation type and update its description

mr relation-type edit --id 5 --name "referenced-by" --description "backward link"

Rewire the target category (relation-type 5 now points to category 7)

mr relation-type edit --id 5 --to-category 7

Flags

FlagTypeDefaultDescription
--iduint0Relation type ID (required) (required)
--namestring``Relation type name
--descriptionstring``Relation type description
--reverse-namestring``Reverse relation name
--from-categoryuint0From category ID
--to-categoryuint0To category ID

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

RelationType object with ID, Name, Description, FromCategoryId, ToCategoryId, BackRelationId, CreatedAt/UpdatedAt

Exit Codes

0 on success; 1 on any error

See Also