upsert users #8

Open
opened 2023-01-27 18:38:19 +00:00 by kiara · 0 comments
Owner

it would be nice to be able to upsert users such as to automatically deduplicat them by email.
however, Rails upsert supports default only on the db level, not on the model level.
to this end, we should set users' token on the db level.
postgres could do this using e.g. md5(random()::text).
the missing piece here now is to figure out how to express this in a Rails db migration.

it would be nice to be able to upsert users such as to automatically deduplicat them by email. however, Rails upsert supports default only on the db level, not on the model level. to this end, we should set users' `token` on the db level. postgres could do this using e.g. `md5(random()::text)`. the missing piece here now is to figure out how to express this in a Rails db migration.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bij1/ingang#8
No description provided.