diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 2b98536fa95d0..1a9c59b62751d 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -56,29 +56,29 @@ ALTER TABLE llx_product CHANGE fk_country fk_country INT( 11 ) NULL DEFAULT N ALTER TABLE llx_product ADD INDEX ( fk_country ); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_country ) REFERENCES llx_c_pays ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- fk_user_author ALTER TABLE llx_product CHANGE fk_user_author fk_user_author INT( 11 ) NULL DEFAULT NULL; ALTER TABLE llx_product ADD INDEX ( fk_user_author ); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- fk_barcode_type ALTER TABLE llx_product CHANGE fk_barcode_type fk_barcode_type INT( 11 ) NULL DEFAULT NULL; UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0; ALTER TABLE llx_product ADD INDEX ( fk_barcode_type ); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_barcode_type ) REFERENCES llx_c_barcode_type ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- Added missing relations of llx_product_price -- fk_user_author ALTER TABLE llx_product_price ADD INDEX ( fk_user_author ); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- fk_user_author ALTER TABLE llx_product_price ADD INDEX ( fk_product ); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_product ) REFERENCES llx_product ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file +); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product.key.sql b/htdocs/install/mysql/tables/llx_product.key.sql index 4faa2bcb13cea..b692a2740b053 100644 --- a/htdocs/install/mysql/tables/llx_product.key.sql +++ b/htdocs/install/mysql/tables/llx_product.key.sql @@ -34,12 +34,12 @@ ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode ALTER TABLE llx_product ADD FOREIGN KEY ( fk_country ) REFERENCES llx_c_pays ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_barcode_type ) REFERENCES llx_c_barcode_type ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file +); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product_price.key.sql b/htdocs/install/mysql/tables/llx_product_price.key.sql index a7e43d95d86ce..fbc5ee3f05f4f 100644 --- a/htdocs/install/mysql/tables/llx_product_price.key.sql +++ b/htdocs/install/mysql/tables/llx_product_price.key.sql @@ -21,8 +21,8 @@ ALTER TABLE llx_product_price ADD INDEX ( fk_product ); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_product ) REFERENCES llx_product ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file +); \ No newline at end of file