# Issues4

64 files changed, +1450 −135 in drizzle-team/drizzle-orm. The author left no usable description, so this brief describes structure only.

| | |
| --- | --- |
| Status | MERGED · CHECKS FAILING |
| Source | github:drizzle-team/drizzle-orm#6069 |
| Original | https://github.com/drizzle-team/drizzle-orm/pull/6069 |
| Workspace | Showcase |
| Tags | github, code, typescript, docs |

## What it does

**The change is spread across 64 files in 3 areas, with no single file dominating.**

64 files changed across 3 areas of drizzle-team/drizzle-orm, 1450 added and 135 removed.

The author left no description on this change, so nothing below comes from their account of it.

**Diagram: Where the change landed. Node size is not to scale; the line counts are exact.**

- drizzle-orm (64 files, 1585 lines) [accent]
- Tests (29 files, 1298 lines) [good]
- Source (33 files, 273 lines) [accent]
- Docs (2 files, 14 lines) [neutral]
- sqlite-constraints.test.ts (+198 −0) [neutral]
- drizzle-orm -> Tests
- drizzle-orm -> Source
- drizzle-orm -> Docs
- Tests -> sqlite-constraints.test.ts : heaviest

- **Heaviest file.** drizzle-kit/tests/sqlite/sqlite-constraints.test.ts, +198 −0, which is 12% of the change.
- **Tests moved with it.** 29 test files changed alongside 33 source files.
- **CI is red.** 3 checks are failing, so the change is not currently in a mergeable state.

## How it works

**The largest single edit is in sqlite-constraints.test.ts.**

Quoted verbatim from the diff. This is the biggest hunk by changed lines, which is where a reviewer's attention usually belongs first.

**Diagram: Source files matched to test files by filename. A name-based match, so treat it as a prompt to look rather than as proof.**

- NO TEST CHANGED (28)
  - session.ts (+10 −10) [bad]
  - session.ts (+10 −10) [bad]
  - introspect.ts (+8 −8) [bad]
  - typescript.ts (+11 −5) [bad]
  - grammar.ts (+11 −4) [bad]
- TEST CHANGED TOO (5)
  - tables.ts (+12 −0) [good]
  - tables.ts (+12 −0) [good]
  - tables.ts (+12 −0) [good]
  - tables.ts (+12 −0) [good]
  - tables.ts (+12 −0) [good]

```typescript
@@ -388,6 +389,117 @@ test('unique #9. rename unique. 3rd without + with name', async () => {
 	expect(pst).toStrictEqual(st0);
 });
 
+// https://github.com/drizzle-team/drizzle-orm/issues/6060
+test('unique #8. rename unique. 3rd param with name', async () => {
+	const from = {
+		users: sqliteTable('users', {
+			name: text(),
+		}, (t) => [unique('unique_name').on(t.name)]),
+	};
+	const to = {
+		users: sqliteTable('users', {
+			name: text(),
+		}, (t) => [unique('unique_name2').on(t.name)]),
+	};
+
+	const { sqlStatements: st } = await diff(from, to, []);
+
+	await push({ db, to: from });
+	const { sqlStatements: pst } = await push({
+		db,
```

_drizzle-kit/tests/sqlite/sqlite-constraints.test.ts, +198 −0. The largest hunk in the largest file._

## File map

**Every file this change touches, heaviest first.**

Role is inferred from the path and risk from the path and the line count. Neither was read from the code.

