Skip to content

Commit abb5d8f

Browse files
docs: document the dev mode warning and --force-accept-warning for migrate
1 parent 8f8808e commit abb5d8f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎docs/database/migrations.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ The `migrate` command will run any migrations that have not yet been run.
120120
npm run payload migrate
121121
```
122122

123+
If Payload has pushed schema changes to the database in development mode (Postgres and SQLite), it records a `dev` migration with a batch of `-1` in the `payload_migrations` table. When that row exists, `migrate` warns that data loss may occur and asks for confirmation before running any migrations. This prompt needs an interactive terminal, so in CI or other non-interactive environments it will wait indefinitely unless you pass the flag below.
124+
125+
Flags:
126+
127+
- `--force-accept-warning`: accepts the dev mode warning and runs the migrations without prompting. Only use this when you are sure the pushed schema is compatible with your migrations.
128+
123129
### Create
124130

125131
Create a new migration file in the migrations directory. You can optionally name the migration that will be created. By

0 commit comments

Comments
 (0)