From ed207cfb2f653584ed9d6ee95842502ec4403e54 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Sat, 6 Jul 2024 03:34:48 +0200 Subject: [PATCH] NEW : manage several type of dangerous goods for a same parcel (#30238) * NEW : manage several type of dangerous goods for a same parcel Manage several type of dangerous goods for a same parcel Before : dangerous_goods : smallint (so only 1 type can be defined eg 3) After dangerous_goods : varchar so can be a list of numbers eg 3,5,8 * Update llx_expedition_package.sql > Adding a default value to default '0' to keep compatibility seems required. * Update 20.0.0-21.0.0.sql > You must include migration change into same PR so PR is atomic. Include change of #30237 * Update llx_expedition_package.sql space missing * Update 20.0.0-21.0.0.sql > -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); --- htdocs/install/mysql/migration/20.0.0-21.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_expedition_package.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 07338c65ac9e5..fc0a2a5725a71 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -60,3 +60,5 @@ ALTER TABLE llx_contrat ADD COLUMN localtax2 double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN revenuestamp double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN total_ht double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN total_ttc double(24,8) DEFAULT 0; + +ALTER TABLE llx_expedition_package MODIFY COLUMN dangerous_goods varchar(60) DEFAULT '0'; diff --git a/htdocs/install/mysql/tables/llx_expedition_package.sql b/htdocs/install/mysql/tables/llx_expedition_package.sql index 2f8d97a26a9de..a4f372603ce80 100644 --- a/htdocs/install/mysql/tables/llx_expedition_package.sql +++ b/htdocs/install/mysql/tables/llx_expedition_package.sql @@ -12,7 +12,7 @@ create table llx_expedition_package size_units integer, -- unit of all sizes (height, width, depth) weight float, -- weight weight_units integer, -- unit of weight - dangerous_goods smallint DEFAULT 0, -- 0 = no dangerous goods or 1 = Explosives, 2 = Flammable Gases, 3 = Flammable Liquids, 4 = Flammable solids, 5 = Oxidizing, 6 = Toxic & Infectious, 7 = Radioactive, 8 = Corrosives, 9 = Miscellaneous (see https://en.wikipedia.org/wiki/Dangerous_goods). I'm not sure if just register 0 (no) or 1 (yes) is enough. + dangerous_goods varchar(20) DEFAULT '0', -- (comma separated list eg : 3,5,7) 0 = no dangerous goods or 1 = Explosives, 2 = Flammable Gases, 3 = Flammable Liquids, 4 = Flammable solids, 5 = Oxidizing, 6 = Toxic & Infectious, 7 = Radioactive, 8 = Corrosives, 9 = Miscellaneous (see https://en.wikipedia.org/wiki/Dangerous_goods). I'm not sure if just register 0 (no) or 1 (yes) is enough. tail_lift smallint DEFAULT 0, -- 0 = no tail lift required to load/unload package(s), 1 = a tail lift is required to load/unload package(s). Sometime tail lift load can be different than tail lift delivery so maybe adding a new table line. rang integer DEFAULT 0 )ENGINE=innodb;