Skip to content

Commit

Permalink
Removed key restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgdf committed Jul 3, 2014
1 parent d38bebf commit e351657
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions htdocs/install/mysql/migration/3.6.0-3.7.0.sql
Expand Up @@ -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 ;
);
6 changes: 3 additions & 3 deletions htdocs/install/mysql/tables/llx_product.key.sql
Expand Up @@ -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 ;
);
4 changes: 2 additions & 2 deletions htdocs/install/mysql/tables/llx_product_price.key.sql
Expand Up @@ -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 ;
);

0 comments on commit e351657

Please sign in to comment.