You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating postgres migrations, drizzle is adding IF NOT EXISTS to the CREATE statement:
Ex:
CREATETABLEIF NOT EXISTS "rates" (
"id"textPRIMARY KEYNOT NULL,
"created_at"timestamp DEFAULT now() NOT NULL,
"updated_at"timestamp DEFAULT now() NOT NULL,
"deleted_at"timestamp,
);
As a result, name collisions on tables do not error, and the migration applies "successfully" despite no changes. This punts detection of the issue further down the line and not during development/deployment.
Expected behavior
I'd expect an error to be thrown and the migration aborted if I have table naming collisions. It's much easier to catch these mistakes early than waiting for errors like "unknown column YYYY in table XXXX" to be thrown from the app at runtime.
Environment & setup
postgres, create two tables with the same name
The text was updated successfully, but these errors were encountered:
What version of
drizzle-orm
are you using?0.30.10
What version of
drizzle-kit
are you using?0.21.2
Describe the Bug
When generating postgres migrations, drizzle is adding
IF NOT EXISTS
to theCREATE
statement:Ex:
As a result, name collisions on tables do not error, and the migration applies "successfully" despite no changes. This punts detection of the issue further down the line and not during development/deployment.
Expected behavior
I'd expect an error to be thrown and the migration aborted if I have table naming collisions. It's much easier to catch these mistakes early than waiting for errors like "unknown column YYYY in table XXXX" to be thrown from the app at runtime.
Environment & setup
postgres, create two tables with the same name
The text was updated successfully, but these errors were encountered: