drizzle-kit@0.31.0
drizzle-team/drizzle-ormdrizzle-kit@0.31.0Apr 15, 2025by github-actions[bot]
AI Summary
This release improves enum DDL operations in PostgreSQL by properly handling default expressions when changing column data types, and upgrades esbuild to the latest version (0.25.2). It also includes bug fixes for malformed array literals, json/jsonb deep field indexes, and addresses a CVE in the previous esbuild version.
Key Highlights
- Enhanced enum DDL to properly handle default expressions when changing column types from enum to text and back
- Upgraded esbuild to version 0.25.2 to address CVE-2024-24790
- Fixed bug with malformed array literals in PostgreSQL
- Fixed error when pulling indexes from tables with json/jsonb deep field indexes
New Features
- Improved enum DDL handling with proper ::text and ::<new_enum> expression defaults
- esbuild version upgrade to 0.25.2
Full Release Notes
## Features and improvements ### Enum DDL improvements For situations where you drop an `enum` value or reorder values in an `enum`, there is no native way to do this in PostgreSQL. To handle these cases, `drizzle-kit` used to: - Change the column data types from the enum to text - Drop the old enum - Add the new enum - Change the column data types back to the new enum However, there were a few scenarios that weren’t covered: `PostgreSQL` wasn’t updating default expressions for columns when their data types changed Therefore, for cases where you either change a column’s data type from an `enum` to some other type, drop an `enum` value, or reorder `enum` values, we now do the following: - Change the column data types from the enum to text - Set the default using the ::text expression - Drop the old enum - Add the new enum - Change the column data types back to the new enum - Set the default using the ::<new_enum> expression ### `esbuild` version upgrade For `drizzle-kit` we upgraded the version to latest (`0.25.2`), thanks @paulmarsicloud ## Bug fixes - [[BUG]: Error on Malformed Array Literal](https://github.com/drizzle-team/drizzle-orm/issues/2715) - thanks @Kratious - [[BUG]: Postgres drizzle-kit: Error while pulling indexes from a table with json/jsonb deep field index](https://github.com/drizzle-team/drizzle-orm/issues/2744) - thanks @Kratious - [goog-vulnz flags CVE-2024-24790 in esbuild 0.19.7](https://github.com/drizzle-team/drizzle-orm/issues/4045)