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

                        )

                )

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

                        )

                )

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

                        )

                )

            [4] => Array
                (
                    [file] => /var/www/html/elsevierasia/lib/Zend/Db/Adapter/Pdo/Abstract.php
                    [line] => 238
                    [function] => query
                    [class] => Zend_Db_Adapter_Abstract
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -- DROP TABLE IF EXISTS easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [5] => Array
                (
                    [file] => /var/www/html/elsevierasia/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 428
                    [function] => query
                    [class] => Zend_Db_Adapter_Pdo_Abstract
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -- DROP TABLE IF EXISTS easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
                            [1] => Array
                                (
                                )

                        )

                )

            [6] => Array
                (
                    [file] => /var/www/html/elsevierasia/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 347
                    [function] => query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -- DROP TABLE IF EXISTS easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
                        )

                )

            [7] => Array
                (
                    [file] => /var/www/html/elsevierasia/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] => 617
                    [function] => raw_query
                    [class] => Varien_Db_Adapter_Pdo_Mysql
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -- DROP TABLE IF EXISTS easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
                        )

                )

            [8] => Array
                (
                    [file] => /var/www/html/elsevierasia/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 easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_placeholder;
CREATE TABLE  easybanner_banner_placeholder (
  `banner_id` smallint(6) unsigned NOT NULL,
  `placeholder_id` smallint(6) unsigned NOT NULL,
  PRIMARY KEY (`banner_id`,`placeholder_id`),
  KEY `FK_easybanner_banner_placeholder_placeholder_id` (`placeholder_id`),
  CONSTRAINT `FK_easybanner_banner_placeholder_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_easybanner_banner_placeholder_placeholder_id` FOREIGN KEY (`placeholder_id`) REFERENCES easybanner_placeholder (`placeholder_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_statistic;
CREATE TABLE  easybanner_banner_statistic (
  `banner_id` smallint(6) unsigned NOT NULL,
  `date` date NOT NULL,
  `display_count` int(10) unsigned NOT NULL DEFAULT '0',
  `clicks_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY  USING BTREE (`banner_id`,`date`),
  CONSTRAINT `FK_easybanner_banner_statistic_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_store;
CREATE TABLE  easybanner_banner_store (
  `banner_id` smallint(6) unsigned NOT NULL,
  `store_id` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`banner_id`,`store_id`),
  KEY `FK_easybanner_banner_store_store_id` (`store_id`),
  CONSTRAINT `FK_easybanner_banner_store_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_easybanner_banner_store_store_id` FOREIGN KEY (`store_id`) REFERENCES core_store (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_placeholder;
CREATE TABLE  easybanner_placeholder (
  `placeholder_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `parent_block` varchar(64) NOT NULL,
  `position` varchar(128) NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `limit` tinyint(3) unsigned NOT NULL,
  `mode` enum('rotator','slider') NOT NULL DEFAULT 'rotator',
  `banner_offset` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`placeholder_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_placeholder (`placeholder_id`, `name`, `parent_block`, `position`, `status`, `limit`, `mode`, `banner_offset`) VALUES
(1, 'left-top', 'left', 'before="-"', 1, 1, 'rotator', 1),
(2, 'right-top', 'right', 'before="-"', 1, 1, 'rotator', 1),
(3, 'right-bottom', 'right', 'after="-"', 1, 1, 'rotator', 1),
(4, 'left-bottom', 'left', 'after="-"', 1, 1, 'rotator', 1),
(5, 'content-top', 'content', 'before="-"', 1, 1, 'rotator', 1),
(6, 'content-bottom', 'content', 'after="-"', 1, 1, 'rotator', 1),
(7, 'nav-top', 'top.menu', 'before="-"', 1, 1, 'rotator', 1),
(8, 'nav-bottom', 'top.menu', 'after="-"', 1, 1, 'rotator', 1),
(9, 'page-bottom', 'before_body_end', 'after="-"', 1, 1, 'rotator', 1);

-- DROP TABLE IF EXISTS easybanner_layout_update;
CREATE TABLE  easybanner_layout_update (
  `layout_update_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `handle` varchar(255) DEFAULT NULL,
  `xml` text,
  PRIMARY KEY (`layout_update_id`),
  KEY `handle` (`handle`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_layout_update (`layout_update_id`, `handle`, `xml`) VALUES
(1, 'default', '
  
    1
  
'),
(2, 'default', '
  
    2
  
'),
(3, 'default', '
  
    3
  
'),
(4, 'default', '
  
    4
  
'),
(5, 'default', '
  
    5
  
'),
(6, 'default', '
  
    6
  
'),
(7, 'default', '
  
    7
  
'),
(8, 'default', '
  
    8
  
'),
(9, 'default', '
  
    9
  
');

-- DROP TABLE IF EXISTS easybanner_layout_link;
CREATE TABLE  easybanner_layout_link (
  `layout_link_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `placeholder_id` smallint(6) unsigned NOT NULL DEFAULT '0',
  `banner_id` smallint(6) unsigned DEFAULT NULL,
  `layout_update_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`layout_link_id`),
  UNIQUE KEY `KEY_store_id` (`store_id`,`placeholder_id`,`banner_id`,`layout_update_id`),
  KEY `FK_easybanner_layout_link_layout_update_id` (`layout_update_id`),
  KEY `FK_easybanner_layout_link_placeholder_id` (`placeholder_id`),
  KEY `FK_easybanner_layout_link_banner_id` (`banner_id`),
  CONSTRAINT `FK_easybanner_layout_link_layout_update_id` FOREIGN KEY (`layout_update_id`) REFERENCES easybanner_layout_update (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_layout_link (`layout_link_id`, `store_id`, `placeholder_id`, `banner_id`, `layout_update_id`) VALUES
(1, 0, 1, NULL, 1),
(2, 0, 2, NULL, 2),
(3, 0, 3, NULL, 3),
(4, 0, 4, NULL, 4),
(5, 0, 5, NULL, 5),
(6, 0, 6, NULL, 6),
(7, 0, 7, NULL, 7),
(8, 0, 8, NULL, 8),
(9, 0, 9, NULL, 9);


                        )

                )

            [9] => Array
                (
                    [file] => /var/www/html/elsevierasia/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 easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_placeholder;
CREATE TABLE  easybanner_banner_placeholder (
  `banner_id` smallint(6) unsigned NOT NULL,
  `placeholder_id` smallint(6) unsigned NOT NULL,
  PRIMARY KEY (`banner_id`,`placeholder_id`),
  KEY `FK_easybanner_banner_placeholder_placeholder_id` (`placeholder_id`),
  CONSTRAINT `FK_easybanner_banner_placeholder_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_easybanner_banner_placeholder_placeholder_id` FOREIGN KEY (`placeholder_id`) REFERENCES easybanner_placeholder (`placeholder_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_statistic;
CREATE TABLE  easybanner_banner_statistic (
  `banner_id` smallint(6) unsigned NOT NULL,
  `date` date NOT NULL,
  `display_count` int(10) unsigned NOT NULL DEFAULT '0',
  `clicks_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY  USING BTREE (`banner_id`,`date`),
  CONSTRAINT `FK_easybanner_banner_statistic_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_store;
CREATE TABLE  easybanner_banner_store (
  `banner_id` smallint(6) unsigned NOT NULL,
  `store_id` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`banner_id`,`store_id`),
  KEY `FK_easybanner_banner_store_store_id` (`store_id`),
  CONSTRAINT `FK_easybanner_banner_store_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_easybanner_banner_store_store_id` FOREIGN KEY (`store_id`) REFERENCES core_store (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_placeholder;
CREATE TABLE  easybanner_placeholder (
  `placeholder_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `parent_block` varchar(64) NOT NULL,
  `position` varchar(128) NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `limit` tinyint(3) unsigned NOT NULL,
  `mode` enum('rotator','slider') NOT NULL DEFAULT 'rotator',
  `banner_offset` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`placeholder_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_placeholder (`placeholder_id`, `name`, `parent_block`, `position`, `status`, `limit`, `mode`, `banner_offset`) VALUES
(1, 'left-top', 'left', 'before="-"', 1, 1, 'rotator', 1),
(2, 'right-top', 'right', 'before="-"', 1, 1, 'rotator', 1),
(3, 'right-bottom', 'right', 'after="-"', 1, 1, 'rotator', 1),
(4, 'left-bottom', 'left', 'after="-"', 1, 1, 'rotator', 1),
(5, 'content-top', 'content', 'before="-"', 1, 1, 'rotator', 1),
(6, 'content-bottom', 'content', 'after="-"', 1, 1, 'rotator', 1),
(7, 'nav-top', 'top.menu', 'before="-"', 1, 1, 'rotator', 1),
(8, 'nav-bottom', 'top.menu', 'after="-"', 1, 1, 'rotator', 1),
(9, 'page-bottom', 'before_body_end', 'after="-"', 1, 1, 'rotator', 1);

-- DROP TABLE IF EXISTS easybanner_layout_update;
CREATE TABLE  easybanner_layout_update (
  `layout_update_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `handle` varchar(255) DEFAULT NULL,
  `xml` text,
  PRIMARY KEY (`layout_update_id`),
  KEY `handle` (`handle`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_layout_update (`layout_update_id`, `handle`, `xml`) VALUES
(1, 'default', '
  
    1
  
'),
(2, 'default', '
  
    2
  
'),
(3, 'default', '
  
    3
  
'),
(4, 'default', '
  
    4
  
'),
(5, 'default', '
  
    5
  
'),
(6, 'default', '
  
    6
  
'),
(7, 'default', '
  
    7
  
'),
(8, 'default', '
  
    8
  
'),
(9, 'default', '
  
    9
  
');

-- DROP TABLE IF EXISTS easybanner_layout_link;
CREATE TABLE  easybanner_layout_link (
  `layout_link_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `placeholder_id` smallint(6) unsigned NOT NULL DEFAULT '0',
  `banner_id` smallint(6) unsigned DEFAULT NULL,
  `layout_update_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`layout_link_id`),
  UNIQUE KEY `KEY_store_id` (`store_id`,`placeholder_id`,`banner_id`,`layout_update_id`),
  KEY `FK_easybanner_layout_link_layout_update_id` (`layout_update_id`),
  KEY `FK_easybanner_layout_link_placeholder_id` (`placeholder_id`),
  KEY `FK_easybanner_layout_link_banner_id` (`banner_id`),
  CONSTRAINT `FK_easybanner_layout_link_layout_update_id` FOREIGN KEY (`layout_update_id`) REFERENCES easybanner_layout_update (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_layout_link (`layout_link_id`, `store_id`, `placeholder_id`, `banner_id`, `layout_update_id`) VALUES
(1, 0, 1, NULL, 1),
(2, 0, 2, NULL, 2),
(3, 0, 3, NULL, 3),
(4, 0, 4, NULL, 4),
(5, 0, 5, NULL, 5),
(6, 0, 6, NULL, 6),
(7, 0, 7, NULL, 7),
(8, 0, 8, NULL, 8),
(9, 0, 9, NULL, 9);


                        )

                )

            [10] => Array
                (
                    [file] => /var/www/html/elsevierasia/app/code/local/TM/EasyBanner/sql/easybanner_setup/mysql4-install-1.0.0.php
                    [line] => 136
                    [function] => run
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 

-- DROP TABLE IF EXISTS easybanner_banner;
CREATE TABLE  easybanner_banner (
  `banner_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(64) NOT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `title` text NOT NULL,
  `url` varchar(255) NOT NULL DEFAULT '#',
  `image` varchar(255) NOT NULL,
  `html` text NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `mode` enum('image','html') NOT NULL DEFAULT 'image',
  `target` enum('self','blank','popup') NOT NULL,
  `hide_url` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions_serialized` text NOT NULL,
  PRIMARY KEY (`banner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_placeholder;
CREATE TABLE  easybanner_banner_placeholder (
  `banner_id` smallint(6) unsigned NOT NULL,
  `placeholder_id` smallint(6) unsigned NOT NULL,
  PRIMARY KEY (`banner_id`,`placeholder_id`),
  KEY `FK_easybanner_banner_placeholder_placeholder_id` (`placeholder_id`),
  CONSTRAINT `FK_easybanner_banner_placeholder_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_easybanner_banner_placeholder_placeholder_id` FOREIGN KEY (`placeholder_id`) REFERENCES easybanner_placeholder (`placeholder_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_statistic;
CREATE TABLE  easybanner_banner_statistic (
  `banner_id` smallint(6) unsigned NOT NULL,
  `date` date NOT NULL,
  `display_count` int(10) unsigned NOT NULL DEFAULT '0',
  `clicks_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY  USING BTREE (`banner_id`,`date`),
  CONSTRAINT `FK_easybanner_banner_statistic_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_banner_store;
CREATE TABLE  easybanner_banner_store (
  `banner_id` smallint(6) unsigned NOT NULL,
  `store_id` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`banner_id`,`store_id`),
  KEY `FK_easybanner_banner_store_store_id` (`store_id`),
  CONSTRAINT `FK_easybanner_banner_store_banner_id` FOREIGN KEY (`banner_id`) REFERENCES easybanner_banner (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_easybanner_banner_store_store_id` FOREIGN KEY (`store_id`) REFERENCES core_store (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS easybanner_placeholder;
CREATE TABLE  easybanner_placeholder (
  `placeholder_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `parent_block` varchar(64) NOT NULL,
  `position` varchar(128) NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `limit` tinyint(3) unsigned NOT NULL,
  `mode` enum('rotator','slider') NOT NULL DEFAULT 'rotator',
  `banner_offset` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`placeholder_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_placeholder (`placeholder_id`, `name`, `parent_block`, `position`, `status`, `limit`, `mode`, `banner_offset`) VALUES
(1, 'left-top', 'left', 'before="-"', 1, 1, 'rotator', 1),
(2, 'right-top', 'right', 'before="-"', 1, 1, 'rotator', 1),
(3, 'right-bottom', 'right', 'after="-"', 1, 1, 'rotator', 1),
(4, 'left-bottom', 'left', 'after="-"', 1, 1, 'rotator', 1),
(5, 'content-top', 'content', 'before="-"', 1, 1, 'rotator', 1),
(6, 'content-bottom', 'content', 'after="-"', 1, 1, 'rotator', 1),
(7, 'nav-top', 'top.menu', 'before="-"', 1, 1, 'rotator', 1),
(8, 'nav-bottom', 'top.menu', 'after="-"', 1, 1, 'rotator', 1),
(9, 'page-bottom', 'before_body_end', 'after="-"', 1, 1, 'rotator', 1);

-- DROP TABLE IF EXISTS easybanner_layout_update;
CREATE TABLE  easybanner_layout_update (
  `layout_update_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `handle` varchar(255) DEFAULT NULL,
  `xml` text,
  PRIMARY KEY (`layout_update_id`),
  KEY `handle` (`handle`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_layout_update (`layout_update_id`, `handle`, `xml`) VALUES
(1, 'default', '
  
    1
  
'),
(2, 'default', '
  
    2
  
'),
(3, 'default', '
  
    3
  
'),
(4, 'default', '
  
    4
  
'),
(5, 'default', '
  
    5
  
'),
(6, 'default', '
  
    6
  
'),
(7, 'default', '
  
    7
  
'),
(8, 'default', '
  
    8
  
'),
(9, 'default', '
  
    9
  
');

-- DROP TABLE IF EXISTS easybanner_layout_link;
CREATE TABLE  easybanner_layout_link (
  `layout_link_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `placeholder_id` smallint(6) unsigned NOT NULL DEFAULT '0',
  `banner_id` smallint(6) unsigned DEFAULT NULL,
  `layout_update_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`layout_link_id`),
  UNIQUE KEY `KEY_store_id` (`store_id`,`placeholder_id`,`banner_id`,`layout_update_id`),
  KEY `FK_easybanner_layout_link_layout_update_id` (`layout_update_id`),
  KEY `FK_easybanner_layout_link_placeholder_id` (`placeholder_id`),
  KEY `FK_easybanner_layout_link_banner_id` (`banner_id`),
  CONSTRAINT `FK_easybanner_layout_link_layout_update_id` FOREIGN KEY (`layout_update_id`) REFERENCES easybanner_layout_update (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

INSERT INTO easybanner_layout_link (`layout_link_id`, `store_id`, `placeholder_id`, `banner_id`, `layout_update_id`) VALUES
(1, 0, 1, NULL, 1),
(2, 0, 2, NULL, 2),
(3, 0, 3, NULL, 3),
(4, 0, 4, NULL, 4),
(5, 0, 5, NULL, 5),
(6, 0, 6, NULL, 6),
(7, 0, 7, NULL, 7),
(8, 0, 8, NULL, 8),
(9, 0, 9, NULL, 9);


                        )

                )

            [11] => Array
                (
                    [file] => /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] => 624
                    [args] => Array
                        (
                            [0] => /var/www/html/elsevierasia/app/code/local/TM/EasyBanner/sql/easybanner_setup/mysql4-install-1.0.0.php
                        )

                    [function] => include
                )

            [12] => Array
                (
                    [file] => /var/www/html/elsevierasia/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.1
                        )

                )

            [13] => Array
                (
                    [file] => /var/www/html/elsevierasia/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.1
                        )

                )

            [14] => Array
                (
                    [file] => /var/www/html/elsevierasia/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] => /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/App.php
                    [line] => 417
                    [function] => applyAllUpdates
                    [class] => Mage_Core_Model_Resource_Setup
                    [type] => ::
                    [args] => Array
                        (
                        )

                )

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

                )

            [17] => Array
                (
                    [file] => /var/www/html/elsevierasia/app/Mage.php
                    [line] => 684
                    [function] => run
                    [class] => Mage_Core_Model_App
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [scope_code] => base
                                    [scope_type] => website
                                    [options] => Array
                                        (
                                        )

                                )

                        )

                )

            [18] => Array
                (
                    [file] => /var/www/html/elsevierasia/index.php
                    [line] => 88
                    [function] => run
                    [class] => Mage
                    [type] => ::
                    [args] => Array
                        (
                            [0] => base
                            [1] => website
                        )

                )

        )

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

    [xdebug_message] => 
PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'easybanner_banner' already exists in /var/www/html/elsevierasia/lib/Zend/Db/Statement/Pdo.php on line 228

Call Stack:
    0.0033     654512   1. {main}() /var/www/html/elsevierasia/index.php:0
    0.0156    1163880   2. Mage::run() /var/www/html/elsevierasia/index.php:88
    0.0407    2813672   3. Mage_Core_Model_App->run() /var/www/html/elsevierasia/app/Mage.php:684
    0.0989    4988776   4. Mage_Core_Model_App->_initModules() /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/App.php:343
    2.0895    9152392   5. Mage_Core_Model_Resource_Setup::applyAllUpdates() /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/App.php:417
    2.3117   12790272   6. Mage_Core_Model_Resource_Setup->applyUpdates() /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/Resource/Setup.php:235
    2.3120   12787312   7. Mage_Core_Model_Resource_Setup->_installResourceDb() /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/Resource/Setup.php:327
    2.3120   12787472   8. Mage_Core_Model_Resource_Setup->_modifyResourceDb() /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/Resource/Setup.php:421
    2.3175   12822240   9. include('/var/www/html/elsevierasia/app/code/local/TM/EasyBanner/sql/easybanner_setup/mysql4-install-1.0.0.php') /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/Resource/Setup.php:624
    2.3242   12934048  10. Mage_Core_Model_Resource_Setup->run() /var/www/html/elsevierasia/app/code/local/TM/EasyBanner/sql/easybanner_setup/mysql4-install-1.0.0.php:136
    2.3242   12934048  11. Varien_Db_Adapter_Pdo_Mysql->multiQuery() /var/www/html/elsevierasia/app/code/core/Mage/Core/Model/Resource/Setup.php:933
    2.3242   12934048  12. Varien_Db_Adapter_Pdo_Mysql->multi_query() /var/www/html/elsevierasia/lib/Varien/Db/Adapter/Pdo/Mysql.php:599

)