daniel added a comment. I'll try to summarize:
- adding a badge_id column to wb_items_per_site won't work because there may be more than one badge per page. - referencing ips_row_id from another table would work, but would be brittle, since row ids are not stable, and we have no triggers or foreign key constraints to keep this in sync. - an extra table with ( badge, siteId, page ), and a unique key covering these three fields, as well as an index on ( siteId, page ) for update, seems the best option. The SiteLinkTable class should be extended to maintain the new table. Care should be taken to avoid orphan entries in the badge table, which do not have a corresponding entry in the pagelinks (items_per_site) table. TASK DETAIL https://phabricator.wikimedia.org/T72229 REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>. EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: daniel Cc: Liuxinyu970226, Wikidata-bugs, Bene, aude, Superyetkin, Ricordisamoa, Lydia_Pintscher, Stryn, daniel _______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
