From 45970ac443713915bdc8ac88626fb6bd4fccf0ba Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 2 Feb 2021 11:13:14 +0100 Subject: [PATCH] Update database with new fields --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_mrp_production.sql | 4 +++- 2 files changed, 6 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 bfdecd334b7..6a1a3d46cc3 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 @@ -122,3 +122,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; + +ALTER TABLE llx_mrp_production ADD COLUMN origin_id integer AFTER fk_mo; +ALTER TABLE llx_mrp_production ADD COLUMN origin_type varchar(10) AFTER origin_id; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_mrp_production.sql b/htdocs/install/mysql/tables/llx_mrp_production.sql index bd0cd722f1a..b977d59ba55 100644 --- a/htdocs/install/mysql/tables/llx_mrp_production.sql +++ b/htdocs/install/mysql/tables/llx_mrp_production.sql @@ -17,6 +17,8 @@ CREATE TABLE llx_mrp_production( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, fk_mo integer NOT NULL, + origin_id integer, + origin_type varchar(10), -- 'bom' bom production line or 'free' free production line added after Mo creation from bom position integer NOT NULL DEFAULT 0, fk_product integer NOT NULL, fk_warehouse integer, @@ -24,7 +26,7 @@ CREATE TABLE llx_mrp_production( qty_frozen smallint DEFAULT 0, disable_stock_change smallint DEFAULT 0, batch varchar(128), - role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation) + role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation) fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce' fk_stock_movement integer, -- id of stock movement when movements are validated date_creation datetime NOT NULL,