diff --git a/theme-overrides/displayHomeUsps1/banner.tpl b/theme-overrides/displayHomeUsps1/banner.tpl deleted file mode 100644 index 01a5f80..0000000 --- a/theme-overrides/displayHomeUsps1/banner.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{if !empty($block.link)}{/if} -

- {$block.title|escape:'html':'UTF-8'} -

- {if !empty($block.description)} -

- {$block.description|escape:'html':'UTF-8'|nl2br} -

- {/if} -{if !empty($block.link)}
{/if} diff --git a/theme-overrides/displayHomeUsps2/usp.tpl b/theme-overrides/displayHomeUsps2/usp.tpl deleted file mode 100644 index cfae01a..0000000 --- a/theme-overrides/displayHomeUsps2/usp.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{if !empty($block.link)}{/if} - /{$iteration|string_format:"%02d"} -

- {$block.title|escape:'html':'UTF-8'} -

- {if !empty($block.description)} -

- {$block.description|escape:'html':'UTF-8'|nl2br} -

- {/if} -{if !empty($block.link)}
{/if} diff --git a/upgrade/upgrade-1.10.0.php b/upgrade/upgrade-1.10.0.php deleted file mode 100644 index f2b3626..0000000 --- a/upgrade/upgrade-1.10.0.php +++ /dev/null @@ -1,31 +0,0 @@ - 'VARCHAR(16) NOT NULL DEFAULT \'info\'', - 'timeout' => 'INT(11) NOT NULL DEFAULT 0', - ]; - - foreach ($columnsToAdd as $column => $definition) { - $existing = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'' . $column . '\'' - ); - - if (!empty($existing)) { - continue; - } - - if (!Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` ADD COLUMN `' . $column . '` ' . $definition - )) { - return false; - } - } - - return true; -} diff --git a/upgrade/upgrade-1.11.0.php b/upgrade/upgrade-1.11.0.php deleted file mode 100644 index d9b74b2..0000000 --- a/upgrade/upgrade-1.11.0.php +++ /dev/null @@ -1,24 +0,0 @@ -executeS( - 'SELECT `id_ws_customhtml_group` FROM `' . _DB_PREFIX_ . 'ws_customhtml_group` ORDER BY `id_ws_customhtml_group` ASC' - ); - - foreach ($groups as $index => $group) { - if (!Db::getInstance()->update( - 'ws_customhtml_group', - ['ordering' => (int) $index], - '`id_ws_customhtml_group` = ' . (int) $group['id_ws_customhtml_group'] - )) { - return false; - } - } - - return true; -} diff --git a/upgrade/upgrade-1.13.0.php b/upgrade/upgrade-1.13.0.php deleted file mode 100644 index a6bcf42..0000000 --- a/upgrade/upgrade-1.13.0.php +++ /dev/null @@ -1,21 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_group` LIKE \'custom_class\'' - ); - - if (!empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml_group` - ADD COLUMN `custom_class` VARCHAR(128) NOT NULL DEFAULT \'\' AFTER `title`' - ); -} diff --git a/upgrade/upgrade-1.15.0.php b/upgrade/upgrade-1.15.0.php deleted file mode 100644 index af84f6b..0000000 --- a/upgrade/upgrade-1.15.0.php +++ /dev/null @@ -1,21 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'link_text\'' - ); - - if (!empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - ADD COLUMN `link_text` VARCHAR(128) NOT NULL DEFAULT \'\' AFTER `link`' - ); -} diff --git a/upgrade/upgrade-1.16.0.php b/upgrade/upgrade-1.16.0.php deleted file mode 100644 index f6428be..0000000 --- a/upgrade/upgrade-1.16.0.php +++ /dev/null @@ -1,48 +0,0 @@ - 'DECIMAL(4,2) NOT NULL DEFAULT 1', - 'slides_per_view_tablet' => 'DECIMAL(4,2) NOT NULL DEFAULT 2', - 'slides_per_view_desktop' => 'DECIMAL(4,2) NOT NULL DEFAULT 3', - 'autoplay_delay' => 'INT(11) NOT NULL DEFAULT 0', - ]; - - foreach ($columnsToAdd as $column => $definition) { - $existing = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'' . $column . '\'' - ); - - if (!empty($existing)) { - continue; - } - - if (!Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` ADD COLUMN `' . $column . '` ' . $definition - )) { - return false; - } - } - - return Db::getInstance()->execute( - 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_slide` ( - `id_ws_customhtml_slide` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, - `id_ws_customhtml` INT(11) NOT NULL, - `title` VARCHAR(256) NOT NULL DEFAULT \'\', - `description` TEXT, - `extra_description` TEXT, - `link` VARCHAR(512) NOT NULL DEFAULT \'\', - `link_text` VARCHAR(128) NOT NULL DEFAULT \'\', - `image` VARCHAR(255) NOT NULL DEFAULT \'\', - `ordering` INT(11) NOT NULL DEFAULT 0, - `date_add` DATETIME NOT NULL, - `date_upd` DATETIME NOT NULL, - KEY `id_ws_customhtml` (`id_ws_customhtml`) - )' - ); -} diff --git a/upgrade/upgrade-1.17.0.php b/upgrade/upgrade-1.17.0.php deleted file mode 100644 index f3ef049..0000000 --- a/upgrade/upgrade-1.17.0.php +++ /dev/null @@ -1,21 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'slider_mode\'' - ); - - if (!empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - ADD COLUMN `slider_mode` VARCHAR(16) NOT NULL DEFAULT \'always\' AFTER `timeout`' - ); -} diff --git a/upgrade/upgrade-1.19.0.php b/upgrade/upgrade-1.19.0.php deleted file mode 100644 index b70737a..0000000 --- a/upgrade/upgrade-1.19.0.php +++ /dev/null @@ -1,21 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_group` LIKE \'default_block_class\'' - ); - - if (!empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml_group` - ADD COLUMN `default_block_class` VARCHAR(128) NOT NULL DEFAULT \'\' AFTER `custom_class`' - ); -} diff --git a/upgrade/upgrade-1.2.0.php b/upgrade/upgrade-1.2.0.php deleted file mode 100644 index 8940450..0000000 --- a/upgrade/upgrade-1.2.0.php +++ /dev/null @@ -1,38 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'type\'' - ); - - if (empty($columns)) { - if (!Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - ADD COLUMN `type` VARCHAR(32) NOT NULL DEFAULT \'html\' AFTER `title`' - )) { - return false; - } - } - - if (!Db::getInstance()->execute( - 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_faq` ( - `id_ws_customhtml_faq` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, - `id_ws_customhtml` INT(11) NOT NULL, - `question` VARCHAR(512) NOT NULL DEFAULT \'\', - `answer` TEXT, - `ordering` INT(11) NOT NULL DEFAULT 0, - `date_add` DATETIME NOT NULL, - `date_upd` DATETIME NOT NULL, - KEY `id_ws_customhtml` (`id_ws_customhtml`) - )' - )) { - return false; - } - - return $module->registerHook('actionCustomhtmlblockGridDataModifier'); -} diff --git a/upgrade/upgrade-1.20.0.php b/upgrade/upgrade-1.20.0.php deleted file mode 100644 index 91fbcff..0000000 --- a/upgrade/upgrade-1.20.0.php +++ /dev/null @@ -1,88 +0,0 @@ -execute( - 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_group_lang` ( - `id_ws_customhtml_group` INT(11) NOT NULL, - `id_lang` INT(11) NOT NULL, - `title` VARCHAR(256) NOT NULL DEFAULT \'\', - PRIMARY KEY (`id_ws_customhtml_group`, `id_lang`) - );' - ); -} - -function migrateGroupTitlesToLangTable(): bool -{ - $groupColumns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_group` LIKE \'title\'' - ); - - if (empty($groupColumns)) { - // Already migrated in a previous run of this upgrade. - return true; - } - - $groups = Db::getInstance()->executeS( - 'SELECT `id_ws_customhtml_group`, `title` FROM `' . _DB_PREFIX_ . 'ws_customhtml_group`' - ); - $languages = Language::getLanguages(false); - - foreach ($groups as $group) { - foreach ($languages as $language) { - $existing = Db::getInstance()->executeS( - 'SELECT 1 FROM `' . _DB_PREFIX_ . 'ws_customhtml_group_lang` - WHERE `id_ws_customhtml_group` = ' . (int) $group['id_ws_customhtml_group'] . ' - AND `id_lang` = ' . (int) $language['id_lang'] - ); - - if (!empty($existing)) { - continue; - } - - $result = Db::getInstance()->insert('ws_customhtml_group_lang', [ - 'id_ws_customhtml_group' => (int) $group['id_ws_customhtml_group'], - 'id_lang' => (int) $language['id_lang'], - 'title' => pSQL($group['title']), - ]); - - if (!$result) { - return false; - } - } - } - - return true; -} - -function dropGroupTitleColumn(): bool -{ - $groupColumns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_group` LIKE \'title\'' - ); - - if (empty($groupColumns)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml_group` DROP COLUMN `title`' - ); -} diff --git a/upgrade/upgrade-1.21.0.php b/upgrade/upgrade-1.21.0.php deleted file mode 100644 index 900b057..0000000 --- a/upgrade/upgrade-1.21.0.php +++ /dev/null @@ -1,102 +0,0 @@ -execute( - 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_lang` ( - `id_ws_customhtml` INT(11) NOT NULL, - `id_lang` INT(11) NOT NULL, - `title` VARCHAR(256) NOT NULL DEFAULT \'\', - `content` LONGTEXT, - `description` TEXT, - `extra_description` TEXT, - `link_text` VARCHAR(128) NOT NULL DEFAULT \'\', - PRIMARY KEY (`id_ws_customhtml`, `id_lang`) - );' - ); -} - -function migrateBlockFieldsToLangTable(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'title\'' - ); - - if (empty($columns)) { - // Already migrated in a previous run of this upgrade. - return true; - } - - $blocks = Db::getInstance()->executeS( - 'SELECT `id_ws_customhtml`, `title`, `content`, `description`, `extra_description`, `link_text` - FROM `' . _DB_PREFIX_ . 'ws_customhtml`' - ); - $languages = Language::getLanguages(false); - - foreach ($blocks as $block) { - foreach ($languages as $language) { - $existing = Db::getInstance()->executeS( - 'SELECT 1 FROM `' . _DB_PREFIX_ . 'ws_customhtml_lang` - WHERE `id_ws_customhtml` = ' . (int) $block['id_ws_customhtml'] . ' - AND `id_lang` = ' . (int) $language['id_lang'] - ); - - if (!empty($existing)) { - continue; - } - - $result = Db::getInstance()->insert('ws_customhtml_lang', [ - 'id_ws_customhtml' => (int) $block['id_ws_customhtml'], - 'id_lang' => (int) $language['id_lang'], - 'title' => pSQL($block['title']), - 'content' => pSQL($block['content'], true), - 'description' => pSQL($block['description']), - 'extra_description' => pSQL($block['extra_description']), - 'link_text' => pSQL($block['link_text']), - ]); - - if (!$result) { - return false; - } - } - } - - return true; -} - -function dropBlockLangColumns(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'title\'' - ); - - if (empty($columns)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - DROP COLUMN `title`, - DROP COLUMN `content`, - DROP COLUMN `description`, - DROP COLUMN `extra_description`, - DROP COLUMN `link_text`' - ); -} diff --git a/upgrade/upgrade-1.22.0.php b/upgrade/upgrade-1.22.0.php deleted file mode 100644 index e61832e..0000000 --- a/upgrade/upgrade-1.22.0.php +++ /dev/null @@ -1,79 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_lang` LIKE \'link\'' - ); - - if (!empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml_lang` - ADD COLUMN `link` VARCHAR(512) NOT NULL DEFAULT \'\' AFTER `extra_description`' - ); -} - -function migrateBlockLinkToLangTable(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'link\'' - ); - - if (empty($columns)) { - // Already migrated in a previous run of this upgrade. - return true; - } - - $blocks = Db::getInstance()->executeS( - 'SELECT `id_ws_customhtml`, `link` FROM `' . _DB_PREFIX_ . 'ws_customhtml`' - ); - - foreach ($blocks as $block) { - $result = Db::getInstance()->update( - 'ws_customhtml_lang', - ['link' => pSQL($block['link'])], - '`id_ws_customhtml` = ' . (int) $block['id_ws_customhtml'] - ); - - if (!$result) { - return false; - } - } - - return true; -} - -function dropBlockLinkColumn(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'link\'' - ); - - if (empty($columns)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` DROP COLUMN `link`' - ); -} diff --git a/upgrade/upgrade-1.23.0.php b/upgrade/upgrade-1.23.0.php deleted file mode 100644 index f247d59..0000000 --- a/upgrade/upgrade-1.23.0.php +++ /dev/null @@ -1,102 +0,0 @@ -execute( - 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_slide_lang` ( - `id_ws_customhtml_slide` INT(11) NOT NULL, - `id_lang` INT(11) NOT NULL, - `title` VARCHAR(256) NOT NULL DEFAULT \'\', - `description` TEXT, - `extra_description` TEXT, - `link` VARCHAR(512) NOT NULL DEFAULT \'\', - `link_text` VARCHAR(128) NOT NULL DEFAULT \'\', - PRIMARY KEY (`id_ws_customhtml_slide`, `id_lang`) - );' - ); -} - -function migrateSlideFieldsToLangTable(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_slide` LIKE \'title\'' - ); - - if (empty($columns)) { - // Already migrated in a previous run of this upgrade. - return true; - } - - $slides = Db::getInstance()->executeS( - 'SELECT `id_ws_customhtml_slide`, `title`, `description`, `extra_description`, `link`, `link_text` - FROM `' . _DB_PREFIX_ . 'ws_customhtml_slide`' - ); - $languages = Language::getLanguages(false); - - foreach ($slides as $slide) { - foreach ($languages as $language) { - $existing = Db::getInstance()->executeS( - 'SELECT 1 FROM `' . _DB_PREFIX_ . 'ws_customhtml_slide_lang` - WHERE `id_ws_customhtml_slide` = ' . (int) $slide['id_ws_customhtml_slide'] . ' - AND `id_lang` = ' . (int) $language['id_lang'] - ); - - if (!empty($existing)) { - continue; - } - - $result = Db::getInstance()->insert('ws_customhtml_slide_lang', [ - 'id_ws_customhtml_slide' => (int) $slide['id_ws_customhtml_slide'], - 'id_lang' => (int) $language['id_lang'], - 'title' => pSQL($slide['title']), - 'description' => pSQL($slide['description']), - 'extra_description' => pSQL($slide['extra_description']), - 'link' => pSQL($slide['link']), - 'link_text' => pSQL($slide['link_text']), - ]); - - if (!$result) { - return false; - } - } - } - - return true; -} - -function dropSlideLangColumns(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_slide` LIKE \'title\'' - ); - - if (empty($columns)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml_slide` - DROP COLUMN `title`, - DROP COLUMN `description`, - DROP COLUMN `extra_description`, - DROP COLUMN `link`, - DROP COLUMN `link_text`' - ); -} diff --git a/upgrade/upgrade-1.24.0.php b/upgrade/upgrade-1.24.0.php deleted file mode 100644 index 6ca3600..0000000 --- a/upgrade/upgrade-1.24.0.php +++ /dev/null @@ -1,93 +0,0 @@ -execute( - 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_faq_lang` ( - `id_ws_customhtml_faq` INT(11) NOT NULL, - `id_lang` INT(11) NOT NULL, - `question` VARCHAR(512) NOT NULL DEFAULT \'\', - `answer` TEXT, - PRIMARY KEY (`id_ws_customhtml_faq`, `id_lang`) - );' - ); -} - -function migrateFaqFieldsToLangTable(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_faq` LIKE \'question\'' - ); - - if (empty($columns)) { - // Already migrated in a previous run of this upgrade. - return true; - } - - $faqs = Db::getInstance()->executeS( - 'SELECT `id_ws_customhtml_faq`, `question`, `answer` - FROM `' . _DB_PREFIX_ . 'ws_customhtml_faq`' - ); - $languages = Language::getLanguages(false); - - foreach ($faqs as $faq) { - foreach ($languages as $language) { - $existing = Db::getInstance()->executeS( - 'SELECT 1 FROM `' . _DB_PREFIX_ . 'ws_customhtml_faq_lang` - WHERE `id_ws_customhtml_faq` = ' . (int) $faq['id_ws_customhtml_faq'] . ' - AND `id_lang` = ' . (int) $language['id_lang'] - ); - - if (!empty($existing)) { - continue; - } - - $result = Db::getInstance()->insert('ws_customhtml_faq_lang', [ - 'id_ws_customhtml_faq' => (int) $faq['id_ws_customhtml_faq'], - 'id_lang' => (int) $language['id_lang'], - 'question' => pSQL($faq['question']), - 'answer' => pSQL($faq['answer'], true), - ]); - - if (!$result) { - return false; - } - } - } - - return true; -} - -function dropFaqLangColumns(): bool -{ - $columns = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml_faq` LIKE \'question\'' - ); - - if (empty($columns)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml_faq` - DROP COLUMN `question`, - DROP COLUMN `answer`' - ); -} diff --git a/upgrade/upgrade-1.3.0.php b/upgrade/upgrade-1.3.0.php deleted file mode 100644 index e3e8e84..0000000 --- a/upgrade/upgrade-1.3.0.php +++ /dev/null @@ -1,23 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'column_class\'' - ); - - if (empty($columns)) { - if (!Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - ADD COLUMN `column_class` VARCHAR(128) NOT NULL DEFAULT \'col-12\' AFTER `content`' - )) { - return false; - } - } - - return true; -} diff --git a/upgrade/upgrade-1.4.0.php b/upgrade/upgrade-1.4.0.php deleted file mode 100644 index b333ba7..0000000 --- a/upgrade/upgrade-1.4.0.php +++ /dev/null @@ -1,14 +0,0 @@ -shop->id)) { - return $module->registerHook('actionFrontControllerSetMedia'); - } - - return true; -} diff --git a/upgrade/upgrade-1.5.0.php b/upgrade/upgrade-1.5.0.php deleted file mode 100644 index 60d48a0..0000000 --- a/upgrade/upgrade-1.5.0.php +++ /dev/null @@ -1,32 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'custom_class\'' - ); - - if (!empty($newColumn)) { - return true; - } - - $oldColumn = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'column_class\'' - ); - - if (!empty($oldColumn)) { - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - CHANGE `column_class` `custom_class` VARCHAR(128) NOT NULL DEFAULT \'\'' - ); - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` - ADD COLUMN `custom_class` VARCHAR(128) NOT NULL DEFAULT \'\' AFTER `content`' - ); -} diff --git a/upgrade/upgrade-1.6.0.php b/upgrade/upgrade-1.6.0.php deleted file mode 100644 index 49afd6b..0000000 --- a/upgrade/upgrade-1.6.0.php +++ /dev/null @@ -1,34 +0,0 @@ - 'TEXT', - 'extra_description' => 'TEXT', - 'link' => 'VARCHAR(512) NOT NULL DEFAULT \'\'', - 'template' => 'VARCHAR(32) NOT NULL DEFAULT \'image_left\'', - 'image' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', - ]; - - foreach ($columnsToAdd as $column => $definition) { - $existing = Db::getInstance()->executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'' . $column . '\'' - ); - - if (!empty($existing)) { - continue; - } - - if (!Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` ADD COLUMN `' . $column . '` ' . $definition - )) { - return false; - } - } - - return true; -} diff --git a/upgrade/upgrade-1.7.0.php b/upgrade/upgrade-1.7.0.php deleted file mode 100644 index abe2cf6..0000000 --- a/upgrade/upgrade-1.7.0.php +++ /dev/null @@ -1,20 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'template\'' - ); - - if (empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` DROP COLUMN `template`' - ); -} diff --git a/upgrade/upgrade-1.8.0.php b/upgrade/upgrade-1.8.0.php deleted file mode 100644 index 27ce763..0000000 --- a/upgrade/upgrade-1.8.0.php +++ /dev/null @@ -1,20 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'template_key\'' - ); - - if (!empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` ADD COLUMN `template_key` VARCHAR(64) NOT NULL DEFAULT \'\'' - ); -} diff --git a/upgrade/upgrade-1.9.0.php b/upgrade/upgrade-1.9.0.php deleted file mode 100644 index f4410aa..0000000 --- a/upgrade/upgrade-1.9.0.php +++ /dev/null @@ -1,20 +0,0 @@ -executeS( - 'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'template_key\'' - ); - - if (empty($existing)) { - return true; - } - - return Db::getInstance()->execute( - 'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` DROP COLUMN `template_key`' - ); -}