From 691f2eefdfbb1dd69779033076e4edac88becd78 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:17:48 -0500 Subject: [PATCH 1/2] refactor: identify troubleshooting pages by filepath (#30820) Generate the troubleshooting slugs from the filepaths, not the titles. This will help with the automatic migration, since we don't have to worry about duplicate titles. --- apps/docs/app/guides/troubleshooting/[slug]/page.tsx | 6 +++--- apps/docs/features/docs/Troubleshooting.ui.tsx | 2 +- .../features/docs/Troubleshooting.utils.common.mjs | 11 +++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/apps/docs/app/guides/troubleshooting/[slug]/page.tsx b/apps/docs/app/guides/troubleshooting/[slug]/page.tsx index 01d40abeef79f..9e2a1471a8dd3 100644 --- a/apps/docs/app/guides/troubleshooting/[slug]/page.tsx +++ b/apps/docs/app/guides/troubleshooting/[slug]/page.tsx @@ -14,7 +14,7 @@ export default async function TroubleshootingEntryPage({ params: { slug: string } }) { const allTroubleshootingEntries = await getAllTroubleshootingEntries() - const entry = allTroubleshootingEntries.find((entry) => getArticleSlug(entry.data) === slug) + const entry = allTroubleshootingEntries.find((entry) => getArticleSlug(entry) === slug) if (!entry) { notFound() @@ -25,7 +25,7 @@ export default async function TroubleshootingEntryPage({ export const generateMetadata = async ({ params: { slug } }: { params: { slug: string } }) => { const allTroubleshootingEntries = await getAllTroubleshootingEntries() - const entry = allTroubleshootingEntries.find((entry) => getArticleSlug(entry.data) === slug) + const entry = allTroubleshootingEntries.find((entry) => getArticleSlug(entry) === slug) return { title: 'Supabase Docs | Troubleshooting' + (entry ? ` | ${entry.data.title}` : ''), @@ -37,5 +37,5 @@ export const generateMetadata = async ({ params: { slug } }: { params: { slug: s export const generateStaticParams = async () => { const allTroubleshootingEntries = await getAllTroubleshootingEntries() - return allTroubleshootingEntries.map((entry) => ({ slug: getArticleSlug(entry.data) })) + return allTroubleshootingEntries.map((entry) => ({ slug: getArticleSlug(entry) })) } diff --git a/apps/docs/features/docs/Troubleshooting.ui.tsx b/apps/docs/features/docs/Troubleshooting.ui.tsx index b3fec96bff8ac..3448846e663ba 100644 --- a/apps/docs/features/docs/Troubleshooting.ui.tsx +++ b/apps/docs/features/docs/Troubleshooting.ui.tsx @@ -36,7 +36,7 @@ export async function TroubleshootingPreview({ entry }: { entry: ITroubleshootin

Date: Tue, 3 Dec 2024 21:49:10 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20add=20guidance=20for=20synci?= =?UTF-8?q?ng=20database=20schema=20with=20--schema=20option=20(#30816)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝 add guidance for syncing database schema with --schema option * Update apps/docs/content/guides/local-development/overview.mdx --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../guides/local-development/overview.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apps/docs/content/guides/local-development/overview.mdx b/apps/docs/content/guides/local-development/overview.mdx index 5b1d59121581d..6e1c8a5cc60d9 100644 --- a/apps/docs/content/guides/local-development/overview.mdx +++ b/apps/docs/content/guides/local-development/overview.mdx @@ -335,6 +335,29 @@ This will upload files from `supabase/images` directory to a bucket named `image supabase seed buckets ``` +### Sync any schema with `--schema` + +You can synchronize your database with a specific schema using the `--schema` option as follows: + +```bash +supabase db pull --schema +``` + + + +Using `--schema` + +If the local `supabase/migrations` directory is empty, the db pull command will ignore the `--schema` parameter. + +To fix this, you can pull twice: + +```bash +supabase db pull +supabase db pull --schema +``` + + + ## Limitations and considerations The local development environment is not as feature-complete as the Supabase Platform. Here are some of the differences: