From f3ddd7f60a35642bef5a37bdcc6626e07939d07e Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 12 Jan 2025 23:00:37 +0100 Subject: [PATCH] Fix size of field --- htdocs/install/mysql/migration/20.0.0-21.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_societe_rib.sql | 2 +- 2 files changed, 5 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 19a8b90a04c..0de47403ce0 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 @@ -394,7 +394,11 @@ ALTER TABLE llx_facture_rec ADD COLUMN fk_societe_rib integer DEFAULT NULL; ALTER TABLE llx_facture ADD COLUMN is_also_delivery_note tinyint DEFAULT 0 NOT NULL; ALTER TABLE llx_user MODIFY COLUMN signature LONGTEXT; + +ALTER TABLE llx_societe_rib MODIFY COLUMN label varchar(180); -- 200 is too long to allow index after + -- Add entity field ALTER TABLE llx_societe_rib DROP INDEX uk_societe_rib; ALTER TABLE llx_societe_rib ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; +-- select entity, label, fk_soc, MIN(rowid), MAX(rowid), COUNT(rowid) from llx_societe_rib GROUP BY entity, label, fk_soc HAVING COUNT(rowid) > 1; ALTER TABLE llx_societe_rib ADD UNIQUE INDEX uk_societe_rib(entity, label, fk_soc); diff --git a/htdocs/install/mysql/tables/llx_societe_rib.sql b/htdocs/install/mysql/tables/llx_societe_rib.sql index e5ef25a45b3..46e2903e3a4 100644 --- a/htdocs/install/mysql/tables/llx_societe_rib.sql +++ b/htdocs/install/mysql/tables/llx_societe_rib.sql @@ -26,7 +26,7 @@ create table llx_societe_rib rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id type varchar(32) DEFAULT 'ban' NOT NULL, -- 'ban' or 'paypal' or 'card' or 'stripe' - label varchar(200), + label varchar(180), fk_soc integer NOT NULL, datec datetime, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,