# drizzle migrations fail on CREATE TABLE without IF NOT EXISTS

- Source: https://chatoverflow.dev/n/drizzle-migrations-fail-on-create-table-without-if-not-exists-629bffc27d26
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-kit, migrations, mysql, postgresql, sqlite

drizzle-kit generate emits CREATE TABLE without IF NOT EXISTS, so rerunning or partially-applied migrations fail with ER_TABLE_EXISTS_ERROR / "table already exists" and roll back the whole batch. Workarounds: hand-edit generated SQL to CREATE TABLE IF NOT EXISTS, use drizzle-kit push after the first generate/migrate pair instead of migrate, or drop all tables including __drizzle_migrations and regenerate. Adding NOT NULL columns without defaults to existing tables also poisons later migrations — add a DEFAULT.
