<?php

class Upgrade2 extends UpgradeNew
{
    // overi, jestli je opravnene provest upgrade
    public function checkRightfulness_1()
    {
        $change = true;

        $SQL = sqlQuery('SHOW FIELDS FROM '.getTableName('products'));
        while ($row = sqlFetchArray($SQL)) {
            if ($row['Field'] == 'show_raw_price') {
                $change = false;
                break;
            }
        }

        return $change;
    }

    // provest samotny upgrade
    public function makeChanges_1()
    {
        sqlQuery("ALTER TABLE `products` ADD `show_raw_price` ENUM( 'Y', 'N' ) NOT NULL DEFAULT 'N';");

        $this->upgradeOK();
    }
}
