how can i make a relationship between a column in a table and $id in auth.users?
- 0
- 2
- Databases
- Auth
- Web
i want to relate the $id from users auth table in appwrite with other column in my table user_profile. because is the same user...
how can i have exactly the same id for both tables?
We cant do this actually One of the easiest ways would be via auth events
Whenever a new user is created, shoot a function that copies the data into the table
Or one more way , since we support transactions now and we know transactions are atomic
So I would follow this but can be counter intuitive as well but db and auth would be totally in sync
- transaction block
- db operation with a custom id for the user table
- Use the same id in the auth creation
- If auth fails db will not commit your result since inside a transaction block
A bit counter intuitive as auth should be the source of truth and not database but we are doing db operation first. But it will work reliably
nice!!!, well at least there's a way to achieve that.
because the problem with auth.users is that assume a solid shape for users. and in the other hand, if you create your own user table, you lose built-in features of auth.users table :p
Recommended threads
- TEAM INVITE
There is a problem with the team invitation. When a user invites other users, that time, the newly created email address they don't get the invite link and old ...
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...