Page MenuHomePhabricator

Prevent association of the same edit with multiple events
Closed, ResolvedPublic3 Estimated Story Points

Description

A given edit should only be associated with a single event. User should be able to associate edits on same article with different events, if the edits are different.

Error message: "An edit can only be associated with one event."

Notes: You will need to apply the schema change manually in your local environment:

CREATE UNIQUE INDEX cec_wiki_revision ON ce_event_contributions (cec_wiki, cec_revision_id);

Event Timeline

ifried updated the task description. (Show Details)

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

[mediawiki/extensions/CampaignEvents@master] Add username to the event contribution entity layer

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

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

[mediawiki/extensions/CampaignEvents@master] Make sure that every edit is associated with at most one event

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

Daimona updated the task description. (Show Details)

Hi DBA s! Tagging you to request approval for the following schema change, as per https://wikitech.wikimedia.org/wiki/Schema_changes. When approved and merged, I fill file a separate task to get it applied in prod (together with T404995).

ALTERs
CREATE UNIQUE INDEX cec_wiki_revision ON ce_event_contributions (cec_wiki, cec_revision_id);

See also JSON diff with comments. Note that, like in T404995#11269436, this is not being done in a backwards-compatible fashion because the table was introduced recently and is unused.

Change #1196679 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Make sure that every edit is associated with at most one event

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

vaughnwalters subscribed.

✅ A given edit should only be associated with a single event. User should be able to associate edits on same article with different events, if the edits are different.

Error message: "An edit can only be associated with one event."

Screenshot 2025-10-31 at 5.11.53 PM.png (1×1 px, 176 KB)

Working as expected, sending to product sign off