query('SHOW TABLES'); $tables = $stmt->fetchAll(\PDO::FETCH_COLUMN); // Check if tables of v0.9 are presents $diff = array_diff([Utils::table('poll'), Utils::table('slot'), Utils::table('vote'), Utils::table('comment')], $tables); return count($diff) === 0; } /** * This method is called only one time in the migration page. * * @param \PDO $pdo The connection to database * @return bool true is the execution succeeded */ function execute(\PDO $pdo) { $this->alterPollTable($pdo); return true; } private function alterPollTable(\PDO $pdo) { $pdo->exec(' ALTER TABLE `' . Utils::table('poll') . '` ADD `receiveNewComments` TINYINT(1) DEFAULT \'0\' AFTER `receiveNewVotes`'); } }