Database Tables Setup
Setting up your database is essential for getting started with ExpoLaunch. This guide explains how to configure your Supabase database quickly using ready-to-apply migrations — so you don’t have to manually recreate the schema or SQL queries.
How It Works
ExpoLaunch uses Supabase as the backend. Instead of writing SQL by hand, you can instantly recreate the required tables, columns, and policies using migrations provided in the template.
ExpoLaunch comes with pre-built profile and feedback screens that require specific database tables and security policies to function. This guide provides the necessary SQL setup that powers these features:
- The profiles table that drives the Profile screen, including user avatars and profile information
- The feedback table that enables the Feedback submission screen
- An avatars storage bucket for profile images
- Security policies to protect user data
Use Supabase Migrations
- Install Supabase CLI
brew install supabase/tap/supabase
After installation, verify it:
supabase --version
You can also run Supabase CLI without installing it globally:
npx supabase@latest --help
Great for quick commands like supabase init
or supabase db push
.
- Login to Supabase
supabase login
- Link your Supabase project
Go to your Supabase Dashboard, find your project, and copy the Project ID
(ref).
supabase link --project-ref your-project-id
After running this command, Supabase CLI will prompt you for your database password.
You can find it in the Supabase Dashboard under Project Settings → Database → Connection string.
- Apply the migrations
Assuming your current working directory is the root of the ExpoLaunch repo:
supabase db push
This will recreate all required tables, columns, policies, and roles in your Supabase project.
- Manually Create
handle_new_user
Trigger
After supabase db push
, you must manually run the following SQL in the Supabase Dashboard:
create trigger on_auth_user_created
after insert on auth.users
for each row
execute procedure public.handle_new_user();
Supabase does not support auth.users
triggers via CLI migrations. You must apply this trigger manually.
What Tables Are Created?
ExpoLaunch schema includes:
users
— stores all registered users (linked to Supabase auth)notes
— demo table to store note content per user
You don’t need to modify anything — it’s preconfigured to work with the rest of the app out of the box.