Say I have a table Dogs
mysql> select * from dogs;
+----------+-------------+----------+
| dog_id | tail_length | owner_id |
+----------+-------------+----------+
| dog-id-1 | 1 cm | owner-1 |
| dog-id-2 | 2 cm | owner-2 |
| dog-id-3 | 3 cm | owner-3 |
+----------+-------------+----------+
Where dog_id is a primary key and owner_id is unique. Now I want sharing of dogs to be possible. so the table can be.
+----------+-------------+----------+
| dog_id | tail_length | owner_id |
+----------+-------------+----------+
| dog-id-1 | 1 cm | owner-1 |
| dog-id-2 | 2 cm | owner-2 |
| dog-id-3 | 3 cm | owner-3 |
| dog-id-3 | 3 cm | owner-1 |
| dog-id-3 | 3 cm | owner-1 |
+----------+-------------+----------+
But it is not possible as dog_id is a primary key and owner_id is unique in the table. A dog can possible be shared with 10000+ users.
Due to constraints of backward compatibility I cannot remove the primary and unique key constraints of the original table and I have to use mysql to do this. What would be the best strategy to achieve sharing?
Additional Constraint: I can only query through dog_id and not owner_id.