Skip to content
Back

Can I create a transaction that involves auth.users table ?

  • 0
  • Auth
  • Web
dei8bit
24 Feb, 2026, 04:57

i want to create a row un auth.users and then create a user in a table profiles

but i want to use the same id for both tables.

So, if insert a row in profiles fails, i want a rollback.

is this possible?

TL;DR
Developer wants to create a transaction involving both the `auth.users` and `profiles` tables, using the same id for both. They need the ability to rollback if the insertion into the `profiles` table fails. Solution: Yes, it is possible to achieve this using transactions in the database. By wrapping the insertions into both tables within a transaction block, if an error occurs during the insertion into the `profiles` table, the transaction can be rolled back to maintain data consistency.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more