<?php

/**
 * @version            $Id$
 * @package            ARTIO Booking
 * @copyright        Copyright (C) 2010 ARTIO s.r.o.. All rights reserved.
 * @author            ARTIO s.r.o., http://www.artio.net
 * @license        GNU/GPL http://www.gnu.org/copyleft/gpl.html
 * @link            http://www.artio.net Official website
 */
defined('_JEXEC') or die('Restricted access');

/* @var $this BookingModelUpgrade */

require_once dirname(__FILE__) . '/reinstall.php';

$db = JFactory::getDbo();

$db->setQuery('SHOW FIELDS FROM #__booking_price WHERE Field = ' . $db->quote('discount_all_units'));
if (!$db->loadObject()) {
    $this->_addSQL('ALTER TABLE #__booking_price ADD discount_all_units TINYINT(1) NOT NULL DEFAULT 1 AFTER volume_type');
}