1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
9	header("location: index.php");
10	exit;
11}
12
13/**
14 * @param $installer
15 */
16function upgrade_20110610_revert_poll_additions_tiki($installer)
17{
18	$installer->query("DROP TABLE IF EXISTS `tiki_poll_votes`");
19	$result = $installer->fetchAll("SHOW COLUMNS FROM `tiki_polls` WHERE `Field`='anonym'");
20
21	if ($result) {
22		$result = $installer->query("ALTER TABLE `tiki_polls` DROP COLUMN `anonym`;");
23	}
24}
25