From 72beb3b7d6a8f24361c62fe4a7ab698fa82840cd Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Dec 2023 13:06:45 +0100 Subject: [PATCH 1/6] NEW: add table to store product relation with thirdparty --- .../install/mysql/migration/18.0.0-19.0.0.sql | 30 +++++++++++++ ...llx_c_product_thirdparty_relation_type.sql | 28 +++++++++++++ .../mysql/tables/llx_product_thirdparty.sql | 42 +++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql create mode 100644 htdocs/install/mysql/tables/llx_product_thirdparty.sql diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 4a6f4c0325c..7e27146f912 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -203,3 +203,33 @@ ALTER TABLE llx_expensereport DROP INDEX idx_expensereport_fk_refuse, ADD INDEX INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Société publique locale'); ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + + +CREATE TABLE llx_product_thirdparty( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, + date_start datetime, + date_end datetime, + fk_project integer, + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer DEFAULT 1 NOT NULL +) ENGINE=innodb; + + +CREATE TABLE llx_c_product_thirdparty_relation_type( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + code varchar(24) NOT NULL, + label varchar(128), + active tinyint default 1 NOT NULL +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql new file mode 100644 index 00000000000..c379bdf040b --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql @@ -0,0 +1,28 @@ +-- ============================================================================ +-- Copyright (C) 2002-2006 Rodolphe Quiedeville +-- Copyright (C) 2008-2017 Laurent Destailleur +-- Copyright (C) 2005-2010 Regis Houssin +-- Copyright (C) 2023 Florian HENRY + +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ + +CREATE TABLE llx_c_product_thirdparty_relation_type( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + code varchar(24) NOT NULL, + label varchar(128), + active tinyint default 1 NOT NULL +) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_product_thirdparty.sql b/htdocs/install/mysql/tables/llx_product_thirdparty.sql new file mode 100644 index 00000000000..a08f20fb8cc --- /dev/null +++ b/htdocs/install/mysql/tables/llx_product_thirdparty.sql @@ -0,0 +1,42 @@ +-- ============================================================================ +-- Copyright (C) 2002-2006 Rodolphe Quiedeville +-- Copyright (C) 2008-2017 Laurent Destailleur +-- Copyright (C) 2005-2010 Regis Houssin +-- Copyright (C) 2023 Florian HENRY + +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ============================================================================ + +CREATE TABLE llx_product_thirdparty( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, + date_start datetime, + date_end datetime, + fk_project integer, + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer DEFAULT 1 NOT NULL +) ENGINE=innodb; From 6d0ca0be81b5bbd6a1761aa965a01b231cf7344f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Dec 2023 13:09:43 +0100 Subject: [PATCH 2/6] NEW: add table to store product relation with thirdparty --- .../mysql/tables/llx_c_product_thirdparty_relation_type.sql | 2 +- htdocs/install/mysql/tables/llx_product_thirdparty.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql index c379bdf040b..59d95a4ba85 100644 --- a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql +++ b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql @@ -2,7 +2,7 @@ -- Copyright (C) 2002-2006 Rodolphe Quiedeville -- Copyright (C) 2008-2017 Laurent Destailleur -- Copyright (C) 2005-2010 Regis Houssin --- Copyright (C) 2023 Florian HENRY +-- Copyright (C) 2023 Florian Henry -- -- This program is free software; you can redistribute it and/or modify diff --git a/htdocs/install/mysql/tables/llx_product_thirdparty.sql b/htdocs/install/mysql/tables/llx_product_thirdparty.sql index a08f20fb8cc..19e095e1c9f 100644 --- a/htdocs/install/mysql/tables/llx_product_thirdparty.sql +++ b/htdocs/install/mysql/tables/llx_product_thirdparty.sql @@ -2,7 +2,7 @@ -- Copyright (C) 2002-2006 Rodolphe Quiedeville -- Copyright (C) 2008-2017 Laurent Destailleur -- Copyright (C) 2005-2010 Regis Houssin --- Copyright (C) 2023 Florian HENRY +-- Copyright (C) 2023 Florian Henry -- -- This program is free software; you can redistribute it and/or modify From 381cb6982cfa296caaa9375a999d65eec73b0a23 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Dec 2023 13:10:23 +0100 Subject: [PATCH 3/6] NEW: add table to store product relation with thirdparty --- ...llx_c_product_thirdparty_relation_type.sql | 13 +++--- .../mysql/tables/llx_product_thirdparty.sql | 41 ++++++++++--------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql index 59d95a4ba85..c0c0c98a633 100644 --- a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql +++ b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql @@ -20,9 +20,10 @@ -- -- ============================================================================ -CREATE TABLE llx_c_product_thirdparty_relation_type( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - code varchar(24) NOT NULL, - label varchar(128), - active tinyint default 1 NOT NULL -) ENGINE=innodb; +CREATE TABLE llx_c_product_thirdparty_relation_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + code varchar(24) NOT NULL, + label varchar(128), + active tinyint default 1 NOT NULL +) ENGINE = innodb; diff --git a/htdocs/install/mysql/tables/llx_product_thirdparty.sql b/htdocs/install/mysql/tables/llx_product_thirdparty.sql index 19e095e1c9f..5847dd00879 100644 --- a/htdocs/install/mysql/tables/llx_product_thirdparty.sql +++ b/htdocs/install/mysql/tables/llx_product_thirdparty.sql @@ -20,23 +20,24 @@ -- -- ============================================================================ -CREATE TABLE llx_product_thirdparty( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_product integer NOT NULL, - fk_soc integer NOT NULL, - fk_product_thirdparty_relation_type integer NOT NULL, - date_start datetime, - date_end datetime, - fk_project integer, - description text, - note_public text, - note_private text, - date_creation datetime NOT NULL, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - last_main_doc varchar(255), - import_key varchar(14), - model_pdf varchar(255), - status integer DEFAULT 1 NOT NULL -) ENGINE=innodb; +CREATE TABLE llx_product_thirdparty +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, + date_start datetime, + date_end datetime, + fk_project integer, + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer DEFAULT 1 NOT NULL +) ENGINE = innodb; From 1a499172f572ae2d7eaf89f5913a46ecc6b7bc75 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Dec 2023 13:10:50 +0100 Subject: [PATCH 4/6] NEW: add table to store product relation with thirdparty --- .../install/mysql/migration/18.0.0-19.0.0.sql | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 7e27146f912..5fa7458c253 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -205,31 +205,33 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Soci ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; -CREATE TABLE llx_product_thirdparty( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_product integer NOT NULL, - fk_soc integer NOT NULL, - fk_product_thirdparty_relation_type integer NOT NULL, - date_start datetime, - date_end datetime, - fk_project integer, - description text, - note_public text, - note_private text, - date_creation datetime NOT NULL, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - last_main_doc varchar(255), - import_key varchar(14), - model_pdf varchar(255), - status integer DEFAULT 1 NOT NULL -) ENGINE=innodb; +CREATE TABLE llx_product_thirdparty +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, + date_start datetime, + date_end datetime, + fk_project integer, + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer DEFAULT 1 NOT NULL +) ENGINE = innodb; -CREATE TABLE llx_c_product_thirdparty_relation_type( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - code varchar(24) NOT NULL, - label varchar(128), - active tinyint default 1 NOT NULL -) ENGINE=innodb; +CREATE TABLE llx_c_product_thirdparty_relation_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + code varchar(24) NOT NULL, + label varchar(128), + active tinyint default 1 NOT NULL +) ENGINE = innodb; From bb4d33a4549932a3bc01f1de1a53bf29d9376acc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Dec 2023 13:12:03 +0100 Subject: [PATCH 5/6] NEW: add table to store product relation with thirdparty --- .../install/mysql/migration/18.0.0-19.0.0.sql | 17 ++++++++--------- .../llx_c_product_thirdparty_relation_type.sql | 4 ++-- .../mysql/tables/llx_product_thirdparty.sql | 12 ++++++------ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 5fa7458c253..2db6f4b73a8 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -204,34 +204,33 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Soci ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; - CREATE TABLE llx_product_thirdparty ( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_product integer NOT NULL, - fk_soc integer NOT NULL, - fk_product_thirdparty_relation_type integer NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, date_start datetime, date_end datetime, fk_project integer, description text, note_public text, note_private text, - date_creation datetime NOT NULL, + date_creation datetime NOT NULL, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, + fk_user_creat integer NOT NULL, fk_user_modif integer, last_main_doc varchar(255), import_key varchar(14), model_pdf varchar(255), - status integer DEFAULT 1 NOT NULL + status integer DEFAULT 1 NOT NULL ) ENGINE = innodb; CREATE TABLE llx_c_product_thirdparty_relation_type ( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - code varchar(24) NOT NULL, + code varchar(24) NOT NULL, label varchar(128), - active tinyint default 1 NOT NULL + active tinyint default 1 NOT NULL ) ENGINE = innodb; diff --git a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql index c0c0c98a633..88df28f60de 100644 --- a/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql +++ b/htdocs/install/mysql/tables/llx_c_product_thirdparty_relation_type.sql @@ -23,7 +23,7 @@ CREATE TABLE llx_c_product_thirdparty_relation_type ( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - code varchar(24) NOT NULL, + code varchar(24) NOT NULL, label varchar(128), - active tinyint default 1 NOT NULL + active tinyint default 1 NOT NULL ) ENGINE = innodb; diff --git a/htdocs/install/mysql/tables/llx_product_thirdparty.sql b/htdocs/install/mysql/tables/llx_product_thirdparty.sql index 5847dd00879..4af00bcf447 100644 --- a/htdocs/install/mysql/tables/llx_product_thirdparty.sql +++ b/htdocs/install/mysql/tables/llx_product_thirdparty.sql @@ -23,21 +23,21 @@ CREATE TABLE llx_product_thirdparty ( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_product integer NOT NULL, - fk_soc integer NOT NULL, - fk_product_thirdparty_relation_type integer NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, date_start datetime, date_end datetime, fk_project integer, description text, note_public text, note_private text, - date_creation datetime NOT NULL, + date_creation datetime NOT NULL, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, + fk_user_creat integer NOT NULL, fk_user_modif integer, last_main_doc varchar(255), import_key varchar(14), model_pdf varchar(255), - status integer DEFAULT 1 NOT NULL + status integer DEFAULT 1 NOT NULL ) ENGINE = innodb; From a6adeade5895e12fd795566aae9f6504a079a379 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Jan 2024 21:15:57 +0100 Subject: [PATCH 6/6] reveiw --- .../install/mysql/migration/18.0.0-19.0.0.sql | 31 ------------------- .../install/mysql/migration/19.0.0-20.0.0.sql | 29 +++++++++++++++++ 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 2db6f4b73a8..4a6f4c0325c 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -203,34 +203,3 @@ ALTER TABLE llx_expensereport DROP INDEX idx_expensereport_fk_refuse, ADD INDEX INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Société publique locale'); ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; - -CREATE TABLE llx_product_thirdparty -( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_product integer NOT NULL, - fk_soc integer NOT NULL, - fk_product_thirdparty_relation_type integer NOT NULL, - date_start datetime, - date_end datetime, - fk_project integer, - description text, - note_public text, - note_private text, - date_creation datetime NOT NULL, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - last_main_doc varchar(255), - import_key varchar(14), - model_pdf varchar(255), - status integer DEFAULT 1 NOT NULL -) ENGINE = innodb; - - -CREATE TABLE llx_c_product_thirdparty_relation_type -( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - code varchar(24) NOT NULL, - label varchar(128), - active tinyint default 1 NOT NULL -) ENGINE = innodb; diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index e7d7c2b6baf..efbd730b5e5 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -161,4 +161,33 @@ ALTER TABLE llx_usergroup_extrafields ADD UNIQUE INDEX uk_usergroup_extrafields UPDATE llx_categorie SET date_creation = tms, tms = tms WHERE date_creation IS NULL AND tms IS NOT NULL; +CREATE TABLE llx_product_thirdparty +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_product integer NOT NULL, + fk_soc integer NOT NULL, + fk_product_thirdparty_relation_type integer NOT NULL, + date_start datetime, + date_end datetime, + fk_project integer, + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer DEFAULT 1 NOT NULL +) ENGINE = innodb; + +CREATE TABLE llx_c_product_thirdparty_relation_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + code varchar(24) NOT NULL, + label varchar(128), + active tinyint default 1 NOT NULL +) ENGINE = innodb;