Skip to content

Commit a2311b6

Browse files
committed
docs: tweaks to prepare for v1
1 parent a3acdab commit a2311b6

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ And please give some love to our featured sponsors 🤩:
7272

7373
## Setup
7474

75-
`graphile-migrate` requires two databases: the first is your main database
76-
against which you perform development, the second is a "shadow" database which
75+
In development, `graphile-migrate` requires two databases in development: the
76+
first is your main development database, the second is a "shadow" database which
7777
is used by the system to test migrations are consistent. You should never
78-
interact with the "shadow" database directly.
78+
interact with the "shadow" database directly. In production you'll only have the
79+
main database.
7980

8081
All members of your team should run the same PostgreSQL version to ensure that
8182
the shadow dump matches for everyone (one way of achieving this is through
@@ -88,7 +89,7 @@ Tracking this file in git will allow you to easily see the changes that
8889
different migrations are making, so you can be sure you're making the changes
8990
you intend to. We recommend that you dump the shadow database as it will be
9091
unaffected by the iteration you've been applying to your development database
91-
(which may have come out of sync).
92+
(which may have come out of sync - see 'Drift' below).
9293

9394
### Getting started
9495

@@ -105,6 +106,13 @@ should be a superuser account connection to any **other** database (most
105106
PostgreSQL servers have a default database called `postgres` which is a good
106107
choice for this).
107108

109+
```bash
110+
export DATABASE_URL="postgres://appuser:password@localhost/myapp"
111+
export SHADOW_DATABASE_URL="postgres://appuser:password@localhost/myapp_shadow"
112+
113+
export ROOT_DATABASE_URL="postgres://postgres:postgres@localhost/postgres"
114+
```
115+
108116
> Your database URL is needed for most Graphile Migrate commands. The shadow
109117
> database URL is needed for the development-only commands `commit`, `uncommit`
110118
> and `reset`. The root database URL is needed to drop and recreate databases,
@@ -115,13 +123,6 @@ choice for this).
115123
> production (you only need the `graphile-migrate migrate` command in
116124
> production) unless you have actions that need them.
117125
118-
```bash
119-
export DATABASE_URL="postgres://appuser:password@localhost/myapp"
120-
export SHADOW_DATABASE_URL="postgres://appuser:password@localhost/myapp_shadow"
121-
122-
export ROOT_DATABASE_URL="postgres://postgres:postgres@localhost/postgres"
123-
```
124-
125126
Then run:
126127

127128
```bash
@@ -382,15 +383,6 @@ Options:
382383
<!-- CLI_USAGE_END -->
383384
<!-- prettier-ignore-end -->
384385

385-
## Library usage
386-
387-
It's possible to consume this module as a JavaScript library rather than via the
388-
CLI. There's no documentation on this, but the CLI code in `cli.ts` is very
389-
approachable.
390-
391-
ALPHA WARNING: internals are likely to change a lot, so expect breakage if you
392-
use library mode right now. CLI is more stable.
393-
394386
## Configuration
395387

396388
Configuration can be stored in a `.gmrc` JSON5 file (compatible with JSON and
@@ -721,6 +713,7 @@ make breaking changes to the programmatic API in patch releases (though this has
721713
not happened yet and is unlikely to happen without good reason). Should you need
722714
to use the programmatic API, please get in touch to encourage us to make this a
723715
supported interface ─ we'd love to know how you're using it!
716+
[src/cli.ts](src/cli.ts) is the best place to start.
724717
725718
The project as a whole is stable, but the approach is still "experimental", in
726719
particular:

0 commit comments

Comments
 (0)