FAQ & Troubleshooting
Should I use generate
or push
?
Those are logically 2 different commands. generate
is used to create an sql file together with additional
information needed for drizzle-kit
(or any other migration tool).
After generating those migrations, they won’t be applied to a database. You need to do it in the next step. You can read more about it here
On the other hand, push
doesn’t need any migrations to be generated. It will
simply sync your schema with the database schema. Please be careful when using it;
we recommend it only for local development and local databases. To read more about it, check out drizzle-kit push
Troubleshooting
Why aren’t my CLI options being read by drizzle-kit?
Drizzle Kit has a current set of priorities for reading config options:
- If there is a
drizzle.config
file, read from it. - If there is no
drizzle.config
file, check for the--config
option in the CLI. - If no
--config
option was found, use CLI options; otherwise, read from a defined config.
If you specify both config parameters and CLI options, an error will be thrown, and you should use either CLI options or have a config file defined in your project.