The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update branching docs warnings (#19400)
Jonathan Summers-Muirc59f7b56c671
diff --git a/apps/docs/pages/guides/platform/branching.mdx b/apps/docs/pages/guides/platform/branching.mdxindex 7cd9416151b..44215065b85 100644--- a/apps/docs/pages/guides/platform/branching.mdx+++ b/apps/docs/pages/guides/platform/branching.mdx@@ -7,11 +7,9 @@ export const meta = {subtitle: 'Use Supabase Branches to test and preview changes',}- <Admonition type="note">+<Admonition type="note" label="Branching is only available on the Pro Plan and above.">--- </Admonition>+</Admonition>Use branching to safely and easily experiment with changes to your Supabase project.@@ -21,32 +19,31 @@ When you're ready to ship your changes, merge your branch to update your productIf you understand Git, you already understand Supabase Branching.- <Admonition type="caution" label="Branching is in Alpha">+<Admonition type="caution" label="Branching is in Alpha">- It is not recommended to use Branching in a production environment.+It is not recommended to use Branching in a production environment.Branching is an Alpha feature. To try out branching for non-production experiments, [request access here](https://forms.supabase.com/branching-request).- </Admonition>+</Admonition>## How branching worksSupabase projects can consist of multiple Preview Branches. All Preview Branches are backed by an isolated Supabase instance. Each instance contains all Supabase features, and has its own API credentials.- <figure className="max-w-[700px] mx-auto">- <Image- className="hidden dark:block"- alt="Each branch has a separate Supabase instance."- src="/docs/img/guides/platform/branching/github-workflow-without-branching.jpg"- />-+<figure className="max-w-[700px] mx-auto">+ <Image+ className="hidden dark:block"+ alt="Each branch has a separate Supabase instance."+ src="/docs/img/guides/platform/branching/github-workflow-without-branching.jpg?v=1"+ /><Image- className="dark:hidden"- alt="Each branch has a separate Supabase instance."- src="/docs/img/guides/platform/branching/github-workflow-without-branching--light.jpg"- />+ className="dark:hidden"+ alt="Each branch has a separate Supabase instance."+ src="/docs/img/guides/platform/branching/github-workflow-without-branching--light.jpg?v=1"+ /><figcaption>Each branch has a separate Supabase instance.</figcaption>- </figure>+</figure>Supabase branching works like Git branching, with one main Production branch. Preview Branches branch off your Production branch and contain proposed changes. These changes can then be merged into Production.@@ -56,13 +53,13 @@ The Preview Branch will also be [seeded with sample data](#seeding-behaviour) ifBy creating new SQL migrations in a Preview Branch to propose schema changes, those changes can then be merged into your Production branch. These changes then run the new migrations on your Supabase Production branch. This is exactly how Git branches work: experiment on a feature branch and merge back into Production when you're finished.- <Admonition type="note" label="Schema-only changes">+<Admonition type="note" label="Schema-only changes">Only *schema* changes are captured in preview branches.-Preview Branch instances contain no data by default. You must include a seed file to seed your preview instance with sample data when the Preview Branch is created. Future versions of Branching may allow for automated data seeding and cloning.+ Preview Branch instances contain no data by default. You must include a seed file to seed your preview instance with sample data when the Preview Branch is created. Future versions of Branching may allow for automated data seeding and cloning.- </Admonition>+</Admonition>## Git providers@@ -80,37 +77,39 @@ You can create a corresponding Preview Branch for any Git branch in your repositThe Preview Branch is also seeded with sample data based on `./supabase/seed.sql`, if that file exists.- <figure className="max-w-[700px] mx-auto">- <Image- className="hidden dark:block"- alt="Each GitHub branch can have its own Supabase preview branch."- src="/docs/img/guides/platform/branching/github-workflow.jpg"- />+<figure className="max-w-[700px] mx-auto">+ <Image+ className="hidden dark:block"+ alt="Each GitHub branch can have its own Supabase preview branch."+ src="/docs/img/guides/platform/branching/github-workflow.jpg?v=1"+ />- <Image- className="dark:hidden"- alt="Each GitHub branch can have its own Supabase preview branch."- src="/docs/img/guides/platform/branching/github-workflow--light.jpg"- />- <figcaption>Each GitHub branch can have its own Supabase preview branch.</figcaption>- </figure>+ <Image+ className="dark:hidden"+ alt="Each GitHub branch can have its own Supabase preview branch."+ src="/docs/img/guides/platform/branching/github-workflow--light.jpg?v=1"+ />+ <figcaption>Each GitHub branch can have its own Supabase preview branch.</figcaption>++</figure>Each time a commit is pushed with new migrations in the `./supabase/migrations` directory, the migrations are run on the matching preview instance.- <figure className="max-w-[700px] mx-auto">- <Image- className="hidden dark:block"- alt="New migration files trigger migrations on the preview instance."- src="/docs/img/guides/platform/branching/github-workflow-commit-migration.jpg"- />+<figure className="max-w-[700px] mx-auto">+ <Image+ className="hidden dark:block"+ alt="New migration files trigger migrations on the preview instance."+ src="/docs/img/guides/platform/branching/github-workflow-commit-migration.jpg?v=1"+ />- <Image- className="dark:hidden"- alt="New migration files trigger migrations on the preview instance."- src="/docs/img/guides/platform/branching/github-workflow-commit-migration--light.jpg"- />- <figcaption>New migration files trigger migrations on the preview instance.</figcaption>- </figure>+ <Image+ className="dark:hidden"+ alt="New migration files trigger migrations on the preview instance."+ src="/docs/img/guides/platform/branching/github-workflow-commit-migration--light.jpg?v=1"+ />+ <figcaption>New migration files trigger migrations on the preview instance.</figcaption>++</figure>## Alternatives to branching@@ -130,11 +129,11 @@ You can also combine both strategies to perform both local and staging tests.## How to use Supabase Branching- <Admonition type="note" label="Github integration required">+<Admonition type="note" label="Github integration required">+Supabase branching requires the GitHub integration. Your application must be developed in a GitHub repository.-- </Admonition>+</Admonition>### Preparing your GitHub repository@@ -161,13 +160,13 @@ Push your new project to a GitHub repo. For more information, see the GitHub guiBefore enabling branching on an existing project, make sure your database-related files are up to date. You need a current snapshot of your existing database, so newer migration files have a foundation to run on top of.- <Admonition type="caution" label="Get set up before turning on branching">+<Admonition type="caution" label="Get set up before turning on branching">- Setting up the initial state incorrectly can cause migrations to be wrongly applied.+Setting up the initial state incorrectly can cause migrations to be wrongly applied.Follow the instructions below **before turning on Supabase branching**.- </Admonition>+</Admonition>##### If your migration files are already in GitHub, under `./supabase/migrations`:@@ -201,131 +200,145 @@ You need to take a snapshot of your database. Log into Supabase from the [commanOnce your repository is [correctly prepared](#set-up-an-existing-project-for-branching), you can enable branching from the Supabase dashboard.- <Admonition type="caution" label="Prepare your repo before enabling Branching">+<Admonition type="caution" label="Prepare your repo before enabling Branching">+Before turning on branching, make sure your [GitHub repository is prepared](#set-up-an-existing-project-for-branching). If your repository doesn’t have all the migration files, your production branch could run an incomplete set of migrations.+</Admonition>- </Admonition>+<Admonition type="note" label="Branching is early access only">- <Admonition type="note" label="Branching is invite-only">+Sign up for early access (here)[https://forms.supabase.com/branching-request].- Branching is only available to alpha testers.+</Admonition>-If you’re not in the alpha testing group, you can join the waitlist.+<StepHikeCompact>+ <StepHikeCompact.Step step={1}>+ <StepHikeCompact.Details title="Select the project you want to use, then click `Enable branching`" fullWidth>- </Admonition>+ If you’re prompted to join the waitlist, click `Join waitlist`. Access will be expanded as branching graduates from alpha testing.-1. Select the project you want to use, then click `Enable branching`.- If you’re prompted to join the waitlist, click `Join waitlist`. Access will be expanded as branching graduates from alpha testing.+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-popover.jpg?v=1" />+ </figure>- <figure className="max-w-[520px]">+ </StepHikeCompact.Details>+ </StepHikeCompact.Step>- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-popover.jpg" />+ <StepHikeCompact.Step step={2}>+ <StepHikeCompact.Details title="If you see the following dialog, you’re in the alpha testing group" fullWidth>- </figure>--2. If you see the following dialog, you’re in the alpha testing group.-- <figure className="max-w-[520px]">+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-github.jpg?v=1" />+ </figure>- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-github.jpg" />+ If you don’t have the GitHub integration installed, click `Install GitHub Integration`. The integration is required to run migration files and the optional database seed file.- </figure>+ You’re taken to the GitHub integration page. Click `Install`.- If you don’t have the GitHub integration installed, click `Install GitHub Integration`. The integration is required to run migration files and the optional database seed file.+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-github-permissions.jpg?v=1" />+ </figure>- You’re taken to the GitHub integration page. Click `Install`.+ Follow the instructions to link your Supabase project to its GitHub repository.- <figure className="max-w-[520px]">+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-github-integration-link.jpg?v=1" />+ </figure>- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-github-permissions.jpg" />+ Return to your project and re-click `Enable branching`.- </figure>+ </StepHikeCompact.Details>+ </StepHikeCompact.Step>- Follow the instructions to link your Supabase project to its GitHub repository.+ <StepHikeCompact.Step step={3}>+ <StepHikeCompact.Details title="If you see the following dialog, you’re in the alpha testing group" fullWidth>- <figure className="max-w-[520px]">+ You should now see a popover with the GitHub Connection details shown.- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-github-integration-link.jpg" />+ Type in the branch you want to use for production. The name of the branch will be validated to make sure it exists in your GitHub repository.- </figure>-- Return to your project and re-click `Enable branching`.--3. You should now see a popover with the GitHub Connection details shown.-- Type in the branch you want to use for production. The name of the branch will be validated to make sure it exists in your GitHub repository.-- <Admonition type="caution">+ <Admonition type="caution">Your production branch can’t be changed while branching is enabled.- To change your production branch, you need to disable branching and re-enable it with a different branch.+ To change your production branch, you need to disable branching and re-enable it with a different branch.</Admonition>- <figure className="max-w-[520px]">+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-production-branch.jpg?v=1" />+ </figure>- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-opt-in-install-production-branch.jpg" />+ </StepHikeCompact.Details>+ </StepHikeCompact.Step>- </figure>+ <StepHikeCompact.Step step={3}>+ <StepHikeCompact.Details title="Click `I understand, enable branching`. Branching is now enabled for your project." fullWidth>-4. Click `I understand, enable branching`. Branching is now enabled for your project.++ </StepHikeCompact.Details>+ </StepHikeCompact.Step>++</StepHikeCompact>### Create your first preview branchPreview branches are automatically created for each pull request, but you can also manually create one.-1. ##### Create a new Git branch in your GitHub repository+<StepHikeCompact>+ <StepHikeCompact.Step step={1}>+ <StepHikeCompact.Details title="Create a new Git branch in your GitHub repository" fullWidth>You need at least one other branch aside from your Supabase production branch.<figure className="max-w-[520px]">-- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-github.jpg" />-- <figcaption>-- </figcaption>-+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-github.jpg?v=1" />+ <figcaption>You can use the GitHub dashboard or command line to create a new branch. In this example, the new branch is called `feat/add-members`.</figcaption></figure>- You can use the GitHub dashboard or command line to create a new branch. In this example, the new branch is called `feat/add-members`.+ You can use the GitHub dashboard or command line to create a new branch. In this example, the new branch is called `feat/add-members`.-2. ##### Navigate to the Branches page in your Supabase dashboard.+ </StepHikeCompact.Details>+ </StepHikeCompact.Step>+ <StepHikeCompact.Step step={2}>+ <StepHikeCompact.Details title="Navigate to the Branches page in your Supabase dashboard." fullWidth>- In the Supabase dashboard, look for the branch dropdown on the right-hand side of the top bar. It should be set to your production branch by default. Open the dropdown and click `Manage branches`.+ In the Supabase dashboard, look for the branch dropdown on the right-hand side of the top bar. It should be set to your production branch by default. Open the dropdown and click `Manage branches`.- <figure className="max-w-[520px]">-- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-branch-dropdown.jpg" />-- </figure>--3. ##### Create a Supabase preview branch+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-branch-dropdown.jpg?v=1" />+ </figure>- Click `Create preview branch`.+ </StepHikeCompact.Details>+ </StepHikeCompact.Step>- <figure className="max-w-[520px]">+ <StepHikeCompact.Step step={3}>+ <StepHikeCompact.Details title="Create a Supabase preview branch" fullWidth>- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-branch-action.jpg" />+ Click `Create preview branch`.- </figure>+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-branch-action.jpg?v=1" />+ </figure>- Type in the branch name you want to add. Click `Create branch` to confirm.+ Type in the branch name you want to add. Click `Create branch` to confirm.- <Admonition type="note">+ <Admonition type="note">**Only branches from the repository can be used to create a Preview Branch**- Git branches from external contributors currently can’t support a Preview Branch+ Git branches from external contributors currently can’t support a Preview Branch</Admonition>- <figure className="max-w-[520px]">+ <figure className="max-w-[520px]">+ <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-choose-branch.jpg?v=1" />+ </figure>- <Image src="/docs/img/guides/platform/branching/enable-supabase-branching-first-preview-branch-choose-branch.jpg" />+ </StepHikeCompact.Details>+ </StepHikeCompact.Step>- </figure>+</StepHikeCompact>### Develop your app with Supabase branches@@ -387,18 +400,18 @@ If you need to reset your database to a clean state (that is, discard any changeAs an alternative to developing locally, you can make changes on your remote Supabase dashboard. You can then pull these changes to your local machine and commit them to GitHub.- <Admonition type="note">+<Admonition type="note">- Changes must be locally pulled and committed to keep your GitHub repository state in sync.+Changes must be locally pulled and committed to keep your GitHub repository state in sync.Dashboard changes aren’t automatically reflected in your repository. If you’d like to see automatic syncing in a future release, [join the discussion](https://github.com/orgs/supabase/discussions/18937).- </Admonition>+</Admonition>1. Click on the active branch in the top bar to open the dropdown menu. Select the branch you want to use.<figure className="max-w-[520px]">- <Image src="/docs/img/guides/platform/branching/develop-your-app-develop-remotely.jpg" />+ <Image src="/docs/img/guides/platform/branching/develop-your-app-develop-remotely.jpg?v=1" /></figure>2. Make changes to your database schema from the Supabase dashboard.@@ -417,14 +430,11 @@ When you open a pull request on GitHub, the Supabase integration automatically cA comment is added to your PR with the deployment status of your preview branch. Statuses are shown separately for Database, Services, and APIs.- <figure className="max-w-[700px] mx-auto">- <Image src="/docs/img/guides/platform/branching/develop-your-app-open-pull-request-github.jpg" />--{/* prettier-ignore */}- <figcaption>-- </figcaption>- </figure>+<figure className="max-w-[700px] mx-auto">+ <Image src="/docs/img/guides/platform/branching/develop-your-app-open-pull-request-github.jpg?v=1" />+ {/* prettier-ignore */}+ <figcaption>Supabase GitHub integration will comment on your PR with the status of your Preview Branch, including whether migrations have successfully run.</figcaption>+</figure>Every time a new commit is pushed that changes the migration files in `./supabase/migrations`, the new migrations are run against the preview branch. You can check the status of these runs in the comment’s Tasks table.@@ -434,14 +444,11 @@ We highly recommend turning on a ‘required check’ for the Supabase integratiThis prevents PRs from being merged when migration checks fail, and stops invalid migrations from being merged into your production branch.- <figure className="max-w-[700px] mx-auto">- <Image src="/docs/img/guides/platform/branching/github-required-check.jpg" />--{/* prettier-ignore */}- <figcaption>-- </figcaption>- </figure>+<figure className="max-w-[700px] mx-auto">+ <Image src="/docs/img/guides/platform/branching/github-required-check.jpg?v=1" />+ {/* prettier-ignore */}+ <figcaption>Check the "Require status checks to pass before merging" option.</figcaption>+</figure>### Disable branching@@ -497,22 +504,24 @@ With the Supabase branching integration, you can sync the Git branch used by the### Vercel- <Admonition type="note">+<Admonition type="note">- Vercel Branching support is in development+ Vercel Branching support is in development.-The Vercel Integration for Supabase branching is under development. To express your interest, [join the discussion on GitHub discussions](https://github.com/orgs/supabase/discussions/18938).+ The Vercel Integration for Supabase branching is under development. To express your interest, [join the discussion on GitHub discussions](https://github.com/orgs/supabase/discussions/18938).- </Admonition>+</Admonition>Install the Vercel integration:- From the [Vercel marketplace](https://vercel.com/integrations/supabase-v2) or- By clicking the blue `Deploy` button in a Supabase example app’s `README` file- <Admonition type="note">+<Admonition type="note">- </Admonition>+For branching to work with Vercel, you also need the [Vercel GitHub integration](https://vercel.com/docs/deployments/git/vercel-for-github).++</Admonition>Supabase automatically updates your Vercel project with the correct environment variables for the corresponding preview branches.