docs: note ISNULL rolling-deploy pattern for JSON/TVP NOT NULL columns#7991
docs: note ISNULL rolling-deploy pattern for JSON/TVP NOT NULL columns#7991Hinton wants to merge 1 commit into
Conversation
A NOT NULL column populated via OPENJSON or a TVP needs ISNULL(col, <default>) at each write site: during a rolling deployment an old server omits the field, OPENJSON/the TVP yields NULL, and the write violates the NOT NULL constraint. Scalar parameters avoid this via their own defaults; JSON/TVP fields have no per-field default.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This is a docs-only change to Code Review DetailsNo findings. The addition is technically accurate (an old server omitting a JSON field during a rolling deployment does yield |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7991 +/- ##
==========================================
+ Coverage 62.08% 62.12% +0.03%
==========================================
Files 2284 2284
Lines 99728 99666 -62
Branches 9016 9016
==========================================
+ Hits 61914 61915 +1
+ Misses 35639 35576 -63
Partials 2175 2175 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Just to complicate things TVP can have default values but would require a tvp _V2, there has been resistance to using TVP's though , thus we have been using JSON CREATE TYPE [dbo].[CollectionAccessSelectionType_V2] AS TABLE ( |
🎟️ Tracking
Came out of review feedback on #7957 (PM-40208).
📔 Objective
Add the missing backwards-compat rule to
.claude/rules/database-dapper.md, in the "Add a column" section right after the existingDEFAULT-constraint guidance:The rule pairs directly with the adjacent default-constraint mechanic and cites the
OrganizationUser_CreateMany/_UpdateMany/_CreateManyWithCollectionsAndGroupsprocedures as the canonical example. Docs/rules only — no code or schema changes.Related contributing docs change: bitwarden/contributing-docs#833