Consistently link all commands in guides to cli usage (#8314)

Link more commands in guide to cli usage
This commit is contained in:
Han Qiao authored and GitHub committed 2022-08-15 17:04:30 +08:00
1 parent 57619b061c
commit 38e5bfff5f
2 files changed
+9 -9

No files matched your search

@@ -39,7 +39,7 @@ supabase login
supabase link --project-ref $PROJECT_ID
```
You can get your `<project-id>` from your project’s dashboard URL:
You can get your `$PROJECT_ID` from your project’s dashboard URL:
```
https://app.supabase.com/project/<project-id>
@@ -292,7 +292,7 @@ When configured correctly, your repository should have CI and Release workflows
### Open a PR with new migration
Now that your repository is set up, it’s time to create a new migration. Follow our [migration guide](#creating-a-new-migration) to create a file `supabase/migrations/<timestamp>_new_employee.sql`.
Now that your repository is set up, it’s time to create a new migration. Follow the [migration section](#creating-a-new-migration) to create a file `supabase/migrations/<timestamp>_new_employee.sql`.
Checkout a new branch `feat/employee` from `develop` , commit the migration file, and push to GitHub.
@@ -380,6 +380,6 @@ mv <time>_dev_A.sql <t+2>_dev_A.sql
supabase db reset
```
In case `reset` fails, you can manually resolve conflicts by editing `<t+2>_dev_A.sql` file.
In case [`reset`](/reference/cli/usage#supabase-db-reset) fails, you can manually resolve conflicts by editing `<t+2>_dev_A.sql` file.
Once validated locally, commit your changes to Git and push to GitHub.
@@ -133,7 +133,7 @@ For this guide, let's create a table called `employees`, using the "Supabase Stu
:::note
If you're familiar with databases, you can also execute any SQL using the `DB URL` shown by `supabase start`.
If you're familiar with databases, you can also execute any SQL using the `DB URL` shown by [`supabase status`](/reference/cli/usage#supabase-status).
:::
@@ -146,17 +146,17 @@ create table employees (
);
```
Now we have the `employees` table in the local database, but how do we incorporate this into migrations? The CLI automatically detects changes by running the [db diff](/reference/cli/usage#supabase-db-diff) command:
Now we have the `employees` table in the local database, but how do we incorporate this into migrations? The CLI automatically detects changes by running the [`db diff`](/reference/cli/usage#supabase-db-diff) command:
```sh
supabase db diff create_employees -f create_employees
```
This creates a new migration named `supabase/migrations/<timestamp>_create_employees.sql`, representing any changes we've made to the local database since `supabase start`.
This creates a new migration named `supabase/migrations/<timestamp>_create_employees.sql`, representing any changes we've made to the local database since [`supabase start`](/reference/cli/usage#supabase-start).
#### Adding sample data
Let's add some sample data into the table. We can use the seed script in `supabase/seed.sql` (which gets created when you run `supabase init`).
Let's add some sample data into the table. We can use the seed script in `supabase/seed.sql` (which gets created when you run [`supabase init`](/reference/cli/usage#supabase-init)).
```sql
-- in supabase/seed.sql
@@ -177,7 +177,7 @@ If you look again within Studio, you should now see the contents of `employees`.
#### Resetting database changes
If you run any SQL on the local database that you want to revert, you can use the `reset` command.
If you run any SQL on the local database that you want to revert, you can use the [`reset`](/reference/cli/usage#supabase-db-reset) command.
```sql
-- run on local database to make a change
@@ -205,7 +205,7 @@ There are a few commands required to link your project. We are in the process of
:::
Let's associate your project with your remote project using [supabase link](/guides/local-development).
Let's associate your project with your remote project using [`supabase link`](/reference/cli/usage#supabase-link).
```bash