| File | Role | Change | Risk |
| --- | --- | --- | --- |
| `drizzle-kit/tests/sqlite/sqlite-constraints.test.ts` | test coverage | modified, +198 −0 | low |
| `integration-tests/tests/pg/common-pt1.ts` | test coverage | modified, +118 −23 | low |
| `integration-tests/tests/bun/bun-sql.test.ts` | test coverage | modified, +137 −2 | low |
| `drizzle-kit/tests/postgres/pull.test.ts` | test coverage | modified, +112 −0 | low |
| `drizzle-kit/tests/sqlite/sqlite-columns.test.ts` | test coverage | modified, +102 −2 | low |
| `drizzle-kit/tests/postgres/pg-tables.test.ts` | test coverage | modified, +80 −1 | low |
| `drizzle-kit/tests/postgres/pg-columns.test.ts` | test coverage | modified, +68 −0 | low |
| `drizzle-kit/tests/cockroach/enums.test.ts` | test coverage | modified, +58 −1 | low |
| `integration-tests/tests/pg/common-rqb.ts` | test coverage | modified, +58 −1 | low |
| `drizzle-kit/tests/postgres/pg-constraints.test.ts` | test coverage | modified, +47 −0 | low |
| `integration-tests/tests/mssql/mssql.test.ts` | test coverage | modified, +40 −0 | low |
| `drizzle-kit/tests/mssql/pull.test.ts` | test coverage | modified, +35 −0 | low |
| `drizzle-kit/tests/mysql/mysql-enum.test.ts` | test coverage | modified, +35 −0 | low |
| `integration-tests/tests/mysql/mysql-common-6.ts` | test coverage | modified, +33 −0 | low |
| `drizzle-kit/tests/postgres/pg-checks.test.ts` | test coverage | modified, +25 −1 | low |
| `drizzle-kit/tests/sqlite/pull.test.ts` | test coverage | modified, +24 −0 | low |
| `drizzle-kit/tests/cockroach/pull.test.ts` | test coverage | modified, +22 −0 | low |
| `drizzle-orm/src/mysql2/session.ts` | application code | modified, +10 −10 | low |
| `drizzle-orm/src/singlestore/session.ts` | application code | modified, +10 −10 | low |
| `drizzle-kit/tests/postgres/pg-enums.test.ts` | test coverage | modified, +19 −0 | low |
| `drizzle-kit/src/dialects/cockroach/introspect.ts` | test coverage | modified, +8 −8 | low |
| `drizzle-kit/src/dialects/sqlite/typescript.ts` | application code | modified, +11 −5 | low |
| `drizzle-kit/src/dialects/postgres/grammar.ts` | application code | modified, +11 −4 | low |
| `drizzle-kit/tests/mysql/pull.test.ts` | test coverage | modified, +15 −0 | low |

## Receipts

**Where each number above comes from.**

All of it is arithmetic over the file list and the check results, so it can be recomputed from the source.

- **Claim.** Repeated block: 2 occurrences.
  - Evidence: orders: sqliteTable(
'orders',
{
  - Where: drizzle-kit/tests/sqlite/sqlite-constraints.test.ts
- **Claim.** Comments restating the code: 7 occurrences.
  - Evidence: // strict: true, // removed. strict by def for now
// strict: true, // removed. strict by def for now
  - Where: drizzle-kit/tests/other/cli-migrate.test.ts
- **Claim.** 64 files changed, +1450 −135.
  - Evidence: drizzle-kit/tests/sqlite/sqlite-constraints.test.ts (+198 −0); integration-tests/tests/pg/common-pt1.ts (+118 −23); integration-tests/tests/bun/bun-sql.test.ts (+137 −2)
  - Where: https://github.com/drizzle-team/drizzle-orm/pull/6069
- **Claim.** sqlite-constraints.test.ts carries 12% of the changed lines.
  - Evidence: 198 of 1585 changed lines
  - Where: drizzle-kit/tests/sqlite/sqlite-constraints.test.ts
- **Claim.** It arrived as 14 commits.
  - Evidence: fix sqlite add_column with reference
  - Where: commit d4839c0
- **Claim.** CI reports 3 failing of 30.
  - Evidence: run-feature / kit:postgres18
  - Where: CI check: run-feature / kit:postgres18

## Where to attack

**What the shape of this diff suggests looking at first.**

These come from structure alone: which areas were touched, what was not touched alongside them, and what CI says. None of them is a judgement about the code.

- **run-feature / kit:postgres18 is failing** (high)
  - No summary was published for this check.
  - Mitigation: Read the check output before anything else here matters.
- **run-feature / int:mysql is failing** (high)
  - No summary was published for this check.
  - Mitigation: Read the check output before anything else here matters.

## Merge order

**A reading order for the review, not a deployment plan.**

Ordered by how expensive each part is to get wrong, which is a structural property rather than an informed one.

1. **Read the failing check first.** run-feature / kit:postgres18 is red. Everything else is provisional until that is understood.
2. **Then sqlite-constraints.test.ts.** The largest single file in the change, +198 −0.
3. **Finish with the tests.** 29 test files changed. Reading them last tells you what the author believed they were changing.

## What this brief could not check

- No language model read this change. Every statement here is computed from file paths, line counts, and CI status, so it describes the shape of the diff and not what the diff means.
