Skip to Content
LaunchfastDocs

Database schema

Every table the kit creates, and what's stored in it.

Defined in src/db/schema.ts. Deleting a user deletes all their rows in every table below.

Auth tables (Better Auth)

TableHolds
userName, email, whether the email is confirmed, image, role (user or admin), ban status and reason
sessionSigned-in sessions: token, expiry, IP address and browser
accountHow each user signs in: a password (credential), Google or GitHub. One user can have several
verificationEmail confirmation and password reset tokens
rate_limitRate limit counters, shared by all server instances

Better Auth expects these exact field names. Add columns if you need to; don't rename existing ones.

Billing tables

TableHolds
billing_customerLinks a user to their Dodo customer ID. Created at their first checkout. provider is dodo
subscriptionOne row per subscription: product, status, next billing date, cancel-at-period-end, price, interval, and the timestamp of the last event applied (provider_updated_at)
paymentThe ledger of every successful charge: amount and currency charged, settlement amount and currency (what reached your balance), kind (one_time or subscription), status (paid or refunded)

All amounts are integers in the currency's smallest unit.

Billing tables are written only by webhooks (and billing_customer by checkout). Don't edit them by hand on a live site, except to clear test data before launch.

Repository delivery

TableHolds
repo_accessThe GitHub username invited for each user, and when

Useful queries

Run these in the Neon console's SQL Editor.

-- Everyone who has paid, newest first
select u.email, p.amount, p.currency, p.kind, p.status, p.created_at
from payment p join "user" u on u.id = p.user_id
order by p.created_at desc;

-- Active subscriptions
select u.email, s.product_id, s.current_period_end, s.cancel_at_period_end
from subscription s join "user" u on u.id = s.user_id
where s.status = 'active';

-- Admins
select email from "user" where role = 'admin';

On this page