Page MenuHomePhabricator

Review database schema of the CampaignEvents extension
Closed, ResolvedPublic

Description

In preparation for the production deployment, and following the checklist, we would like to ask for a database review of the schema of the CampaignEvents extension.

Links to the schema on master:

Previous review of indexes: T308738: Ensure that all tables have all the necessary indexes

Target deployment date: TBD

Event Timeline

Daimona changed the task status from Open to Stalled.Sep 26 2022, 4:22 PM
Daimona moved this task from Backlog to Meta on the CampaignEvents board.

This is not actionable yet, pending completion of T318120 and T318379, both high priority.

Marostegui added a subscriber: Ladsgroup.

Update: this is currently blocked on T318381.

Daimona changed the task status from Stalled to Open.Oct 4 2022, 12:20 PM
Daimona moved this task from Blocked to Triage on the DBA board.

Another update: this is not actually blocked on T318381, so the schema is effectively ready for review. Just a quick note that if we do end up using the local databases in the future, the schema may change to account for that.

How is it different from the schema I reviewed a couple weeks ago? so I can review less stuff :D

How is it different from the schema I reviewed a couple weeks ago? so I can review less stuff :D

That's a good question :D Here is the overall diff between the commit you reviewed and master. You obviously only need to look at differences in tables.json, and perhaps the autogenerated MySQL schema, but I can't find a way to diff a specific file, so the link above diffs all files.

Notable changes are:

  • We changed the storage of tracking tools (event_tracking_* fields) as explained in T316409
  • We changed the storage of event times and timezone as explained in T311126 (warning: long task and potential headaches ahead!)
  • We added the cep_private field to the ce_participants table: T318120
  • We changed the structure of the ce_organizers table: now, instead of storing tuples of (user, event, role), where every event can have multiple organizers, each one with multiple roles, we store all roles in the same field, so (event, user) is now unique -- T318379
  • We added some (unused) timestamp fields to the ce_organizers table: T312870
  • We added two new tables for storing event addresses: ce_address stores the addresses themselves (for now only full address and country, more structured data will be added later), and ce_event_address is a bridge table between events and addresses (we made it a many-to-many relation) -- T316128
  • We added indexes for some fields, I think these are mostly the ones that you suggested (modulo any changes we made to accommodate for the new columns)

One question and it's good to go: event_tracking_tool_event_id is blob. Is that intentional? It feels it should be int or something like that.

One question and it's good to go: event_tracking_tool_event_id is blob. Is that intentional? It feels it should be int or something like that.

Good question! Yes, it actually is intentional. Different tracking tools can identify events in different ways; some may use integer IDs, but others may not. For instance, the P&E Dashboard identifies courses with unique string IDs (corresponding to the course name, I think).

Okay, then it's good to go. I'll run it soon.

Ladsgroup claimed this task.
Ladsgroup moved this task from Triage to Done on the DBA board.

DBA sign-off is done.