Page MenuHomePhabricator

Investigate high-level database schema to store addresses
Closed, ResolvedPublic3 Estimated Story PointsSpike

Description

Currently, we break down event location to 1. country and 2. the rest of the address. To prepare for enabling programmatic geolocation for events, we need to investigate how we can break up the address-related columns into separate table(s).

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptAug 24 2022, 4:37 PM
ldelench_wmf set the point value for this task to 3.

My proposal on this it to create two new tables:

1 - ce_address, this one for now will have just the columns to store the full address, and the country.

2 - ce_addresses, this one is to keep the relation between "campaign_events" and "ce_address" so one event can have one or more addresses.

Then, when we start working on geolocation stuff, we can add more columns to the ce_address table as needed.

After we move all the data of old events on beta to the new structure, we can drop the event_meeting_country and event_meeting_address from the campaign_events table

@vyuen , @Daimona and @MHorsey-WMF , I would love to have your feedback on this, thanks in advance. below is a link of the DB diagram.
https://dbdesigner.page.link/r5x5E6zP14iXMGN6A

This proposals looks good overall, just a few minor notes:

1 - ce_address, this one for now will have just the columns to store the full address, and the country.

I would avoid calling the field "ce_address" (same as the table). Also, the field prefix would be "cea". So maybe the fields could be cea_id, cea_full_address, cea_country.

2 - ce_addresses, this one is to keep the relation between "campaign_events" and "ce_address" so one event can have one or more addresses.

For clarity, I'd call this ce_event_address. The field prefix would then be "ceea", and the fields could be ceea_event and ceea_address. I think we also need to follow the recommendation of adding an autoincrement primary key (even if the other two fields will be part of a unique index).

This proposals looks good overall, just a few minor notes:

1 - ce_address, this one for now will have just the columns to store the full address, and the country.

I would avoid calling the field "ce_address" (same as the table). Also, the field prefix would be "cea". So maybe the fields could be cea_id, cea_full_address, cea_country.

2 - ce_addresses, this one is to keep the relation between "campaign_events" and "ce_address" so one event can have one or more addresses.

For clarity, I'd call this ce_event_address. The field prefix would then be "ceea", and the fields could be ceea_event and ceea_address. I think we also need to follow the recommendation of adding an autoincrement primary key (even if the other two fields will be part of a unique index).

Thank you so much!!!
I agree with these improvements.

vyuen changed the task status from Open to In Progress.Aug 30 2022, 12:13 PM

Closing this as the work is complete. However, please feel free to continue the discussion if necessary.