src/content/docs/faq.mdx
import Callout from '@mdx/Callout.astro';
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
push and generate works for PostgreSQL indexesExample
index().on(table.id, table.email) // will work well and name will be autogeneretaed
index('my_name').on(table.id, table.email) // will work well
// but
index().on(sql`lower(${table.email})`) // error
index('my_name').on(sql`lower(${table.email})`) // will work well
.on() and .using().where() statements.op() on columnsIf you are using push workflows and want to change these fields in the index, you would need to:
For the generate command, drizzle-kit will be triggered by any changes in the index for any property in the new drizzle indexes API, so there are no limitations here.