Can I Skip Code-Based Migration and Just Use drizzle-kit migrate?
I’m using Drizzle ORM and noticed there are two ways to run migrations: using the drizzle-kit migrate command and the code-based approach (migrate function).
Do I need both, or can I rely solely on the drizzle-kit migrate command to handle my database migrations?
What even is the difference between the two?
Thanks for the help
6 Replies
just use the cli, it uses the migrator under the hood
saves you from writing a migrator file
Thats what im currently using.
Just generally curious whats the use case for the code-based approach.
its for running migrations programmatically if you have logic that needs that
watched some tutorials they all seem to use the code-based migration approach.
I thought i was doing something wrong lol.
The code-based migration comes handy when setting up integration tests. Both approaches are valid
Oh that make more sense! Thanks!