interchange / interchange6-schema

DBIC schema for Interchange 6
8 stars 7 forks source link

Multiple email addresses per user #170

Open racke opened 9 years ago

racke commented 9 years ago

While it make sense to have a single email address to identify, I'm running in cases where it would be useful to somehow attach additional email addresses to an account.

Examples:

Merging similar accounts ERP sync BTS / Mailing lists.

Any idea how we can add this in a sane way to the schema?

SysPete commented 9 years ago

User has_many Emails? We can also use Email to store addresses used by the site perhaps?

hexfusion commented 9 years ago

I was just thinking about this. What if we had a numeric primary key as the the real username then the 'primary' email address as an alias. This way you can change your primary email and use it as your login without actually changing the username in User directly. Not directly related to your issue @racke but I think this all needs a revisit.

racke commented 9 years ago

Our primary key on users is users_id.

racke commented 9 years ago

Which email addresses you thinking about SysPete?

SysPete commented 9 years ago

@racke maybe a shop has many different addresses that it sends from depending on context? I don't have specific use case just thinking out loud.

hexfusion commented 9 years ago

ok then I am mistaken all together :sunglasses:

racke commented 9 years ago

So let's start collecting use cases before we decide about schema changes.

SysPete commented 9 years ago

For use cases in initial issue comment from @racke we'd need to add table Email. If no objections then I will add.

SysPete commented 9 years ago

Columns I can see in Email:

SysPete commented 8 years ago

There is another option for alternate email addresses: store them in Address class. We'd probably want to make country_iso_code nullable if we do this but is saves creating a new Email class.

racke commented 8 years ago

Also we need a generic reset token mechanism which is bound to an email address. Currently we only support password resets, but it would be useful for newsletter subscriptions as well. You might not want to enforce creation of a new user to a newsletter subscription.