You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,23 @@ All notable changes to the MS SQL Manager extension will be documented in this f
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.19.9] - 2026-05-08
9
+
10
+
### Fixed
11
+
12
+
-**Script ROW DELETE — Composite foreign key WHERE clause now generates valid SQL**
13
+
- Tables with composite foreign keys (e.g. `(MemberId, ProjectId, Role)`) previously generated invalid T-SQL: `WHERE [MemberId, ProjectId, Role] IN (SELECT [MemberId, ProjectId, Role] ...)` — SQL Server does not support multi-column `IN` expressions.
14
+
- Fix: FK columns are now traced through the dependency chain back to the root table's PK. When a column in the dependent table maps to the root PK (e.g. `ProjectMemberToolCapabilities.MemberId` → `Members.Id`), a simple direct `WHERE [MemberId] = @Target_Id` is generated.
15
+
- Level-0 dependencies (tables directly referencing the target) use simple direct `WHERE [col] = @Target_X` comparison.
16
+
- Higher-level dependencies where no FK column traces to root PK fall back to `WHERE EXISTS (...)` with correlated subqueries (composite FK) or `WHERE [col] IN (SELECT ...)` (single-column FK).
17
+
- Extracted reusable `traceColumnsToRoot`, `buildTargetFilter` and `generateDependentDeletes` utilities into `src/utils/deleteScriptGenerator.ts` for testability.
18
+
19
+
### Tests
20
+
21
+
- Added **21** unit tests for `deleteScriptGenerator`: `buildTargetFilter` (7 tests), `generateDependentDeletes` (10 tests), and `traceColumnsToRoot` (4 tests) covering direct column tracing, composite FKs, multi-level nesting, deduplication, ordering, circular reference safety, and the original regression case.
0 commit comments