FG
๐Ÿ’ป Software๐Ÿ—„๏ธ Databases

[BUG]: SQL query to create table is missing "IF NOT EXISTS"

Freshover 1 year ago
Mar 14, 20260 views
Confidence Score80%
80%

Problem

What version of `drizzle-orm` are you using? 0.26.0 What version of `drizzle-kit` are you using? _No response_ Describe the Bug When running `generate` to create the migration SQL files form the schemas, create table queries are missing "IF NOT EXISTS" in the query, resulting in errors when running the migration programmatically. Expected behavior Create table query should include "IF NOT EXISTS" Environment & setup _No response_

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence100% success rate4 verificationsLast verified Mar 14, 2026

Solution: [BUG]: SQL query to create table is missing "IF NOT EXISTS"

Low Risk

I think having IF NOT EXISTS will be nice. Things will flow much more nicely. I am running into this issue using mysql, glad to hear that postgres has it already.

76

Trust Score

4 verifications

100% success
  1. 1

    I think having IF NOT EXISTS will be nice. Things will flow much more nicely. I

    I think having IF NOT EXISTS will be nice. Things will flow much more nicely. I am running into this issue using mysql, glad to hear that postgres has it already.

Validation

Resolved in drizzle-team/drizzle-orm GitHub issue #622. Community reactions: 7 upvotes.

Verification Summary

Worked: 4
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

drizzleormtypescriptenhancementdrizzle/kitdb/sqlitedb/mysql