table('roles')->hasColumn('perm_community_admin'); if (!$exists) { $this->table('roles') ->addColumn('perm_community_admin', 'boolean', [ 'default' => 0, 'null' => false, ]) ->addIndex('perm_community_admin') ->update(); } $builder = $this->getQueryBuilder(); $builder ->update('roles') ->set('perm_community_admin', true) ->where(['perm_admin' => true]) ->execute(); } }