Skip to content

Commit 26967fb

Browse files
committed
docs: move payload script mention to top of migrations
1 parent 830d986 commit 26967fb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

docs/database/migrations.mdx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ desc: Payload features first-party database migrations all done in TypeScript.
88

99
Payload exposes a full suite of migration controls available for your use. Migration commands are accessible via the `npm run payload` command in your project directory.
1010

11+
Ensure you have an npm script called "payload" in your `package.json` file.
12+
13+
```json
14+
{
15+
"scripts": {
16+
"payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload"
17+
}
18+
}
19+
```
20+
1121
<Banner>
1222
Note that you need to run Payload migrations through the package manager that you are using, because Payload should not be globally installed on your system.
1323
</Banner>
@@ -42,18 +52,6 @@ All database adapters should implement similar migration patterns, but there wil
4252

4353
The `migrate` command will run any migrations that have not yet been run.
4454

45-
First, add a `payload` npm script to your `package.json`
46-
47-
```json
48-
{
49-
"scripts": {
50-
"payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload"
51-
}
52-
}
53-
```
54-
55-
This will allow you to access the migration commands via `npm run payload`. Adjust the `PAYLOAD_CONFIG_PATH` to point to your Payload config file if necessary.
56-
5755
```text
5856
npm run payload migrate
5957
```

0 commit comments

Comments
 (0)