public function updateField($table, $field, $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'] = $field;

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

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

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

        if ($return_schema) {
            return $this->describeField($table, $field);
        }

        return $result;
    }
public function updateField($table, $field, $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'] = $field;

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

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

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

        if ($return_schema) {
            return $this->describeField($table, $field);
        }

        return $result;
    }
public function updateField ( $ table , $ field , $ 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' ] = $ field ; $ fields = static :: validateAsArray ( $ properties , null , true , 'Bad data format in request.' ) ; $ tables = [ [ 'name' => $ table , 'field' => $ fields ] ] ; $ result = $ this -> updateSchema ( $ tables , true , false ) ; $ result = array_get ( array_get ( $ result , 0 , [ ] ) , 'field' , [ ] ) ; //  Any changes here should refresh cached schema $ this -> refreshCachedTables ( ) ; if ( $ return_schema ) { return $ this -> describeField ( $ table , $ field ) ; } return $ result ; }
Update properties related to a table field

@param string $table
@param string $field
@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
Update properties related to a table field