Actually the Uniqueness for the said couple of fields is enforced by an index. It could have been the compound primary key in which case your need would be satisfied.
FA for the most part has tables with just one single primary key to make it easy to code record manipulations (select, update,delete).
The fields stock_id and item_code are both generally VARCHAR(20 except a few of the former are CHAR(20) in all tables they are part of. The varied definition is probably an error or some index justification.
grep stock_id sql/en_US-new.sql
`item_code` varchar(20) NOT NULL default '',
`item_code` varchar(20) NOT NULL,
`item_code` varchar(20) NOT NULL default '',
grep item_code sql/en_US-new.sql
`stock_id` varchar(20) NOT NULL default '',
`stock_id` varchar(20) NOT NULL,
`stock_id` char(20) NOT NULL default '',
`stock_id` varchar(20) NOT NULL default '',
`stock_id` char(20) NOT NULL default '',
`stock_id` varchar(20) NOT NULL default '',
`stock_id` char(20) NOT NULL DEFAULT '',
`stock_id` varchar(20) NOT NULL default '',
`stock_id` varchar(20) NOT NULL default '',
`stock_id` varchar(40) default NULL,
`stock_id` char(20) NOT NULL default '',
Post's attachmentsitem_code_indexes.png 19.4 kb, file has never been downloaded.
You don't have the permssions to download the attachments of this post.