Skip to content

Commit

Permalink
Merge pull request #636 from M0rgan01/without_upgrade_modules
Browse files Browse the repository at this point in the history
Added SQL commands related to doctrine and remove Doctrine usage
  • Loading branch information
M0rgan01 authored May 22, 2024
2 parents 4c5adb4 + 803c6f3 commit b698ae1
Show file tree
Hide file tree
Showing 13 changed files with 208 additions and 50 deletions.
10 changes: 0 additions & 10 deletions classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ protected function initConstants()
$this->container->getSymfonyAdapter()->initKernel();
}

protected function upgradeDb($oldversion)
{
parent::upgradeDb($oldversion);

$commandResult = $this->container->getSymfonyAdapter()->runSchemaUpgradeCommand();
if (0 !== $commandResult['exitCode']) {
throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', [], 'Modules.Autoupgrade.Admin')))->setQuickInfos(explode("\n", $commandResult['output']));
}
}

protected function upgradeLanguage($lang)
{
$isoCode = $lang['iso_code'];
Expand Down
10 changes: 0 additions & 10 deletions classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ protected function forceRemovingFiles()
}
}

protected function upgradeDb($oldversion)
{
parent::upgradeDb($oldversion);

$commandResult = $this->container->getSymfonyAdapter()->runSchemaUpgradeCommand();
if (0 !== $commandResult['exitCode']) {
throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', [], 'Modules.Autoupgrade.Admin')))->setQuickInfos(explode("\n", $commandResult['output']));
}
}

protected function upgradeLanguage($lang)
{
$isoCode = $lang['iso_code'];
Expand Down
16 changes: 0 additions & 16 deletions classes/UpgradeTools/SymfonyAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ public function __construct($destinationPsVersion)
$this->destinationPsVersion = $destinationPsVersion;
}

public function runSchemaUpgradeCommand()
{
if (version_compare($this->destinationPsVersion, '1.7.1.1', '>=')) {
$schemaUpgrade = new \PrestaShopBundle\Service\Database\Upgrade();
$outputCommand = 'prestashop:schema:update-without-foreign';
} else {
$schemaUpgrade = new \PrestaShopBundle\Service\Cache\Refresh();
$outputCommand = 'doctrine:schema:update';
}

$schemaUpgrade->addDoctrineSchemaUpdate();
$output = $schemaUpgrade->execute();

return $output[$outputCommand];
}

/**
* Return the appropriate kernel if abstract or not.
*
Expand Down
34 changes: 30 additions & 4 deletions upgrade/sql/1.7.1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,27 @@ INSERT INTO `PREFIX_operating_system` (`name`) VALUES ('Windows 8.1'), ('Windows
/* UPDATE TO DOCTRINE */
ALTER TABLE `PREFIX_attribute` CHANGE `id_attribute` `id_attribute` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREFIX_attribute` CHANGE `id_attribute_group` `id_attribute_group` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute` ADD KEY `attribute_group` (`id_attribute_group`);
ALTER TABLE `PREFIX_attribute` DROP KEY IDX_6C3355F967A664FB;

