Skip to content

Commit 2308379

Browse files
byapparovclaude
andcommitted
fix(deps): bump drizzle-orm/drizzle-kit to 1.0.0-beta.20 (GHSA-gpj5-g38j-94v9)
1.0.0-beta.20 is the first drizzle release patched for GHSA-gpj5-g38j-94v9. It tracks applied migrations by name instead of the latest created_at, so the migration journal (dev loader and the bundled AICTRL_MIGRATIONS) now carries each migration's directory name. Databases from aictrl <= 0.5.1 are upgraded in place: drizzle adds name/applied_at columns and backfills names by matching created_at to the migration timestamp, so applied migrations are not re-run. Database.transaction now rejects async callbacks at the type level, as the new drizzle types require for sync drivers. Tests open a database laid out exactly as 0.5.1 wrote it (fully and partially migrated) and a fresh one, and the json-migration tests reuse Database.migrations() instead of a copy of the loader. Closes #61 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015nwvfUHdM3bgMgD9Zpz7Mj
1 parent d1fb902 commit 2308379

9 files changed

Lines changed: 157 additions & 103 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- **Messages written in the same millisecond keep their order** — Reading a session's messages now breaks `time_created` ties by message ID. Before, messages written in the same millisecond came back oldest first. A compaction writes its request, its summary and the continue message in quick succession, so the prompt loop could miss the finished summary and compact again, sending an extra model request. (#200)
88

9+
### Security
10+
11+
- **drizzle-orm 1.0.0-beta.20** — `drizzle-orm` and `drizzle-kit` move from `1.0.0-beta.12-a5629fb` to `1.0.0-beta.20`, the first release patched for GHSA-gpj5-g38j-94v9 (SQL injection through improperly escaped SQL identifiers; the CLI never passed untrusted identifiers to drizzle). Existing databases open as before: on first start drizzle adds `name` and `applied_at` columns to `__drizzle_migrations` and fills in the names of the migrations already applied, without running them again. The upgraded database still opens with 0.5.1. (closes #61)
12+
913
## 0.5.1 (2026-10-18)
1014

1115
### Fixes

‎bun.lock‎

Lines changed: 7 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"@tailwindcss/vite": "4.1.11",
3535
"diff": "8.0.2",
3636
"dompurify": "3.3.1",
37-
"drizzle-kit": "1.0.0-beta.12-a5629fb",
38-
"drizzle-orm": "1.0.0-beta.12-a5629fb",
37+
"drizzle-kit": "1.0.0-beta.20",
38+
"drizzle-orm": "1.0.0-beta.20",
3939
"ai": "5.0.124",
4040
"fuzzysort": "3.1.0",
4141
"luxon": "3.6.1",

‎packages/cli/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"@types/turndown": "5.0.5",
6565
"@types/yargs": "17.0.33",
6666
"@typescript/native-preview": "catalog:",
67-
"drizzle-kit": "1.0.0-beta.12-a5629fb",
68-
"drizzle-orm": "1.0.0-beta.12-a5629fb",
67+
"drizzle-kit": "1.0.0-beta.20",
68+
"drizzle-orm": "1.0.0-beta.20",
6969
"typescript": "catalog:",
7070
"why-is-node-running": "3.2.2",
7171
"zod-to-json-schema": "3.24.5"
@@ -84,7 +84,7 @@
8484
"ajv": "8.18.0",
8585
"decimal.js": "10.5.0",
8686
"diff": "catalog:",
87-
"drizzle-orm": "1.0.0-beta.12-a5629fb",
87+
"drizzle-orm": "1.0.0-beta.20",
8888
"fuzzysort": "3.1.0",
8989
"glob": "13.0.5",
9090
"gray-matter": "4.0.3",
@@ -198,6 +198,6 @@
198198
}
199199
},
200200
"overrides": {
201-
"drizzle-orm": "1.0.0-beta.12-a5629fb"
201+
"drizzle-orm": "1.0.0-beta.20"
202202
}
203203
}

‎packages/cli/script/build.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { $ } from "bun"
44
import fs from "fs"
55
import path from "path"
66
import { fileURLToPath } from "url"
7+
import type { MigrationsJournal } from "drizzle-orm/migrator"
78

89
const __filename = fileURLToPath(import.meta.url)
910
const __dirname = path.dirname(__filename)
@@ -28,7 +29,7 @@ const migrationDirs = (
2829
.map((entry) => entry.name)
2930
.sort()
3031

31-
const migrations = await Promise.all(
32+
const migrations: MigrationsJournal = await Promise.all(
3233
migrationDirs.map(async (name) => {
3334
const file = path.join(dir, "migration", name, "migration.sql")
3435
const sql = await Bun.file(file).text()
@@ -43,7 +44,8 @@ const migrations = await Promise.all(
4344
Number(match[6]),
4445
)
4546
: 0
46-
return { sql, timestamp }
47+
// drizzle tracks applied migrations by name; see Database.migrations().
48+
return { sql, timestamp, name }
4749
}),
4850
)
4951
console.log(`Loaded ${migrations.length} migrations`)

0 commit comments

Comments
 (0)