Change8

v1.0.0-beta.5

Breaking Changes
📦 drizzle-orm
3 breaking2 features🐛 5 fixes🔧 7 symbols

Summary

This release fixes several critical bugs across PostgreSQL, MSSQL, and MySQL, while introducing significant changes to how SQLite unique constraints and foreign keys are handled in drizzle-kit.

⚠️ Breaking Changes

  • SQLite UNIQUE constraints are now handled as uniqueIndex. This requires a specific naming convention: <table>_<column1>*_*<column2>_..._unique.
  • SQLite Foreign Key names defined in TS schema were previously ignored in SQL generation; new versions will now detect a diff if names exist in schema but not in DB, leading to table recreations.
  • SQLite columns added with references (onDelete/onUpdate) in previous versions may have been created without those parameters; the new version will trigger a table recreation to fix this state.

Migration Steps

  1. Run `drizzle-kit up` to upgrade snapshots to the new format.
  2. If using SQLite and you already used a `beta.x` version of `drizzle-kit up`, you may need to reset migrations or contact support.
  3. To avoid table recreations during `push` due to foreign key name mismatches in SQLite, remove explicit foreign key names from the TypeScript schema if they don't exist in the database.
  4. Ensure SQLite unique indexes follow the naming pattern: <table>_<column1>*_*<column2>_..._unique.

✨ New Features

  • Improved SQLite UNIQUE constraint management by replacing them with uniqueIndex to allow for dropping/modifying constraints.
  • Enhanced SQLite introspection to parse DDL for constraint names, falling back to default names if none are found.

🐛 Bug Fixes

  • Fixed 'type "serial" does not exist' error.
  • Fixed issue where jsonb default boolean literals generated 'truen' instead of 'true'.
  • Fixed incorrect syntax for MSSQL views.
  • Fixed MySQL 'blob' columns to work correctly with the Remote Query Bridge (RQB) mapper.
  • Fixed a bug where SQLite ADD COLUMN with references ignored onDelete/onUpdate parameters.

🔧 Affected Symbols

sqliteTableuniqueIndexforeignKeyblobjsonbdrizzle-kit updrizzle-kit push