logoBuildBox

Database

  1. In Supabase SQL Editor, run this query to add a profiles table (an extension of the authenticated user to store data like Stripe customer_id, subscription access, etc...):
SQL Editor
create table public.profiles (
  id uuid not null references auth.users on delete cascade,
  customer_id text,
  price_id text,
  has_access boolean,
  email text,
 
  primary key (id)
);
 
alter table public.profiles enable row level security;
  1. Go to the new profiles table and add 2 RLS policies:
  • Enable read access for authenticated users only
  • Enable insert access for authenticated users only
  1. (Optional) If you want to collect leads with ButtonLead, create a new table called leads and add a RLS policy with insert access for anyone:
SQL Editor
create table public.leads (
  id uuid default gen_random_uuid(),
  email text,
  created_at timestamp with time zone default timezone('utc'::text, now()) not null,
 
  primary key (id)
);
 
alter table public.leads enable row level security;

Last updated on

On this page

No Headings
Edit on GitHub