Hello everyone, I have created a “Users” table in Supabase public schema that I can use alongside the users table in “auth” schema, in order to capture more information (first name, last name). I have linked the user id from the auth schema to the user id from the new table that I made and I created a workflow on register to add the additional information (first name, last name) into the new users table.
The problem is that even though both ID types are UUID, the workflow keeps crashing and in Supabase I get this message, saying that the column types don’t match, even though they are both UUID. I don’t know what to do here.
Hello, without the context of your setup, e.g. your table’s definitions it’s really tough to say what’s going on, it seems like the two data types don’t match for some reason. The schema/definition of your table users, and the error logs would be nice.
Also, I think the issue might be that the table name is Capitalized? I see this quite often with people around here.
By the way, if you don’t want to deal with this, I made a two step setup which also includes a trigger and the users table and much much more, including roles setup for WeWeb - which tends to be an another tough spot and also the RLS setup utilities.
Thank you, I’ll check it out, 2 step setup would work as well. In case anyone else will have this issue, I think I made it work. The default value was left blank. I chose the auth.uid option and it seems to work now.
It seems I spoke too soon. It worked for a bit and now it broke again. Is this a bug? I am trying to find other cases but I can’t find anything online. This is the error I get in Supabase log
{
"error_severity": "ERROR",
"event_message": "null value in column \"id\" of relation \"users\" violates not-null constraint",
"id": "ec29d199-5375-4b48-bb37-b4864ff7d235",
"identifier": "syzhvqsutabahkoiydbf",
"timestamp": 1718798109301000
}
From what I can see, something is preventing the user ID from the auth schema to get copied to the users table that I made, in the public schema. But I don’t know why. The only info dialogue that I get is that one saying that the user id types are not the same, even though they are both UUID’s
And in Weweb this is how the flow looks like. Again from what I can see, The first step of the workflow is executed correctly (the sign up), it generates the user ID, but when it gets to step 2 (to insert in the new table the additional information) the ID appears to be undefined.
Hello, unless you provide some details about the whole setup, it’s almost impossible to help, as it would be pure guessing. I’d either have to have a look at your Supabase Setup here, or on a call if you feel more comfortable with it.
You need to Sign In (with your preferred method, e.g. password and email) after signing up an user. Sign Up doesn’t automatically log-in your user (or does it?).
You can either try to setup a trigger in your database so it create the row automatically on signup, or do it in WeWeb after the first login by checking the row doesn’t exist
Thanks Roberto, that seemed to be the issue indeed. It kept getting undefined user id because the user was not signed in. I removed the email confirmation condition and added a sign in step in the workflow between the sign up and database insert and it works. The strange part is that yesterday it worked. I don’t know what I did, but it worked without the signinng in step. Anyway, thank you for the answers, it helped a lot.
Yes,I think I will split the flow in 2, on register I will ask for email and password, then after the user confirms the email and logs in, I will prompt them with a “complete your profile information” screen where I will ask for the first / last name and that is when I will do the database insert into the users table.