Page MenuHomePhabricator

Wrong uniqueness constraint on ce_question_aggregation
Closed, ResolvedPublic

Description

The table has

UNIQUE INDEX ceqag_event_question ( ceqag_event_id, ceqag_question_id ),

but the index should also include ceqag_answer_option. For each event and each question, there can be multiple rows (<=1 for each option).

  • Update index definition in the code
  • Schema change in beta
  • Schema change in production (T342966)

Event Timeline

Change 940940 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Fix uniqueness constraint for ce_question_aggregation

https://gerrit.wikimedia.org/r/940940

Change 940940 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Fix uniqueness constraint for ce_question_aggregation

https://gerrit.wikimedia.org/r/940940

Mentioned in SAL (#wikimedia-releng) [2023-07-24T22:44:14Z] <Daimona> Changing index on the ce_question_aggregation DB table in beta wikishared # T342479

Daimona updated the task description. (Show Details)