Dropping Virtual Columns

You can also drop existing virtual columns previously defined using addColumn(), to do this you can use the dropColumn() method:

use Cake\ORM\Table;

class UsersTable extends Table
    public function initialize(Table $table)
        $this->dropColumn('user-address', 'admin');

Optionally the second argument can be used to indicate the bundle where the column can be found.


This method will remove any stored information associated to the column being dropped, so use with extreme caution.