ITADN
drizzle-team/drizzle-orm

版本发布 8

1.0.0-beta.21v1.0.0-beta.21预发布
? · 2026-04-14

More fixes for the drizzle-kit migration process and commutativity checks - Adding a value to a PostgreSQL enum will no longer be treated as commutative - Enum values added in different leaves will now be merged properly

drizzle-kit@0.31.10
? · 2026-03-17

- Updated to `hanji@0.0.8` - native bun `stringWidth`, `stripANSI` support, errors for non-TTY environments - We've migrated away from `esbuild-register` to `tsx` loader, it will now allow to use `drizzle-kit` seamlessly with both `ESM` and `CJS` modules - We've also added native `Bun` and `Deno` launch support, which will not trigger `tsx` loader and utilise native `bun` and `deno` imports capabilities and faster startup times

v1.0.0-beta.9预发布
? · 2026-01-15

- Drizzle now has native `@effect/sql-pg` driver support That is a big milestone for Drizzle. We did rework our query builder chain and it supports both EffectLike and PromiseLike flows, we will gather feedback from the community and ship other dialects support - We did also rework(simplified) `PgColumn` type chain, it's now mostly decoupled from other dialects, it now has better type performance and simpler declaration chain. We did remove PgArray column recursive wrapper, every `PgColumn` now has dimensions property both in runtime and type chain for external usage like validation packages - We have 1 breaking API change too, postgres `.array()` is now not chainable, if you want to have multidimensional array it's now `.array('[][]')`,`.array('[][][]')`, etc. - Fixed lack of query result recalculation on pg dynamic update with joins - Switched `MySQL2` default client from `CallbackPool` to `Pool` - We've migrated away from `esbuild-register` to `tsx` loader, it will now allow to use drizzle-kit seamlessly with both ESM and CJS modules - We've also added native Bun and Deno launch support, which will not trigger tsx loader and utilise native bun and deno imports capabilities and faster startup times

v1.0.0-beta.8预发布
? · 2025-12-31

