Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e154d52
DMS-938: Emit Project Schemas + Resource/Extension Tables + Abstract …
simpat-adam Feb 19, 2026
b60d436
Fix unit tests for trigger naming and column storage property changes
simpat-adam Feb 19, 2026
d7e314e
Address PR #840 code review findings
simpat-adam Feb 19, 2026
da1f21f
Address additional PR #840 code review findings
simpat-adam Feb 19, 2026
fcbfa72
Address PR #840 pending review findings
simpat-adam Feb 19, 2026
f6f8701
Consolidate DDL emitter table names and remove dead code
simpat-adam Feb 19, 2026
fa64445
Fix unit tests for missing identityJsonPaths and incompatible pass lists
simpat-adam Feb 19, 2026
ba150c7
Fix identity element mappings to use identity-part columns and skip d…
simpat-adam Feb 20, 2026
2dd1544
Correct golden test view name suffix and discriminator literal format
simpat-adam Feb 20, 2026
ab56730
Add DELETE event to DocumentStamping triggers for both PostgreSQL and…
simpat-adam Feb 20, 2026
e352634
Add no-op UPDATE value-diff gating for ReferentialIdentity and Abstra…
simpat-adam Feb 20, 2026
b48bbe2
Remove unused TriggerCreationPattern, FunctionCreationPattern, and Sq…
simpat-adam Feb 20, 2026
0336653
Use dialect RenderColumnDefinition for stored column definitions
simpat-adam Feb 20, 2026
75a95e1
Consolidate BuildRootIdentityProjectionColumns as delegation to Build…
simpat-adam Feb 20, 2026
930ae5f
Resolve trigger IdentityProjectionColumns to stored columns for MSSQL…
simpat-adam Feb 20, 2026
d64e0d5
Resolve propagation trigger target columns to stored columns for MSSQ…
simpat-adam Feb 20, 2026
58dd1eb
Add explicit CAST for abstract union view source columns when type di…
simpat-adam Feb 20, 2026
eca083e
Replace Debug.Assert with explicit throws in DDL emitter for Release-…
simpat-adam Feb 20, 2026
f188594
Add golden DDL fixture for key-unification with computed alias columns
simpat-adam Feb 20, 2026
ed04b9a
Replace MSSQL UPDATE(column) gating with value-diff worksets for Refe…
simpat-adam Feb 20, 2026
f2f3c21
Resolve propagation trigger source columns from table model instead o…
simpat-adam Feb 20, 2026
394ca06
Add guard and test for superclassIdentityJsonPath single-identity inv…
simpat-adam Feb 20, 2026
f562e19
Emit type-aware identity hash formatting for cross-engine parity
simpat-adam Feb 20, 2026
9cd18f0
Fix MSSQL boolean and datetime identity hash formatting for cross-eng…
simpat-adam Feb 20, 2026
ce3fc63
Use InvariantCulture for all numeric ToString calls in DDL emission
simpat-adam Feb 20, 2026
08deef3
Add fail-fast guard for missing union view columns and relax cross-pr…
simpat-adam Feb 20, 2026
e546dc5
Update data-model doc to reflect unbounded string support with nvarch…
simpat-adam Feb 20, 2026
320f02c
Consolidate single-quote escaping into SqlDialectBase.EscapeSingleQuote
simpat-adam Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions reference/design/backend-redesign/design-docs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,14 @@ Alignment note:
- SQL Server scalar types intentionally match Ed-Fi ODS SQL Server conventions (authoritative DDL uses `NVARCHAR`, `DATETIME2(7)`, `TIME(7)`, and `DATE`).

Rules:
- Scalar strings must have `maxLength`; missing `maxLength` is an error.
- Scalar strings should have `maxLength`. When `maxLength` is omitted, PostgreSQL emits `varchar` (unbounded) and SQL Server emits `nvarchar(max)`.
- Decimals must have `(totalDigits, decimalPlaces)` from `decimalPropertyValidationInfos`; missing info is an error.
- `date-time` values are treated as UTC instants at the application boundary. SQL Server storage uses `datetime2(7)` (no offset), so any incoming offset is normalized to UTC at write time.

| ApiSchema JSON schema | PostgreSQL type | SQL Server type |
| --- | --- | --- |
| `type: "string"` (no `format`) | `varchar(n)` | `nvarchar(n)` |
| `type: "string"` (no `format`, with `maxLength`) | `varchar(n)` | `nvarchar(n)` |
| `type: "string"` (no `format`, no `maxLength`) | `varchar` | `nvarchar(max)` |
| `type: "string", format: "date"` | `date` | `date` |
| `type: "string", format: "time"` | `time` | `time(7)` |
| `type: "string", format: "date-time"` | `timestamp with time zone` | `datetime2(7)` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ Provide an operational workflow for schema provisioning that matches the redesig

Authorization objects remain out of scope.

## Implementation Notes

### SQL Server Batch Separators

The emitted MSSQL DDL contains `GO` batch separators required for `CREATE OR ALTER` statements (triggers and views must be first in their T-SQL batch). `GO` is not valid T-SQL—it is a batch delimiter recognized by `sqlcmd` and SSMS.

- **DB-apply smoke tests**: Use `sqlcmd -b -i ...` which handles `GO` natively.
- **CLI `ddl provision`**: When executing via ADO.NET, the provisioner must split the script on `GO` lines and execute each batch separately.

## Stories

- `DMS-950` — `00-ddl-emit-command.md` — CLI: `ddl emit` (files + manifests)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,20 @@ public void It_should_create_or_alter_trigger()
_ddl.Should().Contain("CREATE OR ALTER TRIGGER [dms].[TR_Document_Journal]");
}

[Test]
public void It_should_emit_go_batch_separator_before_trigger()
{
// CREATE OR ALTER TRIGGER must be the first statement in a T-SQL batch
var triggerIndex = _ddl.IndexOf("CREATE OR ALTER TRIGGER");
var goIndex = _ddl.LastIndexOf("GO\n", triggerIndex);

goIndex.Should().BeGreaterOrEqualTo(0, "expected GO batch separator in DDL");
triggerIndex.Should().BeGreaterThan(goIndex);
// The GO should be immediately before the trigger (only whitespace between)
var between = _ddl.Substring(goIndex + 3, triggerIndex - goIndex - 3);
between.Trim().Should().BeEmpty("GO should immediately precede CREATE OR ALTER TRIGGER");
}

[Test]
public void It_should_attach_trigger_to_document_table()
{
Expand Down
Loading
Loading