diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index f0c05df8d9b..56f27144a46 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -882,7 +882,9 @@ ALTER TABLE llx_element_contact ADD INDEX idx_element_contact_fk_socpeople (fk_s ALTER TABLE llx_societe ADD COLUMN supplier_account varchar(32) after fournisseur; -create table llx_c_barcode +drop table if exists llx_c_barcode; + +create table llx_c_barcode_type ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(16) NOT NULL, @@ -891,11 +893,12 @@ create table llx_c_barcode example varchar(16) NOT NULL )type=innodb; -INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (1, 'EAN8', 'EAN8', 0, '1234567'); -INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (2, 'EAN13', 'EAN13', 0, '123456789012'); -INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (3, 'UPC', 'UPC', 0, '123456789012'); -INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (4, 'ISBN', 'ISBN', 0, '123456789'); -INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (5, 'C39', 'Code 39', 0, '1234567890'); -INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (6, 'C128', 'Code 128', 0, 'ABCD1234567890'); +INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (1, 'EAN8', 'EAN8', 0, '1234567'); +INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (2, 'EAN13', 'EAN13', 0, '123456789012'); +INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (3, 'UPC', 'UPC', 0, '123456789012'); +INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (4, 'ISBN', 'ISBN', 0, '123456789'); +INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (5, 'C39', 'Code 39', 0, '1234567890'); +INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (6, 'C128', 'Code 128', 0, 'ABCD1234567890'); -ALTER TABLE llx_product ADD COLUMN gencode_type integer DEFAULT 0 after gencode; \ No newline at end of file +ALTER TABLE llx_product CHANGE gencode barcode varchar(255) DEFAULT NULL; +ALTER TABLE llx_product ADD COLUMN fk_barcode_type integer DEFAULT 0 after barcode; \ No newline at end of file diff --git a/mysql/tables/llx_c_barcode.sql b/mysql/tables/llx_c_barcode_type.sql similarity index 100% rename from mysql/tables/llx_c_barcode.sql rename to mysql/tables/llx_c_barcode_type.sql diff --git a/mysql/tables/llx_product.sql b/mysql/tables/llx_product.sql index b5ef17c3222..27cb0f2ea5c 100644 --- a/mysql/tables/llx_product.sql +++ b/mysql/tables/llx_product.sql @@ -42,8 +42,8 @@ create table llx_product stock_commande integer DEFAULT 0, seuil_stock_alerte integer DEFAULT 0, stock_loc varchar(10), -- emplacement dans le stock - gencode varchar(255) DEFAULT NULL, - gencode_type integer DEFAULT 0, + barcode varchar(255) DEFAULT NULL, + fk_barcode_type integer DEFAULT 0, partnumber varchar(32), weight float DEFAULT NULL, weight_units tinyint DEFAULT NULL,