PDOException Object
(
    [message:protected] => SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kgmagento.ewpribbon_image' doesn't exist
    [string:Exception:private] => 
    [code:protected] => 42S02
    [file:protected] => /usr/local/www/magento/lib/Zend/Db/Statement/Pdo.php
    [line:protected] => 228
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /usr/local/www/magento/lib/Zend/Db/Statement/Pdo.php
                    [line] => 228
                    [function] => execute
                    [class] => PDOStatement
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

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

                        )

                )

            [2] => Array
                (
                    [file] => /usr/local/www/magento/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] => /usr/local/www/magento/lib/Zend/Db/Adapter/Abstract.php
                    [line] => 480
                    [function] => execute
                    [class] => Zend_Db_Statement
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [4] => Array
                (
                    [file] => /usr/local/www/magento/lib/Zend/Db/Adapter/Pdo/Abstract.php
                    [line] => 238
                    [function] => query
                    [class] => Zend_Db_Adapter_Abstract
                    [type] => ->
                    [args] => Array
                        (
                            [0] => DESCRIBE `ewpribbon_image`
                            [1] => Array
                                (
                                )

                        )

                )

            [5] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 504
                    [function] => query
                    [class] => Zend_Db_Adapter_Pdo_Abstract
                    [type] => ->
                    [args] => Array
                        (
                            [0] => DESCRIBE `ewpribbon_image`
                            [1] => Array
                                (
                                )

                        )

                )

            [6] => Array
                (
                    [file] => /usr/local/www/magento/lib/Zend/Db/Adapter/Pdo/Mysql.php
                    [line] => 171
                    [function] => query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => DESCRIBE `ewpribbon_image`
                        )

                )

            [7] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 1694
                    [function] => describeTable
                    [class] => Zend_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => ewpribbon_image
                            [1] => 
                        )

                )

            [8] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php
                    [line] => 224
                    [function] => describeTable
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => ewpribbon_image
                        )

                )

            [9] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php
                    [line] => 324
                    [function] => _getColumnDefinitionFromTable
                    [class] => Mage_Core_Model_Resource_Setup_Query_Modifier
                    [type] => ->
                    [args] => Array
                        (
                            [0] => ewpribbon_image
                            [1] => image_id
                        )

                )

            [10] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 379
                    [function] => processQuery
                    [class] => Mage_Core_Model_Resource_Setup_Query_Modifier
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [11] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 547
                    [function] => callbackQueryHook
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [12] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 503
                    [function] => _prepareQuery
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [13] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 423
                    [function] => query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                        )

                )

            [14] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 693
                    [function] => raw_query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
                        )

                )

            [15] => Array
                (
                    [file] => /usr/local/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 675
                    [function] => multi_query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `ewpribbon_image`;
CREATE TABLE `ewpribbon_image` (
  `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `namespace` enum('default','custom') NOT NULL DEFAULT 'custom',
  `path` varchar(255) NOT NULL,
  `width` int(10) unsigned DEFAULT NULL,
  `height` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`image_id`),
  UNIQUE KEY `idx_path` (`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
		
DROP TABLE IF EXISTS `ewpribbon_ribbon`;
CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ewpribbon_ribbon_store`;
CREATE TABLE `ewpribbon_ribbon_store` (
  `ribbon_store_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ribbon_id` int(10) unsigned NOT NULL,
  `store_id` smallint(10) unsigned NOT NULL,
  PRIMARY KEY (`ribbon_store_id`),
  KEY `idx_ribbon_id` (`ribbon_id`),
  KEY `idx_store_id` (`store_id`),
  CONSTRAINT `fk_n5xej5ydxbrci0f` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_nw23qo0i5tzxge0` FOREIGN KEY (`ribbon_id`) REFERENCES `ewpribbon_ribbon` (`ribbon_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ewpribbon_ribbon_product`;
CREATE TABLE `ewpribbon_ribbon_product` (
  `ribbon_product_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `state` enum('included','excluded') NOT NULL DEFAULT 'included',
  `ribbon_id` int(11) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  PRIMARY KEY (`ribbon_product_id`),
  KEY `idx_ribbon_id` (`ribbon_id`),
  KEY `idx_product_id` (`product_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_c7cmbpy725ablws` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_r6muktvd9of5243` FOREIGN KEY (`ribbon_id`) REFERENCES `ewpribbon_ribbon` (`ribbon_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET foreign_key_checks = 1;

                        )

                )

            [16] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 933
                    [function] => multiQuery
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `ewpribbon_image`;
CREATE TABLE `ewpribbon_image` (
  `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `namespace` enum('default','custom') NOT NULL DEFAULT 'custom',
  `path` varchar(255) NOT NULL,
  `width` int(10) unsigned DEFAULT NULL,
  `height` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`image_id`),
  UNIQUE KEY `idx_path` (`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
		
DROP TABLE IF EXISTS `ewpribbon_ribbon`;
CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ewpribbon_ribbon_store`;
CREATE TABLE `ewpribbon_ribbon_store` (
  `ribbon_store_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ribbon_id` int(10) unsigned NOT NULL,
  `store_id` smallint(10) unsigned NOT NULL,
  PRIMARY KEY (`ribbon_store_id`),
  KEY `idx_ribbon_id` (`ribbon_id`),
  KEY `idx_store_id` (`store_id`),
  CONSTRAINT `fk_n5xej5ydxbrci0f` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_nw23qo0i5tzxge0` FOREIGN KEY (`ribbon_id`) REFERENCES `ewpribbon_ribbon` (`ribbon_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ewpribbon_ribbon_product`;
CREATE TABLE `ewpribbon_ribbon_product` (
  `ribbon_product_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `state` enum('included','excluded') NOT NULL DEFAULT 'included',
  `ribbon_id` int(11) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  PRIMARY KEY (`ribbon_product_id`),
  KEY `idx_ribbon_id` (`ribbon_id`),
  KEY `idx_product_id` (`product_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_c7cmbpy725ablws` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_r6muktvd9of5243` FOREIGN KEY (`ribbon_id`) REFERENCES `ewpribbon_ribbon` (`ribbon_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET foreign_key_checks = 1;

                        )

                )

            [17] => Array
                (
                    [file] => /usr/local/www/magento/app/code/local/Extendware/EWPRibbon/sql/ewpribbon_setup/mysql4-install-1.0.0.php
                    [line] => 94
                    [function] => run
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `ewpribbon_image`;
CREATE TABLE `ewpribbon_image` (
  `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `namespace` enum('default','custom') NOT NULL DEFAULT 'custom',
  `path` varchar(255) NOT NULL,
  `width` int(10) unsigned DEFAULT NULL,
  `height` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`image_id`),
  UNIQUE KEY `idx_path` (`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
		
DROP TABLE IF EXISTS `ewpribbon_ribbon`;
CREATE TABLE `ewpribbon_ribbon` (
  `ribbon_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `rule_processing_mode` enum('stop','continue') NOT NULL,
  `hide_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `default_condition_state` enum('pass','fail') NOT NULL DEFAULT 'fail',
  `name` varchar(255) NOT NULL,
  `product_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `product_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `product_text` varchar(255) NOT NULL,
  `product_image_id` int(11) unsigned DEFAULT NULL,
  `product_text_style` text NOT NULL,
  `product_image_style` text NOT NULL,
  `product_container_style` text NOT NULL,
  `product_inner_container_style` text NOT NULL,
  `category_status` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
  `category_position` enum('top_left','top_center','top_right','middle_left','middle_center','middle_right','bottom_left','bottom_center','bottom_right') NOT NULL DEFAULT 'top_left',
  `category_text` varchar(255) NOT NULL,
  `category_image_id` int(11) unsigned DEFAULT NULL,
  `category_text_style` text NOT NULL,
  `category_image_style` text NOT NULL,
  `category_container_style` text NOT NULL,
  `category_inner_container_style` text NOT NULL,
  `has_products` tinyint(3) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `priority` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`ribbon_id`),
  KEY `idx_product_image_id` (`product_image_id`),
  KEY `idx_category_image_id` (`category_image_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_d5vmnkyvgfsagap` FOREIGN KEY (`product_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_syc2xdete5mm99o` FOREIGN KEY (`category_image_id`) REFERENCES `ewpribbon_image` (`image_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ewpribbon_ribbon_store`;
CREATE TABLE `ewpribbon_ribbon_store` (
  `ribbon_store_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ribbon_id` int(10) unsigned NOT NULL,
  `store_id` smallint(10) unsigned NOT NULL,
  PRIMARY KEY (`ribbon_store_id`),
  KEY `idx_ribbon_id` (`ribbon_id`),
  KEY `idx_store_id` (`store_id`),
  CONSTRAINT `fk_n5xej5ydxbrci0f` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_nw23qo0i5tzxge0` FOREIGN KEY (`ribbon_id`) REFERENCES `ewpribbon_ribbon` (`ribbon_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ewpribbon_ribbon_product`;
CREATE TABLE `ewpribbon_ribbon_product` (
  `ribbon_product_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `state` enum('included','excluded') NOT NULL DEFAULT 'included',
  `ribbon_id` int(11) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `from_date` datetime DEFAULT NULL,
  `to_date` datetime DEFAULT NULL,
  PRIMARY KEY (`ribbon_product_id`),
  KEY `idx_ribbon_id` (`ribbon_id`),
  KEY `idx_product_id` (`product_id`),
  KEY `idx_from_date` (`from_date`),
  KEY `idx_to_date` (`to_date`),
  CONSTRAINT `fk_c7cmbpy725ablws` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_r6muktvd9of5243` FOREIGN KEY (`ribbon_id`) REFERENCES `ewpribbon_ribbon` (`ribbon_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET foreign_key_checks = 1;

                        )

                )

            [18] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 624
                    [args] => Array
                        (
                            [0] => /usr/local/www/magento/app/code/local/Extendware/EWPRibbon/sql/ewpribbon_setup/mysql4-install-1.0.0.php
                        )

                    [function] => include
                )

            [19] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 421
                    [function] => _modifyResourceDb
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => install
                            [1] => 
                            [2] => 1.3.4
                        )

                )

            [20] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 327
                    [function] => _installResourceDb
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 1.3.4
                        )

                )

            [21] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 235
                    [function] => applyUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [22] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/App.php
                    [line] => 428
                    [function] => applyAllUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ::
                    [args] => Array
                        (
                        )

                )

            [23] => Array
                (
                    [file] => /usr/local/www/magento/app/code/core/Mage/Core/Model/App.php
                    [line] => 354
                    [function] => _initModules
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [24] => Array
                (
                    [file] => /usr/local/www/magento/app/Mage.php
                    [line] => 684
                    [function] => run
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [scope_code] => 
                                    [scope_type] => store
                                    [options] => Array
                                        (
                                        )

                                )

                        )

                )

            [25] => Array
                (
                    [file] => /usr/local/www/magento/index.php
                    [line] => 83
                    [function] => run
                    [class] => Mage
                    [type] => ::
                    [args] => Array
                        (
                            [0] => 
                            [1] => store
                        )

                )

        )

    [previous:Exception:private] => 
    [errorInfo] => Array
        (
            [0] => 42S02
            [1] => 1146
            [2] => Table 'kgmagento.ewpribbon_image' doesn't exist
        )

)
Error in file: "/usr/local/www/magento/app/code/local/Extendware/EWPRibbon/sql/ewpribbon_setup/mysql4-install-1.0.0.php" - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kgmagento.ewpribbon_image' doesn't exist

#0 /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.3.4')
#2 /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.3.4')
#3 /usr/local/www/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /usr/local/www/magento/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /usr/local/www/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /usr/local/www/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /usr/local/www/magento/index.php(83): Mage::run('', 'store')
#8 {main}