Page MenuHomePhabricator

Update database schema to support private registration
Closed, ResolvedPublic2 Estimated Story Points

Description

We need to add support for private registration to the database schema. I believe it should be implemented as a simple boolean field in ce_participants, e.g., cep_private.

Acceptance criteria
  • Add the field to the schema
  • Adjust the code so that it accounts for the new field being present. For now there should be no change in behaviour, and the value should always be false.

Deployment plan

  • Write the patch that changes the schema in the code. Review it, but DO NOT MERGE IT. Only give it a +1, explicitly writing in a comment that the +1 means you are approving the change (and not that you have a working mouse).
  • Create the new column on beta with a default value (see below)
  • Merge the patch and wait for it to reach beta
  • Remove default value on beta

ALTERs to run on beta

Before merging the patch:

ALTER TABLE ce_participants ADD COLUMN cep_private TINYINT(1) NOT NULL DEFAULT 0 AFTER cep_user_id

After merging the patch:

ALTER TABLE ce_participants ALTER cep_private DROP DEFAULT;
NOTE: Since we're not doing this in a backwards-compatible way, you will have to alter the tables manually on your local once the patch is merged

Event Timeline

Daimona set the point value for this task to 2.

Estimated asynchronously

ifried renamed this task from Update database schema to support confidential registration to Update database schema to support private registration.Sep 23 2022, 1:23 PM
ifried updated the task description. (Show Details)

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

[mediawiki/extensions/CampaignEvents@master] Update schema for private registration

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

Mentioned in SAL (#wikimedia-releng) [2022-09-26T21:31:49Z] <Daimona> Applying schema change to the wikishared DB on beta for the CampaignEvents extension (1/2) # T318120

Change 835226 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Update schema for private registration

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

Mentioned in SAL (#wikimedia-releng) [2022-09-26T21:46:21Z] <Daimona> Applying schema changes to the wikishared DB on beta for the CampaignEvents extension # T318379 T318120

Daimona added a subscriber: vaughnwalters.

@vaughnwalters For testing: make sure that the schema on beta is up-to-date, and that we didn't introduce any bug in things related to registering for an event (e.g., make sure that you can still register without crashes and that your username appears in the lists of participants).

✅ ce_participants has column cep_private as a tinyint(1) and it is not noll as seen in the below table

Screen Shot 2022-09-28 at 12.53.48 PM.png (392×1 px, 91 KB)

registration is still functioning correctly, no crashes or errors:

example from en betacluster:

Screen Recording 2022-09-28 at 2.14.32 PM.gif (1×2 px, 1 MB)

example from ar betacluster:

Screen Recording 2022-09-28 at 2.27.43 PM.gif (488×960 px, 1 MB)

moving this ticket to done / resolved