diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 219deef6dc2..52b52a5f342 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -271,3 +271,7 @@ ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT ALTER TABLE llx_product_attribute_combination ADD INDEX idx_product_att_com_product_parent (fk_product_parent); ALTER TABLE llx_product_attribute_combination ADD INDEX idx_product_att_com_product_child (fk_product_child); +ALTER TABLE llx_product ADD COLUMN fk_project integer DEFAULT NULL; +ALTER TABLE llx_product ADD INDEX idx_product_fk_project (fk_project); + +ALTER TABLE llx_actioncomm ADD COLUMN calling_duration integer; diff --git a/htdocs/install/mysql/tables/llx_product.key.sql b/htdocs/install/mysql/tables/llx_product.key.sql index d339f2082ee..bd48aa99cd4 100644 --- a/htdocs/install/mysql/tables/llx_product.key.sql +++ b/htdocs/install/mysql/tables/llx_product.key.sql @@ -30,6 +30,7 @@ ALTER TABLE llx_product ADD INDEX idx_product_seuil_stock_alerte (seuil_stock_al ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country); ALTER TABLE llx_product ADD INDEX idx_product_fk_user_author (fk_user_author); ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type); +ALTER TABLE llx_product ADD INDEX idx_product_fk_project (fk_project); ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode_type, entity); ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid); diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 8569c6e28d2..fb6e4cf5f1a 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -94,5 +94,6 @@ create table llx_product fk_price_expression integer, -- Link to the rule for dynamic price calculation desiredstock integer DEFAULT 0, fk_unit integer DEFAULT NULL, - price_autogen tinyint DEFAULT 0 + price_autogen tinyint DEFAULT 0, + fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project )ENGINE=innodb;