I have a question for an index issue with preventing duplicates on certain columns. Because it's very similar, I've tried using the scheme Miva uses for Attributes and Options. I'm not getting it to work.
What I need to accomplish is very similar to the Attribute and Option Tables. Setting a Unique Index on each table is easy enough for the ID but the CODE for each table cannot be duplicated with the exception of the codes in Options table where the attr_id (ID from the attributes table) can have the CODE duplicated IF the attr_id is different. Therefore,
attr_id and opt_id, code,
1 and 1 = red
1 and 2 = blue
2 and 3 = red
2 and 4 = blue
In addition, I have a display order type of column in options where the display order must be unique. (atm, not trying to rest any option set to start at 1.
I'm asking for a fresh strategy I guess. Thanks for any suggestions.
Scott
What I need to accomplish is very similar to the Attribute and Option Tables. Setting a Unique Index on each table is easy enough for the ID but the CODE for each table cannot be duplicated with the exception of the codes in Options table where the attr_id (ID from the attributes table) can have the CODE duplicated IF the attr_id is different. Therefore,
attr_id and opt_id, code,
1 and 1 = red
1 and 2 = blue
2 and 3 = red
2 and 4 = blue
In addition, I have a display order type of column in options where the display order must be unique. (atm, not trying to rest any option set to start at 1.
I'm asking for a fresh strategy I guess. Thanks for any suggestions.
Scott
Comment