From 664b0acfb7cce1944009875f35630b4e6e5df480 Mon Sep 17 00:00:00 2001 From: Rudi Herouard Date: Fri, 14 Nov 2025 15:53:49 +0100 Subject: [PATCH] NEW Add SQL table for expensereport line extrafields support (#36251) --- .../install/mysql/migration/22.0.0-23.0.0.sql | 9 +++++++ .../llx_expensereport_det_extrafields.key.sql | 20 ++++++++++++++ .../llx_expensereport_det_extrafields.sql | 26 +++++++++++++++++++ htdocs/install/pgsql/functions/functions.sql | 1 + 4 files changed, 56 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_expensereport_det_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_expensereport_det_extrafields.sql diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql index 72bcb18fd09..a663ad81c0d 100644 --- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql +++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql @@ -357,4 +357,13 @@ ALTER TABLE llx_ecm_files ADD COLUMN geolong double(24,8) DEFAULT NULL; ALTER TABLE llx_ecm_files ADD COLUMN geopoint point DEFAULT NULL; ALTER TABLE llx_ecm_files ADD COLUMN georesultcode varchar(16) NULL; +-- Add table for extrafields lines support on expensereport module +CREATE TABLE llx_expensereport_det_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) +) ENGINE=innodb; + -- end of migration diff --git a/htdocs/install/mysql/tables/llx_expensereport_det_extrafields.key.sql b/htdocs/install/mysql/tables/llx_expensereport_det_extrafields.key.sql new file mode 100644 index 00000000000..b36a1e68a40 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_expensereport_det_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2025 Rudi Herouard +-- +-- 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 . +-- +-- =================================================================== + + +ALTER TABLE llx_expensereport_det_extrafields ADD INDEX idx_expensereport_det_fk_object(fk_object); diff --git a/htdocs/install/mysql/tables/llx_expensereport_det_extrafields.sql b/htdocs/install/mysql/tables/llx_expensereport_det_extrafields.sql new file mode 100644 index 00000000000..1878cf9243c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_expensereport_det_extrafields.sql @@ -0,0 +1,26 @@ +-- =================================================================== +-- Copyright (C) 2025 Rudi Herouard +-- +-- 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_expensereport_det_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) +) ENGINE=innodb; diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 34c4cb1fbf8..3bd648e0c1a 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -108,6 +108,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot_extrafields CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expensereport FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expensereport_det_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_rec FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();