PDOException Object
(
    [message:protected] => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'giftvoucher_credit' already exists
    [string:Exception:private] => 
    [code:protected] => 42S01
    [file:protected] => /home/erogenos/public_html/lib/Zend/Db/Statement/Pdo.php
    [line:protected] => 228
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Zend/Db/Statement/Pdo.php
                    [line] => 228
                    [function] => execute
                    [class] => PDOStatement
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [1] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php
                    [line] => 110
                    [function] => _execute
                    [class] => Zend_Db_Statement_Pdo
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [2] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Zend/Db/Statement.php
                    [line] => 291
                    [function] => _execute
                    [class] => Varien_Db_Statement_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [3] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Zend/Db/Adapter/Abstract.php
                    [line] => 480
                    [function] => execute
                    [class] => Zend_Db_Statement
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [4] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php
                    [line] => 238
                    [function] => query
                    [class] => Zend_Db_Adapter_Abstract
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [5] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 428
                    [function] => query
                    [class] => Zend_Db_Adapter_Pdo_Abstract
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [6] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 347
                    [function] => query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                        )

                )

            [7] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 617
                    [function] => raw_query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                        )

                )

            [8] => Array
                (
                    [file] => /home/erogenos/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 599
                    [function] => multi_query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 

DROP TABLE IF EXISTS giftvoucher_credit;
DROP TABLE IF EXISTS giftvoucher_customer_voucher;
DROP TABLE IF EXISTS giftvoucher_credit_history;
DROP TABLE IF EXISTS giftvoucher_template;
DROP TABLE IF EXISTS giftvoucher_product;

CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_credit_history (
  `history_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `action` varchar(45) default '',
  `currency_balance` decimal(12,4) default '0',
  `giftcard_code` varchar(255) NOT NULL default '',
  `order_id` int(10) NULL ,
  `order_number` varchar(50) default '',
  `balance_change` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  `base_amount` decimal(12,4) default '0',
  `amount` decimal(12,4) default '0',
  `created_date` datetime NULL,
  PRIMARY KEY (`history_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_customer_voucher (
  `customer_voucher_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `voucher_id` int(10) unsigned NOT NULL ,
  `added_date` datetime NULL,
  PRIMARY KEY (`customer_voucher_id`),
  INDEX (`customer_id`),
  INDEX (`voucher_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE,
  FOREIGN KEY (`voucher_id`)
  REFERENCES giftvoucher (`giftvoucher_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_template (
  `template_id` int(10) unsigned NOT NULL auto_increment,
  `type` varchar(45) default '',
  `template_name` varchar(255) default '',
  `pattern` varchar(255) default '',
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  `expired_at` datetime NULL,
  `amount` int(10) default '0',
  `day_to_send` datetime NULL,
  `store_id` smallint(5) unsigned NOT NULL default '0',
  `conditions_serialized` mediumtext default '',
  `is_generated` smallint(5) unsigned NOT NULL default '0',
  PRIMARY KEY (`template_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_product (
  `giftcard_product_id` int(10) unsigned NOT NULL auto_increment,
  `product_id` int(10) unsigned NOT NULL,
  `conditions_serialized` mediumtext NULL,
  PRIMARY KEY (`giftcard_product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


    
                        )

                )

            [9] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 933
                    [function] => multiQuery
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 

DROP TABLE IF EXISTS giftvoucher_credit;
DROP TABLE IF EXISTS giftvoucher_customer_voucher;
DROP TABLE IF EXISTS giftvoucher_credit_history;
DROP TABLE IF EXISTS giftvoucher_template;
DROP TABLE IF EXISTS giftvoucher_product;

CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_credit_history (
  `history_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `action` varchar(45) default '',
  `currency_balance` decimal(12,4) default '0',
  `giftcard_code` varchar(255) NOT NULL default '',
  `order_id` int(10) NULL ,
  `order_number` varchar(50) default '',
  `balance_change` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  `base_amount` decimal(12,4) default '0',
  `amount` decimal(12,4) default '0',
  `created_date` datetime NULL,
  PRIMARY KEY (`history_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_customer_voucher (
  `customer_voucher_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `voucher_id` int(10) unsigned NOT NULL ,
  `added_date` datetime NULL,
  PRIMARY KEY (`customer_voucher_id`),
  INDEX (`customer_id`),
  INDEX (`voucher_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE,
  FOREIGN KEY (`voucher_id`)
  REFERENCES giftvoucher (`giftvoucher_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_template (
  `template_id` int(10) unsigned NOT NULL auto_increment,
  `type` varchar(45) default '',
  `template_name` varchar(255) default '',
  `pattern` varchar(255) default '',
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  `expired_at` datetime NULL,
  `amount` int(10) default '0',
  `day_to_send` datetime NULL,
  `store_id` smallint(5) unsigned NOT NULL default '0',
  `conditions_serialized` mediumtext default '',
  `is_generated` smallint(5) unsigned NOT NULL default '0',
  PRIMARY KEY (`template_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_product (
  `giftcard_product_id` int(10) unsigned NOT NULL auto_increment,
  `product_id` int(10) unsigned NOT NULL,
  `conditions_serialized` mediumtext NULL,
  PRIMARY KEY (`giftcard_product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


    
                        )

                )

            [10] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/local/Magestore/Giftvoucher/sql/giftvoucher_setup/mysql4-upgrade-0.2.3-0.3.0.php
                    [line] => 177
                    [function] => run
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 

DROP TABLE IF EXISTS giftvoucher_credit;
DROP TABLE IF EXISTS giftvoucher_customer_voucher;
DROP TABLE IF EXISTS giftvoucher_credit_history;
DROP TABLE IF EXISTS giftvoucher_template;
DROP TABLE IF EXISTS giftvoucher_product;

CREATE TABLE giftvoucher_credit (
  `credit_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  PRIMARY KEY (`credit_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_credit_history (
  `history_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `action` varchar(45) default '',
  `currency_balance` decimal(12,4) default '0',
  `giftcard_code` varchar(255) NOT NULL default '',
  `order_id` int(10) NULL ,
  `order_number` varchar(50) default '',
  `balance_change` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  `base_amount` decimal(12,4) default '0',
  `amount` decimal(12,4) default '0',
  `created_date` datetime NULL,
  PRIMARY KEY (`history_id`),
  INDEX (`customer_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_customer_voucher (
  `customer_voucher_id` int(10) unsigned NOT NULL auto_increment,
  `customer_id` int(10) unsigned NOT NULL ,
  `voucher_id` int(10) unsigned NOT NULL ,
  `added_date` datetime NULL,
  PRIMARY KEY (`customer_voucher_id`),
  INDEX (`customer_id`),
  INDEX (`voucher_id`),
  FOREIGN KEY (`customer_id`)
  REFERENCES customer_entity (`entity_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE,
  FOREIGN KEY (`voucher_id`)
  REFERENCES giftvoucher (`giftvoucher_id`)
  ON DELETE CASCADE
  ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_template (
  `template_id` int(10) unsigned NOT NULL auto_increment,
  `type` varchar(45) default '',
  `template_name` varchar(255) default '',
  `pattern` varchar(255) default '',
  `balance` decimal(12,4) default '0',
  `currency` varchar(45) default '',
  `expired_at` datetime NULL,
  `amount` int(10) default '0',
  `day_to_send` datetime NULL,
  `store_id` smallint(5) unsigned NOT NULL default '0',
  `conditions_serialized` mediumtext default '',
  `is_generated` smallint(5) unsigned NOT NULL default '0',
  PRIMARY KEY (`template_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE giftvoucher_product (
  `giftcard_product_id` int(10) unsigned NOT NULL auto_increment,
  `product_id` int(10) unsigned NOT NULL,
  `conditions_serialized` mediumtext NULL,
  PRIMARY KEY (`giftcard_product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


    
                        )

                )

            [11] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 624
                    [args] => Array
                        (
                            [0] => /home/erogenos/public_html/app/code/local/Magestore/Giftvoucher/sql/giftvoucher_setup/mysql4-upgrade-0.2.3-0.3.0.php
                        )

                    [function] => include
                )

            [12] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 437
                    [function] => _modifyResourceDb
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => upgrade
                            [1] => 0.2.3
                            [2] => 0.4.3
                        )

                )

            [13] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 320
                    [function] => _upgradeResourceDb
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 0.2.3
                            [1] => 0.4.3
                        )

                )

            [14] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 235
                    [function] => applyUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [15] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/App.php
                    [line] => 417
                    [function] => applyAllUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ::
                    [args] => Array
                        (
                        )

                )

            [16] => Array
                (
                    [file] => /home/erogenos/public_html/app/code/core/Mage/Core/Model/App.php
                    [line] => 343
                    [function] => _initModules
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [17] => Array
                (
                    [file] => /home/erogenos/public_html/app/Mage.php
                    [line] => 684
                    [function] => run
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [scope_code] => 
                                    [scope_type] => store
                                    [options] => Array
                                        (
                                        )

                                )

                        )

                )

            [18] => Array
                (
                    [file] => /home/erogenos/public_html/index.php
                    [line] => 87
                    [function] => run
                    [class] => Mage
                    [type] => ::
                    [args] => Array
                        (
                            [0] => 
                            [1] => store
                        )

                )

        )

    [previous:Exception:private] => 
    [errorInfo] => Array
        (
            [0] => 42S01
            [1] => 1050
            [2] => Table 'giftvoucher_credit' already exists
        )

)