indico / indico-migrate

Utility to migrate Indico 1.2 ZODB databases to 2.0 (Postgres)
GNU General Public License v3.0
2 stars 3 forks source link

option to suppress garbage participant email #17

Closed jouvin closed 7 years ago

jouvin commented 7 years ago

In our 1.2 database, we have several invalid emails entered by participants who registered to events, in particular missing @dom.ain. Currently the migration script is adding @example.com which is not really making sense IMO. Could it be possible to have an option to delete such emails rather than modifying them (keeping the participants)?

ThiefMaster commented 7 years ago

All registrants/participants need to have an email address, so not using an email address at all is not a good option. Storing an empty address would technically work, but it would prevent us from ever adding e.g. a CHECK constraint that enforces a non-empty string in the column.

Using @example.com has the advantage of having a valid-looking email (so if someone were to edit such a registration it would not fail with a validation error) while still being obviously not a real email (example.com is an "official" example domain (RFC6761)).

jouvin commented 7 years ago

OK then! Checking a few events, I think that many old events have participants registered without an email... I guess it has been allowed at some point, at least in CDS Agenda! That means that you will have a hard time to put a constraint on this column in the DB that the value should not be empty...

ThiefMaster commented 7 years ago

We use no-email[+n]@example.com for these, so we don't have any empty emails. You can actually see all of these placeholder emails using this SQL query:

SELECT first_name, last_name, email FROM event_registration.registrations WHERE email LIKE '%@example.com';
jouvin commented 7 years ago

You are right! Thanks.