prepare("SELECT Column_Default from Information_Schema.Columns where Table_Name = ? AND Column_Name = ?;"); $stmt->bindValue(1, Utils::table('poll')); $stmt->bindValue(2, 'end_date'); $stmt->execute(); $default = $stmt->fetch(\PDO::FETCH_COLUMN); $driver_name = $pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); return $default !== null && $driver_name === 'mysql'; } /** * This method is called only one time in the migration page. * * @param \PDO $pdo The connection to database * @return bool|void if the execution succeeded */ function execute(\PDO $pdo) { $pdo->exec('ALTER TABLE ' . Utils::table('poll') . ' MODIFY end_date TIMESTAMP NULL DEFAULT NULL;'); } }