ALTER TABLE `PREFIX_attribute_group` CHANGE `id_attribute_group` `id_attribute_group` INT(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `PREFIX_attribute_group_lang` CHANGE `id_attribute_group` `id_attribute_group` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute_group_lang` CHANGE `id_lang` `id_lang` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute_group_lang` DROP FOREIGN KEY FK_4653726CBA299860;
ALTER TABLE `PREFIX_attribute_group_lang` DROP KEY IDX_4653726CBA299860;

ALTER TABLE `PREFIX_attribute_group_shop` CHANGE `id_attribute_group` `id_attribute_group` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute_group_shop` CHANGE `id_shop` `id_shop` INT(11) NOT NULL;

ALTER TABLE `PREFIX_attribute_lang` CHANGE `id_attribute` `id_attribute` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute_lang` CHANGE `id_lang` `id_lang` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute_lang` DROP FOREIGN KEY FK_3ABE46A7BA299860;
ALTER TABLE `PREFIX_attribute_lang` DROP KEY IDX_3ABE46A7BA299860;

ALTER TABLE `PREFIX_attribute_shop` CHANGE `id_attribute` `id_attribute` INT(11) NOT NULL;
ALTER TABLE `PREFIX_attribute_shop` CHANGE `id_shop` `id_shop` INT(11) NOT NULL;

ALTER TABLE `PREFIX_lang` CHANGE `id_lang` `id_lang` INT(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `PREFIX_lang_shop` CHANGE `id_lang` `id_lang` INT(11) NOT NULL;
ALTER TABLE `PREFIX_lang_shop` CHANGE `id_shop` `id_shop` INT(11) NOT NULL;

Expand All @@ -103,12 +107,34 @@ ALTER TABLE `PREFIX_shop` CHANGE `id_shop_group` `id_shop_group` INT(11) NOT NUL

ALTER TABLE `PREFIX_shop_group` CHANGE `id_shop_group` `id_shop_group` INT(11) NOT NULL AUTO_INCREMENT;

/* PHP:add_missing_unique_key_from_authorization_role(); */;

ALTER TABLE `PREFIX_lang` CHANGE `id_lang` `id_lang` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREFIX_lang` CHANGE `active` `active` tinyint(1) NOT NULL;

ALTER TABLE `PREFIX_tab` COLLATE=utf8_unicode_ci;
ALTER TABLE `PREFIX_tab` CHANGE `id_tab` `id_tab` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREFIX_tab` CHANGE `active` `active` TINYINT(1) NOT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `hide_host_mode` `hide_host_mode` TINYINT(1) NOT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `icon` `icon` VARCHAR(32) DEFAULT NULL;

ALTER TABLE `PREFIX_tab` CHANGE `position` `position` int(11) NOT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `module` `module` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `position` `position` int(11) NOT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `class_name` `class_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `icon` `icon` varchar(32) NOT NULL;
ALTER TABLE `PREFIX_tab` DROP KEY `class_name`;
ALTER TABLE `PREFIX_tab` DROP KEY `id_parent`;

ALTER TABLE `PREFIX_tab_lang` COLLATE=utf8_unicode_ci;
ALTER TABLE `PREFIX_tab_lang` CHANGE `id_tab` `id_tab` INT(11) NOT NULL;
ALTER TABLE `PREFIX_tab_lang` CHANGE `id_lang` `id_lang` INT(11) NOT NULL;
ALTER TABLE `PREFIX_tab_lang` CHANGE `name` `name` varchar(128) NOT NULL;
ALTER TABLE `PREFIX_tab_lang` ADD CONSTRAINT `FK_CFD9262DED47AB56` FOREIGN KEY (`id_tab`) REFERENCES `PREFIX_tab` (`id_tab`);
ALTER TABLE `PREFIX_tab_lang` ADD KEY `IDX_CFD9262DED47AB56` (`id_tab`);

/* PHP:add_missing_unique_key_from_authorization_role(); */;
ALTER TABLE `PREFIX_translation` CHANGE `domain` `domain` varchar(80) NOT NULL;
ALTER TABLE `PREFIX_translation` CHANGE `theme` `theme` varchar(32) DEFAULT NULL;
ALTER TABLE `PREFIX_translation` CHANGE `key` `key` text COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_translation` CHANGE `translation` `translation` text COLLATE utf8_unicode_ci NOT NULL;

ALTER TABLE `PREFIX_translation` DROP INDEX `theme`;
16 changes: 15 additions & 1 deletion upgrade/sql/1.7.1.1.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
SET NAMES 'utf8';

ALTER TABLE `PREFIX_address` CHANGE `company` `company` VARCHAR(255) DEFAULT NULL;
ALTER TABLE `PREFIX_address` CHANGE `company` `company` VARCHAR(255) DEFAULT NULL;

ALTER TABLE `PREFIX_attribute` DROP FOREIGN KEY FK_6C3355F967A664FB;
ALTER TABLE `PREFIX_attribute_group_lang` DROP FOREIGN KEY FK_4653726C67A664FB;
ALTER TABLE `PREFIX_attribute_group_shop` DROP FOREIGN KEY FK_DB30BAAC274A50A0;
ALTER TABLE `PREFIX_attribute_group_shop` DROP FOREIGN KEY FK_DB30BAAC67A664FB;
ALTER TABLE `PREFIX_attribute_lang` DROP FOREIGN KEY FK_3ABE46A77A4F53DC;
ALTER TABLE `PREFIX_attribute_shop` DROP FOREIGN KEY FK_A7DD8E67274A50A0;
ALTER TABLE `PREFIX_attribute_shop` DROP FOREIGN KEY FK_A7DD8E677A4F53DC;
ALTER TABLE `PREFIX_lang_shop` DROP FOREIGN KEY FK_2F43BFC7274A50A0;
ALTER TABLE `PREFIX_lang_shop` DROP FOREIGN KEY FK_2F43BFC7BA299860;
ALTER TABLE `PREFIX_shop` DROP FOREIGN KEY FK_CBDFBB9EF5C9E40;
ALTER TABLE `PREFIX_tab_lang` DROP FOREIGN KEY FK_CFD9262DED47AB56;
ALTER TABLE `PREFIX_translation` DROP FOREIGN KEY FK_ADEBEB36BA299860;
ALTER TABLE `PREFIX_tab` CHANGE icon icon VARCHAR(32) DEFAULT NULL;
10 changes: 9 additions & 1 deletion upgrade/sql/1.7.2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ ALTER TABLE `PREFIX_supply_order_detail` CHANGE `isbn` `isbn` VARCHAR(32) NULL D

ALTER TABLE `PREFIX_stock_available` ADD `physical_quantity` INT NOT NULL DEFAULT '0' AFTER `quantity`;
ALTER TABLE `PREFIX_stock_available` ADD `reserved_quantity` INT NOT NULL DEFAULT '0' AFTER `physical_quantity`;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_stock` `id_stock` INT(11) UNSIGNED NOT NULL COMMENT 'since ps 1.7 corresponding to id_stock_available';
ALTER TABLE `PREFIX_stock_mvt` COLLATE=utf8_unicode_ci;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_stock` `id_stock` INT(11) NOT NULL COMMENT 'since ps 1.7 corresponding to id_stock_available';
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_stock_mvt` `id_stock_mvt` BIGINT(20) NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_order` `id_order` INT(11) DEFAULT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_supply_order` `id_supply_order` INT(11) DEFAULT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_stock_mvt_reason` `id_stock_mvt_reason` INT(11) NOT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `id_employee` `id_employee` INT(11) NOT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `physical_quantity` `physical_quantity` INT(11) NOT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `referer` `referer` BIGINT(20) DEFAULT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `employee_lastname` `employee_lastname` varchar(32) DEFAULT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `employee_firstname` `employee_firstname` varchar(32) DEFAULT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `sign` `sign` smallint(6) NOT NULL DEFAULT '1';
Expand Down
9 changes: 9 additions & 0 deletions upgrade/sql/1.7.5.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,12 @@ ALTER TABLE `PREFIX_product_lang`

ALTER TABLE `PREFIX_customer_thread`
CHANGE `email` `email` varchar(255) NOT NULL;

ALTER TABLE `PREFIX_attribute_group_lang`
ADD KEY `IDX_4653726CBA299860` (`id_lang`);

ALTER TABLE `PREFIX_attribute_lang`
ADD KEY `IDX_3ABE46A7BA299860` (`id_lang`);

ALTER TABLE `PREFIX_tab_lang`
ADD KEY `IDX_CFD9262DBA299860` (`id_lang`);
6 changes: 6 additions & 0 deletions upgrade/sql/1.7.6.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,9 @@ INSERT IGNORE INTO `PREFIX_authorization_role` (`slug`) VALUES
('ROLE_MOD_TAB_ADMINPARENTMODULESCATALOG_READ'),
('ROLE_MOD_TAB_ADMINPARENTMODULESCATALOG_UPDATE'),
('ROLE_MOD_TAB_ADMINPARENTMODULESCATALOG_DELETE');

DROP INDEX admin_filter_search_idx ON `PREFIX_admin_filter`;
ALTER TABLE `PREFIX_admin_filter` ADD filter_id VARCHAR(255) NOT NULL;
CREATE UNIQUE INDEX admin_filter_search_id_idx ON `PREFIX_admin_filter` (employee, shop, controller, action, filter_id);
DROP INDEX id_product ON `PREFIX_product_download`;
DROP INDEX product_active ON `PREFIX_product_download`;
51 changes: 51 additions & 0 deletions upgrade/sql/1.7.7.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ ALTER TABLE `PREFIX_product_download` CHANGE `display_filename` `display_filenam

/* Doctrine update happens too late to update the new enabled field, so we preset everything here */
ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL;
ALTER TABLE `PREFIX_tab` ADD route_name VARCHAR(256) DEFAULT NULL;
ALTER TABLE `PREFIX_tab` CHANGE class_name class_name VARCHAR(64) NOT NULL;

/* PHP:ps_1770_preset_tab_enabled(); */;
/* PHP:ps_1770_update_order_status_colors(); */;
Expand Down Expand Up @@ -678,3 +680,52 @@ DELETE FROM `PREFIX_hook` WHERE name = 'actionFrontControllerAfterInit';

/* Update wrong hook alias */
UPDATE `PREFIX_hook_alias` SET name = 'displayHeader', alias = 'Header' WHERE name = 'Header' AND alias = 'displayHeader';

ALTER TABLE `PREFIX_translation` CHANGE `key` `key` TEXT NOT NULL COLLATE utf8_bin;
ALTER TABLE `PREFIX_admin_filter` CHANGE filter_id filter_id VARCHAR(191) NOT NULL;

ALTER TABLE `PREFIX_admin_filter` ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_admin_filter` CHANGE `controller` `controller` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_admin_filter` CHANGE `action` `action` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_admin_filter` CHANGE `filter` `filter` longtext COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_admin_filter` CHANGE `filter_id` `filter_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL;

ALTER TABLE `PREFIX_attribute` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_attribute` CHANGE `color` `color` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_attribute_lang` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_attribute_lang` CHANGE `name` `name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_attribute_shop` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_attribute_group` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_attribute_group` CHANGE `group_type` `group_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_attribute_group_lang` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_attribute_group_lang` CHANGE `name` `name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_attribute_group_lang` CHANGE `public_name` `public_name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_attribute_group_shop` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_lang` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_lang` CHANGE `name` `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_lang` CHANGE `iso_code` `iso_code` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_lang` CHANGE `language_code` `language_code` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_lang` CHANGE `locale` `locale` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_lang` CHANGE `date_format_lite` `date_format_lite` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_lang` CHANGE `date_format_full` `date_format_full` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_lang_shop` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_shop` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_shop` CHANGE `name` `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_shop` CHANGE `theme_name` `theme_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_shop_group` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_shop_group` CHANGE `name` `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_stock_mvt` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `employee_lastname` `employee_lastname` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `employee_firstname` `employee_firstname` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_tab` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_tab` CHANGE `module` `module` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `class_name` `class_name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `route_name` `route_name` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_tab` CHANGE `icon` `icon` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
ALTER TABLE `PREFIX_tab_lang` COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_tab_lang` CHANGE `name` `name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_module_history` CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_translation` CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `PREFIX_translation` CHANGE `translation` `translation` text COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_translation` CHANGE `domain` `domain` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL;
ALTER TABLE `PREFIX_translation` CHANGE `theme` `theme` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
19 changes: 14 additions & 5 deletions upgrade/sql/1.7.8.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,25 @@ before Doctrine schema update */
/* consequently we create the table manually */
CREATE TABLE IF NOT EXISTS `PREFIX_feature_flag` (
`id_feature_flag` INT(10) unsigned NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) COLLATE utf8mb4_general_ci NOT NULL,
`name` VARCHAR(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`state` TINYINT(1) NOT NULL DEFAULT '0',
`label_wording` VARCHAR(191) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`label_domain` VARCHAR(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`description_wording` VARCHAR(191) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`description_domain` VARCHAR(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`label_wording` VARCHAR(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`label_domain` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`description_wording` VARCHAR(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`description_domain` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id_feature_flag`),
UNIQUE KEY `UNIQ_91700F175E237E06` (`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `PREFIX_feature_flag` (`name`, `state`, `label_wording`, `label_domain`, `description_wording`, `description_domain`)
VALUES
('product_page_v2', 0, 'Experimental product page', 'Admin.Advparameters.Feature', 'This page benefits from increased performance and includes new features such as a new combination management system. Please note this is a work in progress and some features are not available yet.', 'Admin.Advparameters.Help');

DROP INDEX id_shop ON `PREFIX_shop_url`;
DROP INDEX full_shop_url ON `PREFIX_shop_url`;
DROP INDEX full_shop_url_ssl ON `PREFIX_shop_url`;
ALTER TABLE `PREFIX_shop_url` CHANGE id_shop_url id_shop_url INT AUTO_INCREMENT NOT NULL;
ALTER TABLE `PREFIX_shop_url` CHANGE id_shop id_shop INT NOT NULL;
CREATE INDEX IDX_279F19DA274A50A0 ON `PREFIX_shop_url` (id_shop);
ALTER TABLE `PREFIX_shop` ADD color VARCHAR(50) NOT NULL;
ALTER TABLE `PREFIX_shop_group` ADD color VARCHAR(50) NOT NULL;
4 changes: 4 additions & 0 deletions upgrade/sql/8.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,7 @@ UPDATE `PREFIX_carrier` SET `name` = 'Click and collect' WHERE `name` = '0';
/* PHP:drop_column_if_exists('product_attribute', 'location'); */;
/* PHP:drop_column_if_exists('product_attribute', 'quantity'); */;
/* PHP:drop_column_if_exists('orders', 'shipping_number'); */;

ALTER TABLE `PREFIX_tab` DROP hide_host_mode;
ALTER TABLE `PREFIX_feature_flag` CHANGE label_wording label_wording VARCHAR(512) DEFAULT '' NOT NULL;
ALTER TABLE `PREFIX_feature_flag` CHANGE description_wording description_wording VARCHAR(512) DEFAULT '' NOT NULL;
27 changes: 24 additions & 3 deletions upgrade/sql/8.1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VAL
CREATE TABLE `PREFIX_product_attribute_lang` (
`id_product_attribute` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`available_now` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`available_later` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`available_now` varchar(255) DEFAULT NULL,
`available_later` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_product_attribute`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4;

INSERT INTO `PREFIX_product_attribute_lang`
(id_product_attribute, id_lang, available_now, available_later)
Expand Down Expand Up @@ -84,3 +84,24 @@ ALTER TABLE `PREFIX_stock_mvt` CHANGE `physical_quantity` `physical_quantity` IN
/* PHP:add_hook('actionAdminBreadcrumbModifier', 'Modify back office breadcrumb', 'This hook allows modifying back office breadcrumb'); */;

ALTER TABLE `PREFIX_order_payment` ADD `id_employee` INT NULL AFTER `date_add`;

CREATE TABLE `PREFIX_authorized_application`
(
id_authorized_application INT UNSIGNED AUTO_INCREMENT NOT NULL,
name VARCHAR(50) NOT NULL,
description LONGTEXT NOT NULL,
UNIQUE INDEX UNIQ_475B9BA55E237E06 (name),
PRIMARY KEY (id_authorized_application)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_api_access`
(
id_api_access INT UNSIGNED AUTO_INCREMENT NOT NULL,
id_authorized_application INT UNSIGNED NOT NULL,
client_id VARCHAR(255) NOT NULL,
client_secret VARCHAR(255) NOT NULL,
active TINYINT(1) NOT NULL,
scopes LONGTEXT NOT NULL COMMENT '(DC2Type:array)',
INDEX IDX_6E064442D8BFF738 (id_authorized_application),
PRIMARY KEY (id_api_access)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Loading

0 comments on commit b698ae1

Please sign in to comment.