Bug #21766
closedDuplicate entries in taxable_taxonomies table
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1494688
Description of problem:
It is possible for duplicate entries to be placed in taxable_taxonomies table.
Example:
id | taxonomy_id | taxable_id | taxable_type | created_at | updated_at
-------+-------------+------------+--------------+----------------------------+----------------------------
17766 | 15 | 76 | Subnet | 2017-08-10 09:05:41.651359 | 2017-08-10 09:05:41.651359
17767 | 15 | 76 | Subnet | 2017-08-10 09:05:41.687729 | 2017-08-10 09:05:41.687729
Notice the consecutive ids and virtually identical created_at timestamps
Version-Release number of selected component (if applicable): Satellite 6.2.11
How reproducible: No known reproducer - but seems like the point in time which the row is created is a good starting point. Possible that a unique constraint could be placed around (taxonomy_id, taxable_id).
Steps to Reproduce:
1.
2.
3.
Actual results: Duplicate entries as shown in the example
Expected results:
select taxable_type, taxable_id, taxonomy_id, COUNT() as Duplicates from taxable_taxonomies GROUP BY taxable_type, taxable_id,taxonomy_id HAVING COUNT() > 1;
This query should not ever return results.
Additional info: This manifests via APIs which deal with taxonomies such as Locations
curl -X GET -k -u admin https://localhost/api/v2/subnets/:subnet_id/locations"
Updated by Tomer Brisker about 7 years ago
- Blocks Refactor #21639: unique constraints should be enforced in the DB as well added
Updated by The Foreman Bot about 7 years ago
- Status changed from New to Ready For Testing
- Assignee set to Tomer Brisker
- Pull request https://github.com/theforeman/foreman/pull/5028 added
Updated by Anonymous about 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset c5787ac19f18cd2c9a31987a62d26d2bf39ced37.
Updated by Marek Hulán about 7 years ago
- Translation missing: en.field_release set to 296