From a596424328dd79f0312a675ee82820a5187c3c41 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Apr 2021 16:01:48 +0200 Subject: [PATCH 1/3] FIX : Rebuild sequence for postgres only after query "INSERT INTO llx_salary(rowid --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 3f17d23b51f..27f3f08ae15 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -423,4 +423,7 @@ ALTER TABLE llx_facture_fourn ADD COLUMN date_closing datetime DEFAULT NULL afte ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_closing integer DEFAULT NULL after fk_user_valid; -ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any \ No newline at end of file +ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any + +-- Rebuild sequence for postgres only after query "INSERT INTO llx_salary(rowid, ..." +-- VPGSQL8.2 SELECT dol_util_rebuild_sequences(); From 4d643db4e6772dec06ad6c46d8f93c0864ff0e20 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Apr 2021 16:14:03 +0200 Subject: [PATCH 2/3] FIX : travis --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 27f3f08ae15..c2489042f5f 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -425,5 +425,5 @@ ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_closing integer DEFAULT NULL af ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any --- Rebuild sequence for postgres only after query "INSERT INTO llx_salary(rowid, ..." +-- Rebuild sequence for postgres only after query INSERT INTO llx_salary(rowid, ... -- VPGSQL8.2 SELECT dol_util_rebuild_sequences(); From 9ca67b81f8b5856e7ae13a97deb96dc98e716ded Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Apr 2021 18:49:21 +0200 Subject: [PATCH 3/3] FIX : correction migration queries for postgres --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index c2489042f5f..ead63c44675 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -273,15 +273,15 @@ create table llx_salary fk_user_modif integer -- user making last change ) ENGINE=innodb; -ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user fk_user integer NULL; +-- VMYSQL4.1 ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user fk_user integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_payment_salary ALTER COLUMN fk_user DROP NOT NULL; ALTER TABLE llx_payment_salary ADD COLUMN fk_salary integer; INSERT INTO llx_salary (rowid, ref, fk_user, amount, fk_projet, fk_typepayment, label, datesp, dateep, entity, note, fk_bank, paye) SELECT ps.rowid, ps.rowid, ps.fk_user, ps.amount, ps.fk_projet, ps.fk_typepayment, ps.label, ps.datesp, ps.dateep, ps.entity, ps.note, ps.fk_bank, 1 FROM llx_payment_salary ps WHERE ps.fk_salary IS NULL; UPDATE llx_payment_salary SET fk_salary = rowid WHERE fk_salary IS NULL; UPDATE llx_payment_salary SET ref = rowid WHERE ref IS NULL; -ALTER TABLE llx_salary CHANGE paye paye smallint default 0 NOT NULL; - +ALTER TABLE llx_salary ALTER COLUMN paye set default 0; DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php');