## `drizzle-seed` updates ## Bug fixes - [[BUG]: drizzle seed doesn't work with libSQL](https://github.com/drizzle-team/drizzle-orm/issues/3914) - [[BUG]: Seed UUIDs not compatible with Zod/v4](https://github.com/drizzle-team/drizzle-orm/issues/4551) - [[BUG]: drizzle seed generates invalid input value (number) for enum strings (pg)](https://github.com/drizzle-team/drizzle-orm/issues/4194) - [[BUG]: drizzle seed breaks serial sequence sync with Postgres serial type](https://github.com/drizzle-team/drizzle-orm/issues/3915) ## Features ### ignore column in refinements Now you can let drizzle-seed know if you want to ignore column during seeding. ```ts // schema.ts import { integer, pgTable, text } from "drizzle-orm/pg-core"; export const users = pgTable("users", { id: integer().primaryKey(), name: text().notNull(), age: integer(), photo: text(), }); ``` ```ts // index.ts import { drizzle } from "drizzle-orm/node-postgres"; import { seed } from "drizzle-seed"; import * as schema from "./schema.ts"; async function main() { const db = drizzle(process.env["DATABASE_URL"]!); await seed(db, schema).refine((f) => ({ users: { count: 5, columns: { name: f.fullName(), photo: false, // the photo column will not be seeded, allowing the database to use its default value. }, }, })); } main(); ``` ## Improvements ### Added `min`, `max` parameters to `time` generator ```ts await seed(db, { timeTable: schema.timeTable }).refine((funcs) => ({ timeTable: { count, columns: { time: funcs.time({ min: "13:12:13", max: "15:12:13", }), }, }, })); ``` ### Added `min`, `max` parameters to `timestamp` generator ```ts await seed(db, { timestampTable: schema.timestampTable }).refine((funcs) => ({ timestampTable: { count, columns: { timestamp: funcs.timestamp({ min: "2025-03-07 13:12:13.123Z", max: "2025-03-09 15:12:13.456Z", }), }, }, })); ``` ### Added `min`, `max` parameters to `datetime` generator ```ts await seed(db, { datetimeTable: schema.datetimeTable }).refine((funcs) => ({ datetimeTable: { count, columns: { datetime: funcs.datetime({ min: "2025-03-07 13:12:13Z", max: "2025-03-09 15:12:13Z", }), }, }, })); ``` ### PostgreSQL sequences updating after seed `drizzle-seed` iterates through each column in a table, selects columns of type smallint, integer, bigint, smallserial, serial, or bigserial, and (if a sequence exists) updates it to the column’s maximum seeded value. ```sql select setval(pg_get_serial_sequence('"schema_name"."table_name"', 'column_name'), 3, true); ``` ## Breaking changes ### `uuid` generator was changed and upgraded to v4 ```ts await seed(db, { table }).refine((f) => ({ table: { columns: { // AA97B177-9383-4934-8543-0F91A7A02836 // ^ // 1 // the digit at position 1 is always one of '8', '9', 'A' or 'B' column1: f.uuid(), } } })) ``` **Reason for upgrade** UUID values generated by the old version of the `uuid` generator fail Zod’s v4 UUID validation. example ```ts import { createSelectSchema } from 'drizzle-zod'; import { seed } from 'drizzle-seed'; await seed(db, { uuidTest: schema.uuidTest }, { count: 1 }).refine((funcs) => ({ uuidTest: { columns: { col1: funcs.uuid() } } }) ); const uuidSelectSchema = createSelectSchema(schema.uuidTest); const res = await db.select().from(schema.uuidTest); // the line below will throw an error when using old version of uuid generator uuidSelectSchema.parse(res[0]); ``` **Usage** ```ts await seed(db, schema); // or explicit await seed(db, schema, { version: '4' }); ``` **Switch to the old version** The previous version of `uuid` generator is v1. ```ts await seed(db, schema, { version: '1' }); ``` To use the v2 generators while maintaining the v1 `uuid` generator: ```ts await seed(db, schema, { version: '2' }); ``` To use the v3 generators while maintaining the v1 `uuid` generator: ```ts await seed(db, schema, { version: '3' }); ```

v.1.0.0-beta.7预发布
? · 2025-12-31

