public function addEnableCommentsField()
    {
        Cache::clear(false, '_cake_model_');

        foreach (['Pages', 'Posts'] as $table) {
            $Table = $this->loadModel('MeCms.' . $table);

            if (!$Table->getSchema()->hasColumn('enable_comments')) {
                $Table->getConnection()->execute(sprintf('ALTER TABLE `%s` ADD `enable_comments` BOOLEAN NOT NULL DEFAULT TRUE AFTER `preview`', $Table->getTable()));
            }
        }
    }
public function addEnableCommentsField()
    {
        Cache::clear(false, '_cake_model_');

        foreach (['Pages', 'Posts'] as $table) {
            $Table = $this->loadModel('MeCms.' . $table);

            if (!$Table->getSchema()->hasColumn('enable_comments')) {
                $Table->getConnection()->execute(sprintf('ALTER TABLE `%s` ADD `enable_comments` BOOLEAN NOT NULL DEFAULT TRUE AFTER `preview`', $Table->getTable()));
            }
        }
    }
public function addEnableCommentsField ( ) { Cache :: clear ( false , '_cake_model_' ) ; foreach ( [ 'Pages' , 'Posts' ] as $ table ) { $ Table = $ this -> loadModel ( 'MeCms.' . $ table ) ; if ( ! $ Table -> getSchema ( ) -> hasColumn ( 'enable_comments' ) ) { $ Table -> getConnection ( ) -> execute ( sprintf ( 'ALTER TABLE `%s` ADD `enable_comments` BOOLEAN NOT NULL DEFAULT TRUE AFTER `preview`' , $ Table -> getTable ( ) ) ) ; } } }
Adds the `enable_comments` field to `Pages` and `Posts` tables
@return void
@since 2.26.3
Adds the enable_comments field to Pages and Posts tables