Skip to content

Storing user first/last name, other data #226

Answered by kiwicopple
mariusa asked this question in Questions
Discussion options

You must be logged in to vote

There are a few ways to do this. I recommend that you keep all the user data in a completely separate table. You will have:

  • auth.users - GoTrue only, session data
  • public.users - For your app. Will contain the user data. I recommend setting up the table something like this:
create table public.users (
  id            uuid primary key references auth.users,
  first_name    text,
  last_name     text
);

You can also create a trigger on the auth.users table that inserts a row into the public.users table, but it's not necessary - you can handle this from your application so that once they have successfully signed up, you are returned a uuid, and you insert data into public.users.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mariusa
Comment options

@imjared
Comment options

@kiwicopple
Comment options

@lior-amsalem
Comment options

Answer selected by mariusa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants