ℹ️
This guide walks you through setting up a Supabase database for your project. Supabase offers a convenient way to manage Postgres databases in the cloud, with features like authentication, real-time data updates, and a user interface for data exploration.
Setup
1 - run this query to add a profiles
table In Supabase SQL Editor.
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;
2 - 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
3 - 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;