diff --git a/apps/docs/content/docs/cli/db-migrate.mdx b/apps/docs/content/docs/cli/db-migrate.mdx index a16b14917fd..8483b711008 100644 --- a/apps/docs/content/docs/cli/db-migrate.mdx +++ b/apps/docs/content/docs/cli/db-migrate.mdx @@ -84,12 +84,12 @@ You edited the contract, ran `contract emit`, and then ran `db migrate`. The tar ```text ✘ [MIGRATION.PATH_UNREACHABLE] Current contract has no planned migration path - why: No migration edge connects the current state "" to the target "" in contract space "app". -→ Plan the missing edge: prisma migration plan --from --to --name -→ Apply it: prisma db migrate --to + why: No migration edge connects "" to the target "" in contract space "app". +→ Plan the missing edge: prisma migration plan --from --name +→ Apply it: prisma db migrate ``` -Do not run the commands as the error prints them. Its [`migration plan`](/cli/migration-plan) command fails with `MIGRATION.REF_NOT_FOUND`, because `--to` only accepts a contract that a migration already produces, and its `db migrate --to` command fails with `MIGRATION.PATH_UNREACHABLE` again until the migration is planned. Run `migration plan` without `--to`, with the current hash from the error and a name for the migration, then apply the result. The first seven characters of the hash are enough: +Run the two commands the error prints. Put `npx` in front of each, and give the migration a name in place of ``. The error repeats the `--config` you passed, and it ends the second command with `--db ` if you passed `--db`, so put your connection string there. The first seven characters of the hash are enough: ```npm npx prisma migration plan --from --name add-phone @@ -100,7 +100,7 @@ Without `--to`, `migration plan` plans up to the contract you just emitted. ### You passed `--to` with an earlier migration -`db migrate` cannot run a migration backwards. To take the database back, you plan a new migration that undoes the later ones. The error is the same as above. Here the two commands it suggests work as printed, because a migration already produces each of the two states. Put `npx` in front of each: +`db migrate` cannot run a migration backwards. To take the database back, you plan a new migration that undoes the later ones. The error's first lines are the same as above. Here its first command names the target with `--to`, because a migration already produces that state, and its second command is the `db migrate` you ran. Put `npx` in front of each: ```npm npx prisma migration plan --from --to --name undo-phone