Skip to content

Commit

Permalink
Simplify instructions in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mscoutermarsh authored Dec 12, 2023
1 parent 72c01c4 commit 3d1bf1e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ And then execute in your terminal:
bundle install
```

## Usage
Make sure you have the [`pscale` CLI installed](https://github.com/planetscale/cli#installation).

First, make sure you have the [`pscale` CLI installed](https://github.com/planetscale/cli#installation). You'll use `pscale` to create a new branch.
## Usage

1. Run this locally, it will create a new branch off of `main`. The `switch` command will update a `.pscale.yml` file to track
that this is the branch you want to migrate.
1. Using pscale, create a new branch. This command will create a local `.pscale.yml` file. You should add it to your `.gitignore`.

```
pscale branch switch my-new-branch-name --database my-db-name --create --wait
```

**Tip:** In your database settings. Enable "Automatically copy migration data." Select "Rails" as the migration framework. This will auto copy your `schema_migrations` table between branches.

2. Once your branch is ready, you can then use the `psdb` rake task to connect to your branch and run `db:migrate`. The command will run against
the branch specified in your `.pscale.yml` file.
2. Run your schema migrations against the branch.

```
bundle exec rails psdb:migrate
Expand Down

0 comments on commit 3d1bf1e

Please sign in to comment.