v1.0.0-beta.11
Breaking Changes📦 drizzle-ormView on GitHub →
⚠ 1 breaking✨ 2 features🐛 10 fixes🔧 5 symbols
Summary
This release standardizes timezone handling for PostgreSQL timestamps and significantly improves the stability and correctness of `drizzle-kit` introspection and schema generation, especially for MySQL and complex indexing scenarios. Caching behavior in Pg has also been made explicit.
⚠️ Breaking Changes
- The default behavior for caching in `Pg` has changed. Caching is now only applied when explicitly configured, whereas previous beta versions applied caching even without explicit configuration.
Migration Steps
- Review `Pg` configurations to explicitly enable caching if it was previously relied upon implicitly.
- If using introspection on MySQL, verify generated schemas where relation names previously collided with column names, as they have been renamed to append `Relation`.
✨ New Features
- Separated date and int-exclusive column methods from the common `pg builder` (specifically `.defaultNow()`, `.generatedAlwaysAsIdentity()`, and `.generatedByDefaultAsIdentity()`).
- Cyclic references in MySQL pull command are now generated as inline `.references((): AnyMySqlColumn => ...)` to prevent type errors for single-column references.
🐛 Bug Fixes
- Fixed issue where `drizzle-kit pull` generated incorrect schema for functional/computed indexes.
- Fixed issue where `drizzle-kit pull` generated invalid code for MySQL datetime columns with `DEFAULT CURRENT_TIMESTAMP ON UPDATE`.
- Fixed issue where `drizzle-kit push` attempted to delete non-public schemas by default (affecting `pscale_extensions`).
- Fixed issue where `stringify` could not serialize `BigInt`.
- Ensured commutativity for `MySQL` `now(N)` and `CURRENT_TIMESTAMP(N)`.
- Fixed MySQL pull command issue where a primary key was created when a column only had `UNIQUE` and `NOT NULL` constraints.
- Fixed MySQL pull command issue where `varbinary()` configuration was ignored in a ts schema file.
- Fixed MySQL pull command issue causing foreign key column duplication when constraint names matched across multiple databases.
- Fixed MySQL pull command issue resulting in inconsistent casing between `schema.ts` and `relations.ts`.
- Fixed relation name collisions during introspection: if a relation name matches a column name, the relation is now renamed to `<name>Relation`.