Skip to content

Profiles

Table: public.profiles

Columns

Column Type Default Description
id uuid PK References auth.users(id) ON DELETE CASCADE
email text NOT NULL User email
first_name text nullable Given name
last_name text nullable Family name
phone text nullable Phone number
role text 'customer' customer, seller, admin
profile_picture_url text nullable Avatar
fcm_token text nullable Firebase push token
is_active boolean true Account active
latitude float8 nullable GPS latitude
longitude float8 nullable GPS longitude
biometric_enabled boolean false Biometric auth
two_factor_enabled boolean false 2FA
sms_verification_enabled boolean true SMS verify
email_verification_enabled boolean true Email verify
hide_order_history boolean false Privacy
data_sharing_enabled boolean true Analytics
location_services_enabled boolean true Location
app_lock_pin text nullable Hashed PIN
app_lock_enabled boolean false PIN lock
app_lock_set_at timestamptz nullable PIN set time
created_at timestamptz now() Creation
updated_at timestamptz now() Last update

Indexes

  • PK: profiles_pkey on id
  • idx_profiles_role on role

RLS

  • Admins: full access
  • Owner: read + update own profile