src/CsvMigration.php
private function updateColumn(DbField $dbField) : void
    {
        $this->table->changeColumn($dbField->getName(), $dbField->getType(), $dbField->getOptions());
        // set field as unique
        if ($dbField->getUnique()) {
            // avoid creation of duplicate indexes
            if (!$this->table->hasIndex($dbField->getName())) {
                $this->table->addIndex([$dbField->getName()], ['unique' => true]);
            }
        } else {
            if ($this->table->hasIndex($dbField->getName())) {
                $this->table->removeIndexByName($dbField->getName());
            }
        }

        $this->addIndexes($dbField);
    }
private function updateColumn(DbField $dbField) : void
    {
        $this->table->changeColumn($dbField->getName(), $dbField->getType(), $dbField->getOptions());
        // set field as unique
        if ($dbField->getUnique()) {
            // avoid creation of duplicate indexes
            if (!$this->table->hasIndex($dbField->getName())) {
                $this->table->addIndex([$dbField->getName()], ['unique' => true]);
            }
        } else {
            if ($this->table->hasIndex($dbField->getName())) {
                $this->table->removeIndexByName($dbField->getName());
            }
        }

        $this->addIndexes($dbField);
    }
private function updateColumn ( DbField $ dbField ) : void { $ this -> table -> changeColumn ( $ dbField -> getName ( ) , $ dbField -> getType ( ) , $ dbField -> getOptions ( ) ) ; // set field as unique if ( $ dbField -> getUnique ( ) ) { // avoid creation of duplicate indexes if ( ! $ this -> table -> hasIndex ( $ dbField -> getName ( ) ) ) { $ this -> table -> addIndex ( [ $ dbField -> getName ( ) ] , [ 'unique' => true ] ) ; } } else { if ( $ this -> table -> hasIndex ( $ dbField -> getName ( ) ) ) { $ this -> table -> removeIndexByName ( $ dbField -> getName ( ) ) ; } } $ this -> addIndexes ( $ dbField ) ; }
Method used for updating an existing DB table column.

@param \CsvMigrations\FieldHandlers\DbField $dbField DbField object
@return void
Method used for updating an existing DB table column .