drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.26k stars 623 forks source link

[FEATURE]: Documentation around conflicts #2132

Open StuartMorris0 opened 7 months ago

StuartMorris0 commented 7 months ago

Describe what you want

I cannot seem to find any documentation around how to handle conflicts in Drizzle, working on a codebase shared by many developers.

As an example, I have a PR that adds three new migrations. I need to rebase our main development branch which has since had 2 new migrations. In this case, I will have conflicts on the journal/meta snapshot files and migration files numbered the same (but with different full file names).

What should be the process for handling the conflicts? Should it be a manual process of editing the journal? What happens to the snapshots files which will differ? Is there internal tooling to help with this?

rkacenski commented 5 months ago

Just ran into this. In my case what worked was just deleting the migrations that were generated and regenerating with drizzle-kit generate:pg for example. Of course you have to rollback changes in your dev db as well, to test the newly generated migrations.