I can see using an AI ID, but not using that AI as part of the primary key.
Code:
PRIMARY KEY (`mytable_farmers_row_id`, `mytable_farmers_mytable_users_row_id`) ,
And leaving the AI row along makes sense to me to restrict 1 of each... what ever that is... and then be able to use row_id as the row pointer, though not completely necessary..
I agree withe everyone else though, this is just broke, starting with the naming convention.
An example of why you might use a non primary key'd AI:
tbl_users
-------
user_id AI, PK
user_name
tbl_user_roles
-------
role_id AI
user_id PK
role_name PK
This would ensure only one role per user is allowed in, and I could perhaps use the role_id to delete certain rows, but should really be handled though dual criteria on the PKs.
Bookmarks