From 9913778da0cd573c2f95718c4cb7a8370503918a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 14:04:51 +0100 Subject: [PATCH 1/2] fix migration for postgresql 19.0.0 -> 20.0.0 --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 cbbb6d34cdcb1..170f02a9ec13a 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 @@ -227,8 +227,10 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; -ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; -ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +-- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; +-- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +-- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +-- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; From d73d27466bbd4a8592173d683f95fb861e8e63c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:40:47 +0100 Subject: [PATCH 2/2] Update 19.0.0-20.0.0.sql --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 170f02a9ec13a..acd230f65cb3b 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 @@ -5,7 +5,7 @@ -- -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y --- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- Note that "RENAME TO" is both compatible mysql/postgesql, not "RENAME" alone. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; @@ -227,10 +227,8 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; --- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; --- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; --- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; --- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; +ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER';