Skip to content

Commit

Permalink
Merge branch 'master' of github.com:spacekookie/barrel
Browse files Browse the repository at this point in the history
  • Loading branch information
spacekookie committed Jun 18, 2018
2 parents 3a9dda4 + 6a8b51a commit 5be5153
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions guides/diesel-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
---

Using rust migrations (via `barrel`) with `diesel` is really simple. First, you need to add the `rust-migrations` to the features list for your `diesel` dependency. Note that currently `barrel` only supports postgres databases.
Using rust migrations (via `barrel`) with `diesel` is really simple. First, you need to add the `barrel-migrations` to the features list for your `diesel` dependency. Note that currently `barrel` only supports postgres databases.


```toml
[dependencies]
diesel = { version = "1.2", features = ["rust-migrations", "postgres"] }
diesel = { version = "1.2", features = ["barrel-migrations", "postgres"] }
# ...
```

Also make sure that you installed the `diesel_cli` with the `rust-migrations` feature flag as well
Also make sure that you installed the `diesel_cli` with the `barrel-migrations` feature flag as well

```bash
~ cargo install diesel_cli --features="rust-migrations"
~ cargo install diesel_cli --features="barrel-migrations"
```

From this point using `diesel` is very similar to how you normally use it. The only difference is that you should provide a `--type` flag when letting diesel generate a migration for you. Running migrations doesn't change.

```bash
~ diesel migration generate <name> --type="rust"
~ diesel migration generate <name> --type="barrel"
~ diesel migration run
```

Expand Down

0 comments on commit 5be5153

Please sign in to comment.