Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/docs/app/guides/troubleshooting/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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}` : ''),
Expand All @@ -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) }))
}
23 changes: 23 additions & 0 deletions apps/docs/content/guides/local-development/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <schema_name>
```

<Admonition type="warning">

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 <schema_name>
```

</Admonition>

## Limitations and considerations

The local development environment is not as feature-complete as the Supabase Platform. Here are some of the differences:
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/features/docs/Troubleshooting.ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function TroubleshootingPreview({ entry }: { entry: ITroubleshootin
<div className="flex flex-wrap items-start gap-x-2 gap-y-4 justify-between">
<div className="flex-grow flex flex-col gap-2">
<Link
href={`/guides/troubleshooting/${getArticleSlug(entry.data)}`}
href={`/guides/troubleshooting/${getArticleSlug(entry)}`}
className={cn('visited:text-foreground-lighter', 'before:absolute before:inset-0')}
>
<h3
Expand Down
11 changes: 5 additions & 6 deletions apps/docs/features/docs/Troubleshooting.utils.common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { toMarkdown } from 'mdast-util-to-markdown'
import { gfm } from 'micromark-extension-gfm'
import { mdxjs } from 'micromark-extension-mdxjs'
import { readdir, readFile, stat } from 'node:fs/promises'
import { join } from 'node:path'
import { join, sep } from 'node:path'
import toml from 'toml'
import { visit } from 'unist-util-visit'
import { v4 as uuidv4 } from 'uuid'
Expand Down Expand Up @@ -176,10 +176,9 @@ export async function getAllTroubleshootingEntriesInternal() {
}

/**
* @param {TroubleshootingMetadata} meta
* @param {TroubleshootingEntry} entry
*/
export function getArticleSlug(meta) {
const slugifiedTitle = meta.title.toLowerCase().replace(/\s+/g, '-')
const escapedTitle = encodeURIComponent(slugifiedTitle)
return escapedTitle
export function getArticleSlug(entry) {
const parts = entry.filePath.split(sep)
return parts[parts.length - 1].replace(/\.mdx$/, '')
}
Loading