docs icon indicating copy to clipboard operation
docs copied to clipboard

update doc about creating a migration (an empty migration to be more precise)

Open kasir-barati opened this issue 1 year ago • 1 comments

Hey guys,

I was wandering around the doc to find out how can I create an empty migration and then I ended up herje under options section I read that it says:

Creates a new migration based on the changes in the schema but does not apply that migration. Run migrate dev to apply migration.

For --create-only flag. So I though I cannot use it for creating an empty migration file. Then I read this Stackoverflow Q&A and tried it. Surprisingly they were right about it; you can create an empty migration without the need to have anything changed in schema.prisma.

Thus I think it is time to revise it to be more accurate. Maybe something like this would do the trick: "Creates a new migration based on the changes in the schema, or just creating an empty one when your schema has not change. Note that this does not apply that migration automatically. Run migrate dev to apply migration."

Any comment/idea/feedback?

Best of luck.

kasir-barati avatar Aug 07 '24 08:08 kasir-barati

@kasir-barati After making changes in the databse or prisma schema , user has to run the command npx run dev to update the prisma schema everytime to keep the database in sync with the model , Do you want that to update in the migration section ?

AdityaSrivastava185 avatar Sep 22 '24 21:09 AdityaSrivastava185

Hey @kasir-barati, thanks a lot for raising this! Fully agree that the current phrasing was unclear and have created this PR: https://github.com/prisma/docs/pull/6386

Does this make it more clear to you?

nikolasburk avatar Nov 04 '24 15:11 nikolasburk

@AdityaSrivastava185 no just the wording. No functionality change.

kasir-barati avatar Nov 04 '24 19:11 kasir-barati