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
- IMPORTANT! SOC-2 Request Failing
Issue requesting SOC-2. If tried other/private browser as well as filling in optional fields.
- Can you suppress row $meta data?
When using listRows with a 'select' query to limit the response [for performance], I'm still getting extra columns (eg. `$id`, `$sequence`, `$createdAt`, `$upda...
- How can I disable client-side account re...
Hi everyone! I’m currently building a game backend using Appwrite, and I’d like to prevent users from creating new accounts directly through the client. My go...