Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions upgrade/sql/9.1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,95 @@
(NULL, 'actionOverrideShippingFreePrice', 'Override price that determines free shipping', 'Allows modules to override the free shipping price and return their custom value, for example to specify it by zone or other criteria.', '1'),
(NULL, 'actionOverrideShippingFreeWeight', 'Override weight that determines free shipping', 'Allows modules to override the free shipping weight and return their custom value, for example to specify it by zone or other criteria.', '1')
ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`);

/* Insert B2B foundation */

Check warning on line 141 in upgrade/sql/9.1.0.sql

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This single line comment should use the single line comment syntax "--"

See more on https://sonarcloud.io/project/issues?id=PrestaShop_autoupgrade&issues=AZ0MJ3paumBrAXp5ZSdJ&open=AZ0MJ3paumBrAXp5ZSdJ&pullRequest=1686
/* https://github.com/PrestaShop/PrestaShop/pull/40632 */

Check warning on line 142 in upgrade/sql/9.1.0.sql

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This single line comment should use the single line comment syntax "--"

See more on https://sonarcloud.io/project/issues?id=PrestaShop_autoupgrade&issues=AZ0MJ3paumBrAXp5ZSdK&open=AZ0MJ3paumBrAXp5ZSdK&pullRequest=1686
CREATE TABLE `PREFIX_business_entity`
(
`id_business_entity` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`enterprise_id` VARCHAR(255) NOT NULL,
`external_ref` VARCHAR(255) DEFAULT NULL,
`name` VARCHAR(255) NOT NULL,
`legal_name` VARCHAR(255) DEFAULT NULL,
`flag_delivery_authorized` TINYINT(1) NOT NULL DEFAULT 0,
`status` ENUM ('pending','active','inactive','rejected') NOT NULL DEFAULT 'pending',

Check failure on line 151 in upgrade/sql/9.1.0.sql

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal 4 times.

See more on https://sonarcloud.io/project/issues?id=PrestaShop_autoupgrade&issues=AZ0MJ3paumBrAXp5ZSdL&open=AZ0MJ3paumBrAXp5ZSdL&pullRequest=1686
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
INDEX `business_entity_enterprise_id_idx` (`enterprise_id`),
INDEX `business_entity_external_ref_idx` (`external_ref`),
PRIMARY KEY (`id_business_entity`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_customer_b2b`
(
`id_customer_b2b` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`id_customer` INT UNSIGNED NOT NULL,
`status` ENUM ('pending','active','refused') NOT NULL DEFAULT 'pending',
`external_ref` VARCHAR(255) DEFAULT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
UNIQUE INDEX `uniq_customer_b2b_customer` (`id_customer`),
PRIMARY KEY (`id_customer_b2b`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_business_entity_customer_b2b`
(
`id_business_entity_customer_b2b` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`id_business_entity` INT UNSIGNED NOT NULL,
`id_customer_b2b` INT UNSIGNED NOT NULL,
`id_role_b2b` INT UNSIGNED NOT NULL,
`is_default` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` DATETIME NOT NULL,
UNIQUE INDEX `uniq_be_customer` (`id_business_entity`, `id_customer_b2b`),
INDEX `business_entity_customer_b2b_be_idx` (`id_business_entity`),
INDEX `business_entity_customer_b2b_customer_idx` (`id_customer_b2b`),
INDEX `business_entity_customer_b2b_role_idx` (`id_role_b2b`),
PRIMARY KEY (`id_business_entity_customer_b2b`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_business_entity_identifier`
(
`id_identifier` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`id_business_entity` INT UNSIGNED NOT NULL,
`id_business_identifier` INT UNSIGNED NOT NULL,
`value` VARCHAR(255) NOT NULL,
UNIQUE INDEX `uniq_business_entity_identifier` (`id_business_entity`, `id_business_identifier`),
INDEX `business_entity_identifier_id_business_entity_idx` (`id_business_entity`),
INDEX `business_entity_identifier_id_business_identifier_idx` (`id_business_identifier`),
INDEX `business_entity_identifier_value_idx` (`value`),
PRIMARY KEY (`id_identifier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_business_identifier`
(
`id_business_identifier` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`unremovable` TINYINT(1) NOT NULL DEFAULT 0,
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id_business_identifier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_business_entity_address`
(
`id_business_entity` INT UNSIGNED NOT NULL,
`id_address` INT UNSIGNED NOT NULL,
`address_type` ENUM ('both','invoice','delivery') NOT NULL DEFAULT 'both',
PRIMARY KEY (`id_business_entity`, `id_address`),
INDEX `business_entity_address_address_idx` (`id_address`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_b2b_role`
(
`id_role` INT UNSIGNED AUTO_INCREMENT NOT NULL,
`role` VARCHAR(64) NOT NULL,
UNIQUE INDEX `uniq_b2b_role` (`role`),
PRIMARY KEY (`id_role`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `PREFIX_b2b_role_authorization_role`
(
`id_role` INT UNSIGNED NOT NULL,
`id_authorization_role` INT UNSIGNED NOT NULL,
PRIMARY KEY (`id_role`, `id_authorization_role`),
INDEX `b2b_role_authorization_role_role_idx` (`id_role`),
INDEX `b2b_role_authorization_role_auth_role_idx` (`id_authorization_role`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure these lines should be found here because:

  • B2B is not part of the related PR on PrestaShop,
  • PrestaShop 9.1.0 is already released.

1 change: 1 addition & 0 deletions upgrade/sql/9.2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ CREATE TABLE `PREFIX_b2b_role_authorization_role`

-- https://github.com/PrestaShop/PrestaShop/pull/41028
/* PHP:ps_920_business_entities_tabs(); */;
ALTER TABLE `PREFIX_shipment` ADD COLUMN `deleted` TINYINT(1) NOT NULL DEFAULT 0;
Loading