src/Resources/DbSchemaResource.php
public function updateRelationship(
        $table,
        $relationship,
        $properties = [],
        $allow_delete_parts = false,
        $return_schema = false
    ) {
        if (empty($table)) {
            throw new BadRequestException('Table name can not be empty.');
        }

        $properties = (is_array($properties) ? $properties : []);
        $properties['name'] = $relationship;

        $fields = static::validateAsArray($properties, null, true, 'Bad data format in request.');

        $tables = [['name' => $table, 'related' => $fields]];
        $result = $this->updateSchema($tables, true, false);
        $result = array_get(array_get($result, 0, []), 'related', []);

        //  Any changes here should refresh cached schema
        $this->refreshCachedTables();

        if ($return_schema) {
            return $this->describeRelationship($table, $relationship);
        }

        return $result;
    }
public function updateRelationship(
        $table,
        $relationship,
        $properties = [],
        $allow_delete_parts = false,
        $return_schema = false
    ) {
        if (empty($table)) {
            throw new BadRequestException('Table name can not be empty.');
        }

        $properties = (is_array($properties) ? $properties : []);
        $properties['name'] = $relationship;

        $fields = static::validateAsArray($properties, null, true, 'Bad data format in request.');

        $tables = [['name' => $table, 'related' => $fields]];
        $result = $this->updateSchema($tables, true, false);
        $result = array_get(array_get($result, 0, []), 'related', []);

        //  Any changes here should refresh cached schema
        $this->refreshCachedTables();

        if ($return_schema) {
            return $this->describeRelationship($table, $relationship);
        }

        return $result;
    }
Update properties related to a table relationship

@param string $table
@param string $relationship
@param array  $properties
@param bool   $allow_delete_parts
@param bool   $return_schema Return a refreshed copy of the schema from the database

@return array
@throws \Exception