Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create data migrations with Drizzle ORM?

I can use Drizzle kit to create and run schema changes to my database, but I don't know how to make data migrations with it. I've got experience from Django where you can manually create migration files which also support custom Python code. There you can run whatever code/SQL etc. to insert data in to the db. It also makes sure that the (data) migration is being run only once.

How can I achieve this with Drizzle? The drizzle-kit generate:pg checks only for schema changes so I can't add only data with it.

like image 686
Janne Avatar asked Jul 23 '26 23:07

Janne


1 Answers

Try this from the doc.

drizzle-kit generate:pg --custom
like image 66
陳智圓 Avatar answered Jul 26 '26 14:07

陳智圓