**Bug fixes** - [[BUG]: Drizzle-kit does not consider prefix when generating migrations](https://github.com/drizzle-team/drizzle-orm/issues/5143) - [[BUG]: drizzle-kit push removes migration table (doesn't recognize custom migration table name)](https://github.com/drizzle-team/drizzle-orm/issues/5083) - [[BUG]:Drizzle pull generate invalid autosummarize](https://github.com/drizzle-team/drizzle-orm/issues/5196) - [[BUG]: drizzle-kit pull generated wrong syntax](https://github.com/drizzle-team/drizzle-orm/issues/5193) - [[BUG]: [drizzle-kit] MSSQL - Foreign Key Constraints Generated via drizzle-kit generate are not scoped to the Correct Schema](https://github.com/drizzle-team/drizzle-orm/issues/5182) - [[BUG]: findFirst fails with TypeError: null is not an object (evaluating 'row[selectionItem.key]') if no results are found](https://github.com/drizzle-team/drizzle-orm/issues/5189) - **Push** command now respects a custom migration schema or/and table from ***drizzle.config*** and ignores them during the execution

v1.0.0-beta.6预发布
? · 2025-12-25

## Bug fixes - [[BUG]: 1.0.0-beta.2 - drizzle-kit push does consider json (jsonb) key order relevant](https://github.com/drizzle-team/drizzle-orm/issues/5119) - [[BUG]: drizzle-kit pull generates string instead of sql statement for default value](https://github.com/drizzle-team/drizzle-orm/issues/5093) - [[BUG]: Failed schema with d1 table](https://github.com/drizzle-team/drizzle-orm/issues/3590) - [[BUG]: drizzle-kit: push runs already applied migration](https://github.com/drizzle-team/drizzle-orm/issues/3844) - [[BUG]: Drizzle-Kit detects change when Composite Primary Key Columns are in different order than in schema definition](https://github.com/drizzle-team/drizzle-orm/issues/3103) - [[BUG]: drizzle-kit push always shows columns with custom types as changed even tho the type didn't change](https://github.com/drizzle-team/drizzle-orm/issues/3047);

1.0.0-beta.5v1.0.0-beta.5预发布
? · 2025-12-23

## Bug fixes - [[BUG]: error: type "serial" does not exist](https://github.com/drizzle-team/drizzle-orm/issues/2183) - [[BUG]: jsonb default with boolean literals gets generated truen instead of true](https://github.com/drizzle-team/drizzle-orm/issues/5149) - [[BUG]: MSSQL view incorrect syntax](https://github.com/drizzle-team/drizzle-orm/issues/5113) - Fixed `blob` columns in MySQL to work properly with RQB mapper ## Changes to SQLite `drizzle-kit up` command > Important! > > If you were already using SQLite in any `beta.x` version and have used the `drizzle-kit up` command, you will not receive the latest `up` changes from this release. If you are unable to reset migrations and start from scratch, you will need to contact us for support with upgrading ### What was changed? #### Handling of UNIQUE constraints in SQLite In the new version `drizzle-kit` handles `UNIQUE` constraints. This decision was made because when a unique constraint is created it cannot be removed, whereas an index can be dropped Previous version of Drizzle-Kit always created `.unique()` as a `uniqueIndex` and stored it in the snapshot that way. Because of this during an up we lack of sufficient information and if a user used `.unique()` an upped will generate a diff on generate and push **Solution:** We are replacing all unique constraints with `uniqueIndex` `uniqueIndex` requires a name and the name must follow this format: `<table>_<column1>*_*<column2>_..._unique` #### Foreign key name handling in the old(pre 1.0) drizzle-kit The old `drizzle-kit` did not handle foreign key names when generated sql migrations. A foreign key name could be defined in the ts schema, but it was not passed through when generating sql ```tsx export const table = sqliteTable("table", { column1: integer(), column2: integer()}, (t) => [ foreignKey({ name: "name", columns: [t.column1], foreignColumns: [t.column2], }), ] ); // no name provided FOREIGN KEY (`timest`) REFERENCES `b`(`timest1`) ON UPDATE no action ON DELETE no action ``` On `introspect` new drizzle-kit parses ddl to find constraint name, if no name found - use default name After running `drizzle-kit up` the first `push` command will result in a diff that recreates the table (no name from db, but there is name in ts schema). To avoid this foreign key names should be removed - in that case no diff will be generated. `drizzle-kit generate` command will behave as expected, no changes needed. #### Bug in the old drizzle-kit related to foreign keys If you add a column to an existing table that has a foreign key and specify `onDelete` or `onUpdate`, column will be added with the foreign key, but without those parameters ```tsx export const table = sqliteTable("table", { column1: integer() }); export const table = sqliteTable("table", { column1: integer(), column2: integer().references((): AnySQLiteColumn => table.column1, { onDelete: "set null", onUpdate: "set default" }) }); ALTER TABLE `table` ADD `column2` integer REFERENCES table(column1); ``` There is no way to fix this in the old snapshot. It led to table recreation during subsequent `push` operations (in the pre-v1.0 drizzle-kit version) New `drizzle-kit` will recreate table after push command with the correct SQL. When using `generate` command, no diffs will appear, but the actual database state may differ

drizzle-kit@0.31.7v0.31.7
? · 2025-11-17

### Bug fixes - [[BUG]: Drizzle Kit push to Postgres 18 produces unecessary DROP SQL when the schema was NOT changed](https://github.com/drizzle-team/drizzle-orm/issues/4944)