From 0.16 to 0.17
What to check when upgrading to better-supabase 0.17, where the organizations block may drop its stripe_customer_id column and blocks can leave your own tables' policies to you.
Read this page before you run upgrade. One change can drop a column with its
data: the organizations block now adds stripe_customer_id only when the
entitlements block reads the Stripe customer from it.
Keep stripe_customer_id
The block keeps the column when the entitlements block reads the Stripe customer from it. It no longer adds it in these cases:
- the entitlements source is
plansorcustom, auth.entitlements.customernames another column,- the managed
billingblock keeps the customers.
In those cases the column leaves the block's file on upgrade. On a managed
organizations table, the next declarative schema diff then drops the column
and its data, and stripeCustomerId leaves the generated models.
If your app reads or writes the column, keep it before you upgrade, in one of two ways:
-
Declare it in your own schema file, such as
supabase/schemas/public/organizations-extras.sql:alter table better_supabase.organizations add column if not exists stripe_customer_id text unique; -
Or point
auth.entitlements.customerat it, which keeps the block adding it:auth: { entitlements: { customer: "better_supabase.organizations.stripe_customer_id", }, },
Then run the upgrade and read the diff before you apply it:
npx better-supabase upgrade
npx better-supabase db diffThe diff must not contain drop column stripe_customer_id. If it does, stop
and add the column as above.
Your own policies on your own tables
database.sql.ownTablePolicies: "app" (or blocks.<name>.ownTablePolicies
for one block) keeps a block's policies off the tables your schema creates, so
your policies alone decide who reaches the rows. The block still writes its
functions, triggers, indexes and grants. The default, block, keeps the
behaviour since 0.15. add --adopt suggests app when an adopted table
already has permissive policies of its own, and doctor's BS350 reports a
command your policies leave closed.
Other changes
- With tenant and platform invitations in one table, a person can hold open
invitations to several organizations: the block replaces
platform_invitations_open_email_idxwithinvitations_platform_open_email_idx. updated-atandcreated-bytakeoptions.stamp: "trigger", which leaves the stamps to the database triggers. Use it on tables whose column grants leave those columns out.
Last updated on
From 0.17 to 0.18
What to check when upgrading to better-supabase 0.18, which closes two access gaps, lowercases profile emails and adds multi-role members, offline attachments and notifications, notification actions and cookie-free middleware.
From 0.15 to 0.16
What to check when upgrading to better-supabase 0.16, which adds a Realtime relay, session watching, resumable uploads and multi-limit rate limiting.