Currently, the email is set as a primary key for the user table, but to be able to safely reference the user while allowing him to change his email later it might be better to use a surrogate key instead.
I don't know what the postgres supports, but typically this would be either an auto-increment integer or a guid.
Currently, the email is set as a primary key for the user table, but to be able to safely reference the user while allowing him to change his email later it might be better to use a surrogate key instead.
I don't know what the postgres supports, but typically this would be either an auto-increment integer or a guid.