diff --git a/reference/design/backend-redesign/design-docs/data-model.md b/reference/design/backend-redesign/design-docs/data-model.md index 8384acfb6..938b44a28 100644 --- a/reference/design/backend-redesign/design-docs/data-model.md +++ b/reference/design/backend-redesign/design-docs/data-model.md @@ -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)` | diff --git a/reference/design/backend-redesign/design-docs/ddl-generation.md b/reference/design/backend-redesign/design-docs/ddl-generation.md index 91ada46ca..34fbb45d9 100644 --- a/reference/design/backend-redesign/design-docs/ddl-generation.md +++ b/reference/design/backend-redesign/design-docs/ddl-generation.md @@ -383,7 +383,7 @@ Within each phase: - **Constraints**: group by kind in fixed order `PK → UNIQUE → FK → CHECK`, then order by constraint name (ordinal). - **Indexes**: order by table name, then index name (ordinal). - **Views**: order by view name (ordinal). - - For abstract union views (`{schema}.{AbstractResource}_View`), order `UNION ALL` arms by concrete `ResourceName` (ordinal), and use a fixed select-list order: `DocumentId`, abstract identity fields in `identityJsonPaths` order, then `Discriminator`. + - For abstract union views (`{schema}.{AbstractResource}_View`), order `UNION ALL` arms by concrete `ResourceName` (ordinal), then by `ProjectName` (ordinal) as a tie-breaker, and use a fixed select-list order: `DocumentId`, abstract identity fields in `identityJsonPaths` order, then `Discriminator`. - **Triggers**: order by table name, then trigger name (ordinal). - **Seed data**: - `dms.ResourceKey` inserts ordered by `ResourceKeyId` ascending (where ids are assigned from the seed list sorted by `(ProjectName, ResourceName)` ordinal). diff --git a/reference/design/backend-redesign/epics/03-provisioning-workflow/EPIC.md b/reference/design/backend-redesign/epics/03-provisioning-workflow/EPIC.md index 84b50ccf9..8ca34f3d1 100644 --- a/reference/design/backend-redesign/epics/03-provisioning-workflow/EPIC.md +++ b/reference/design/backend-redesign/epics/03-provisioning-workflow/EPIC.md @@ -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) diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/CoreDdlEmitterTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/CoreDdlEmitterTests.cs index 1cec5333c..843becc52 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/CoreDdlEmitterTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/CoreDdlEmitterTests.cs @@ -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() { diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/DdlEmissionGoldenTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/DdlEmissionGoldenTests.cs new file mode 100644 index 000000000..efccf7cd1 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/DdlEmissionGoldenTests.cs @@ -0,0 +1,2204 @@ +// SPDX-License-Identifier: Apache-2.0 +// Licensed to the Ed-Fi Alliance under one or more agreements. +// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +// See the LICENSE and NOTICES files in the project root for more information. + +using System.Diagnostics; +using EdFi.DataManagementService.Backend.External; +using FluentAssertions; +using NUnit.Framework; + +namespace EdFi.DataManagementService.Backend.Ddl.Tests.Unit; + +/// +/// Base class for DDL emission golden file tests. +/// +public abstract class DdlEmissionGoldenTestBase +{ + /// + /// Find project root by looking for the .csproj file. + /// + protected static string FindProjectRoot(string startDirectory) + { + var directory = new DirectoryInfo(startDirectory); + + while (directory is not null) + { + var candidate = Path.Combine( + directory.FullName, + "EdFi.DataManagementService.Backend.Ddl.Tests.Unit.csproj" + ); + if (File.Exists(candidate)) + { + return directory.FullName; + } + + directory = directory.Parent; + } + + throw new DirectoryNotFoundException( + "Unable to locate EdFi.DataManagementService.Backend.Ddl.Tests.Unit.csproj in parent directories." + ); + } + + /// + /// Run git diff between expected and actual files. + /// + protected static string RunGitDiff(string expectedPath, string actualPath) + { + var startInfo = new ProcessStartInfo("git") + { + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + }; + + startInfo.ArgumentList.Add("diff"); + startInfo.ArgumentList.Add("--no-index"); + startInfo.ArgumentList.Add("--ignore-space-at-eol"); + startInfo.ArgumentList.Add("--ignore-cr-at-eol"); + startInfo.ArgumentList.Add("--"); + startInfo.ArgumentList.Add(expectedPath); + startInfo.ArgumentList.Add(actualPath); + + using var process = new Process { StartInfo = startInfo }; + process.Start(); + var outputTask = process.StandardOutput.ReadToEndAsync(); + var errorTask = process.StandardError.ReadToEndAsync(); + + if (!process.WaitForExit(30_000)) + { + process.Kill(); + process.WaitForExit(); + throw new TimeoutException("git diff timed out after 30 seconds"); + } + + var output = outputTask.GetAwaiter().GetResult(); + var error = errorTask.GetAwaiter().GetResult(); + + if (process.ExitCode == 0) + { + return string.Empty; + } + + if (process.ExitCode == 1) + { + return output; + } + + return string.IsNullOrWhiteSpace(error) ? output : $"{error}\n{output}".Trim(); + } + + /// + /// Check if UPDATE_GOLDENS environment variable is set. + /// + protected static bool ShouldUpdateGoldens() + { + var update = Environment.GetEnvironmentVariable("UPDATE_GOLDENS"); + + return string.Equals(update, "1", StringComparison.OrdinalIgnoreCase) + || string.Equals(update, "true", StringComparison.OrdinalIgnoreCase); + } + + /// + /// Emits DDL and writes the actual output file. Call this in SetUp (arrange + act). + /// + protected static GoldenTestPaths EmitDdl( + string fixtureName, + SqlDialect dialect, + DerivedRelationalModelSet modelSet + ) + { + var projectRoot = FindProjectRoot(TestContext.CurrentContext.TestDirectory); + var fixtureRoot = Path.Combine(projectRoot, "Fixtures", "ddl-emission"); + var dialectName = dialect switch + { + SqlDialect.Pgsql => "pgsql", + SqlDialect.Mssql => "mssql", + _ => throw new ArgumentOutOfRangeException(nameof(dialect), dialect, "Unsupported dialect."), + }; + var expectedPath = Path.Combine(fixtureRoot, "expected", dialectName, $"{fixtureName}.sql"); + var actualPath = Path.Combine( + TestContext.CurrentContext.WorkDirectory, + "ddl-emission", + dialectName, + $"{fixtureName}.sql" + ); + + var dialectInstance = SqlDialectFactory.Create(dialect); + var emitter = new RelationalModelDdlEmitter(dialectInstance); + var ddl = emitter.Emit(modelSet); + + Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); + File.WriteAllText(actualPath, ddl); + + if (ShouldUpdateGoldens()) + { + Directory.CreateDirectory(Path.GetDirectoryName(expectedPath)!); + File.WriteAllText(expectedPath, ddl); + } + + return new GoldenTestPaths(expectedPath, actualPath); + } + + /// + /// Asserts that the emitted DDL matches the golden file. Call this in the test method. + /// + protected static void AssertGoldenMatch(GoldenTestPaths paths) + { + File.Exists(paths.ExpectedPath) + .Should() + .BeTrue($"Golden file missing at {paths.ExpectedPath}. Set UPDATE_GOLDENS=1 to generate."); + + var diffOutput = RunGitDiff(paths.ExpectedPath, paths.ActualPath); + + if (!string.IsNullOrWhiteSpace(diffOutput)) + { + Assert.Fail( + $"DDL output does not match golden file.\n\n" + + $"Expected: {paths.ExpectedPath}\n" + + $"Actual: {paths.ActualPath}\n\n" + + $"Diff:\n{diffOutput}" + ); + } + } + + protected record GoldenTestPaths(string ExpectedPath, string ActualPath); +} + +// ═══════════════════════════════════════════════════════════════════ +// Golden File Tests - Nested Collections +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_DdlEmitter_With_NestedCollections_For_Pgsql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = NestedCollectionsFixture.Build(SqlDialect.Pgsql); + _paths = EmitDdl("nested-collections", SqlDialect.Pgsql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +[TestFixture] +public class Given_DdlEmitter_With_NestedCollections_For_Mssql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = NestedCollectionsFixture.Build(SqlDialect.Mssql); + _paths = EmitDdl("nested-collections", SqlDialect.Mssql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Golden File Tests - Polymorphic Abstract Views +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_DdlEmitter_With_PolymorphicAbstract_For_Pgsql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = PolymorphicAbstractFixture.Build(SqlDialect.Pgsql); + _paths = EmitDdl("polymorphic-abstract", SqlDialect.Pgsql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +[TestFixture] +public class Given_DdlEmitter_With_PolymorphicAbstract_For_Mssql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = PolymorphicAbstractFixture.Build(SqlDialect.Mssql); + _paths = EmitDdl("polymorphic-abstract", SqlDialect.Mssql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Golden File Tests - Identity Propagation +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_DdlEmitter_With_IdentityPropagation_For_Pgsql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = IdentityPropagationFixture.Build(SqlDialect.Pgsql); + _paths = EmitDdl("identity-propagation", SqlDialect.Pgsql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +[TestFixture] +public class Given_DdlEmitter_With_IdentityPropagation_For_Mssql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = IdentityPropagationFixture.Build(SqlDialect.Mssql); + _paths = EmitDdl("identity-propagation", SqlDialect.Mssql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Golden File Tests - Extension Mapping +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_DdlEmitter_With_ExtensionMapping_For_Pgsql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = ExtensionMappingFixture.Build(SqlDialect.Pgsql); + _paths = EmitDdl("extension-mapping", SqlDialect.Pgsql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +[TestFixture] +public class Given_DdlEmitter_With_ExtensionMapping_For_Mssql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + + [SetUp] + public void Setup() + { + var modelSet = ExtensionMappingFixture.Build(SqlDialect.Mssql); + _paths = EmitDdl("extension-mapping", SqlDialect.Mssql, modelSet); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Golden File Tests - Key Unification +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_DdlEmitter_With_KeyUnification_For_Pgsql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + private string _ddlContent = default!; + + [SetUp] + public void Setup() + { + var modelSet = KeyUnificationFixture.Build(SqlDialect.Pgsql); + _paths = EmitDdl("key-unification", SqlDialect.Pgsql, modelSet); + _ddlContent = File.ReadAllText(_paths.ActualPath); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } + + [Test] + public void It_should_emit_stored_generated_column_for_alias() + { + _ddlContent.Should().Contain("GENERATED ALWAYS AS", "alias columns should emit GENERATED ALWAYS AS"); + _ddlContent.Should().Contain("STORED", "alias columns should be STORED in PostgreSQL"); + } +} + +[TestFixture] +public class Given_DdlEmitter_With_KeyUnification_For_Mssql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + private string _ddlContent = default!; + + [SetUp] + public void Setup() + { + var modelSet = KeyUnificationFixture.Build(SqlDialect.Mssql); + _paths = EmitDdl("key-unification", SqlDialect.Mssql, modelSet); + _ddlContent = File.ReadAllText(_paths.ActualPath); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } + + [Test] + public void It_should_emit_persisted_computed_column_for_alias() + { + _ddlContent.Should().Contain("PERSISTED", "alias columns should be PERSISTED in MSSQL"); + } + + [Test] + public void It_should_not_use_update_on_alias_columns() + { + // Alias columns are computed — UPDATE() on them would fail with Msg 2114 + _ddlContent + .Should() + .NotContain("UPDATE([CourseOffering_SchoolId])", "UPDATE() must not reference alias columns"); + _ddlContent + .Should() + .NotContain("UPDATE([School_SchoolId])", "UPDATE() must not reference alias columns"); + } + + [Test] + public void It_should_not_set_alias_columns_in_propagation() + { + // Alias columns are computed — SET on them would fail with Msg 271 + _ddlContent + .Should() + .NotContain("SET r.[CourseOffering_SchoolId]", "SET must not target alias columns"); + _ddlContent.Should().NotContain("SET r.[School_SchoolId]", "SET must not target alias columns"); + } + + [Test] + public void It_should_use_canonical_column_in_update_guard() + { + _ddlContent + .Should() + .Contain("UPDATE([SchoolId_Unified])", "UPDATE() should reference canonical stored column"); + } + + [Test] + public void It_should_use_canonical_column_in_propagation_set() + { + _ddlContent + .Should() + .Contain("[SchoolId_Unified]", "propagation SET should reference canonical stored column"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Golden File Tests - FK Support Indexes +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_DdlEmitter_With_FkSupportIndex_For_Pgsql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + private string _ddlContent = default!; + + [SetUp] + public void Setup() + { + var modelSet = FkSupportIndexFixture.Build(SqlDialect.Pgsql); + _paths = EmitDdl("fk-support-index", SqlDialect.Pgsql, modelSet); + _ddlContent = File.ReadAllText(_paths.ActualPath); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } + + [Test] + public void It_should_emit_fk_support_index_exactly_once() + { + // Use dialect-specific quoted identifier pattern for precise matching + // Account for IF NOT EXISTS and schema prefix in PostgreSQL DDL + var indexMatches = System.Text.RegularExpressions.Regex.Matches( + _ddlContent, + @"CREATE\s+INDEX\s+IF\s+NOT\s+EXISTS\s+""[^""]+""\.""IX_Enrollment_SchoolId""", + System.Text.RegularExpressions.RegexOptions.IgnoreCase + ); + indexMatches.Count.Should().Be(1, "FK-support index should be emitted exactly once"); + } +} + +[TestFixture] +public class Given_DdlEmitter_With_FkSupportIndex_For_Mssql : DdlEmissionGoldenTestBase +{ + private GoldenTestPaths _paths = default!; + private string _ddlContent = default!; + + [SetUp] + public void Setup() + { + var modelSet = FkSupportIndexFixture.Build(SqlDialect.Mssql); + _paths = EmitDdl("fk-support-index", SqlDialect.Mssql, modelSet); + _ddlContent = File.ReadAllText(_paths.ActualPath); + } + + [Test] + public void It_should_emit_ddl_matching_golden_file() + { + AssertGoldenMatch(_paths); + } + + [Test] + public void It_should_emit_fk_support_index_exactly_once() + { + // Use dialect-specific quoted identifier pattern for precise matching + var indexMatches = System.Text.RegularExpressions.Regex.Matches( + _ddlContent, + @"CREATE\s+INDEX\s+\[IX_Enrollment_SchoolId\]", + System.Text.RegularExpressions.RegexOptions.IgnoreCase + ); + indexMatches.Count.Should().Be(1, "FK-support index should be emitted exactly once"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Fixture Builders +// ═══════════════════════════════════════════════════════════════════ + +/// +/// Fixture for nested collections scenario: +/// School → SchoolAddress → SchoolAddressPhoneNumber +/// +internal static class NestedCollectionsFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var resource = new QualifiedResourceName("Ed-Fi", "School"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); + + // Column names + var documentIdColumn = new DbColumnName("DocumentId"); + var schoolIdColumn = new DbColumnName("SchoolId"); + var addressOrdinalColumn = new DbColumnName("AddressOrdinal"); + var streetColumn = new DbColumnName("Street"); + var phoneOrdinalColumn = new DbColumnName("PhoneNumberOrdinal"); + var phoneNumberColumn = new DbColumnName("PhoneNumber"); + + // Root table: School + var schoolTableName = new DbTableName(schema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + // Child collection: SchoolAddress + var addressTableName = new DbTableName(schema, "SchoolAddress"); + var addressTable = new DbTableModel( + addressTableName, + new JsonPathExpression("$.addresses[*]", []), + new TableKey( + "PK_SchoolAddress", + [ + new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart), + new DbKeyColumn(addressOrdinalColumn, ColumnKind.Scalar), + ] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + addressOrdinalColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + streetColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 100), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolAddress_School", + [documentIdColumn], + schoolTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + // Nested collection: SchoolAddressPhoneNumber + var phoneTableName = new DbTableName(schema, "SchoolAddressPhoneNumber"); + var phoneTable = new DbTableModel( + phoneTableName, + new JsonPathExpression("$.addresses[*].phoneNumbers[*]", []), + new TableKey( + "PK_SchoolAddressPhoneNumber", + [ + new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart), + new DbKeyColumn(addressOrdinalColumn, ColumnKind.ParentKeyPart), + new DbKeyColumn(phoneOrdinalColumn, ColumnKind.Scalar), + ] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + addressOrdinalColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + phoneOrdinalColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + phoneNumberColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 20), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolAddressPhoneNumber_SchoolAddress", + [documentIdColumn, addressOrdinalColumn], + addressTableName, + [documentIdColumn, addressOrdinalColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + var relationalModel = new RelationalResourceModel( + resource, + schema, + ResourceStorageKind.RelationalTables, + schoolTable, + [schoolTable, addressTable, phoneTable], + [], + [] + ); + + // Triggers + List triggers = + [ + // DocumentStamping on root table (with identity projection column SchoolId) + new( + new DbTriggerName("TR_School_Stamp"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + // DocumentStamping on child table SchoolAddress (no identity projection) + new( + new DbTriggerName("TR_SchoolAddress_Stamp"), + addressTableName, + [documentIdColumn], + [], + new TriggerKindParameters.DocumentStamping() + ), + // DocumentStamping on nested child table (no identity projection) + new( + new DbTriggerName("TR_SchoolAddressPhoneNumber_Stamp"), + phoneTableName, + [documentIdColumn], + [], + new TriggerKindParameters.DocumentStamping() + ), + // ReferentialIdentityMaintenance on root table + new( + new DbTriggerName("TR_School_ReferentialIdentity"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 1, + "Ed-Fi", + "School", + [ + new IdentityElementMapping( + schoolIdColumn, + "$.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + ] + ) + ), + ]; + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [resourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], + [], + [], + [], + triggers + ); + } +} + +/// +/// Fixture for polymorphic abstract views scenario: +/// EducationOrganization (abstract) with School + LEA concrete types +/// +internal static class PolymorphicAbstractFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var documentIdColumn = new DbColumnName("DocumentId"); + var discriminatorColumn = new DbColumnName("Discriminator"); + var organizationIdColumn = new DbColumnName("EducationOrganizationId"); + + // Abstract resource + var abstractResource = new QualifiedResourceName("Ed-Fi", "EducationOrganization"); + var abstractResourceKey = new ResourceKeyEntry(1, abstractResource, "1.0.0", true); + + // Concrete resources + var schoolResource = new QualifiedResourceName("Ed-Fi", "School"); + var schoolResourceKey = new ResourceKeyEntry(2, schoolResource, "1.0.0", false); + + var leaResource = new QualifiedResourceName("Ed-Fi", "LocalEducationAgency"); + var leaResourceKey = new ResourceKeyEntry(3, leaResource, "1.0.0", false); + + // Identity table for abstract type + var identityTableName = new DbTableName(schema, "EducationOrganizationIdentity"); + var identityTable = new DbTableModel( + identityTableName, + new JsonPathExpression("$", []), + new TableKey( + "PK_EducationOrganizationIdentity", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + organizationIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + discriminatorColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 50), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + // FK from abstract identity table to dms.Document (as created by BuildIdentityTableConstraints) + new TableConstraint.ForeignKey( + "FK_EducationOrganizationIdentity_Document", + [documentIdColumn], + new DbTableName(new DbSchemaName("dms"), "Document"), + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + // School concrete table + var schoolTableName = new DbTableName(schema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + organizationIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_School_EducationOrganizationIdentity", + [documentIdColumn], + identityTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + // LEA concrete table + var leaTableName = new DbTableName(schema, "LocalEducationAgency"); + var leaTable = new DbTableModel( + leaTableName, + new JsonPathExpression("$", []), + new TableKey( + "PK_LocalEducationAgency", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + organizationIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_LocalEducationAgency_EducationOrganizationIdentity", + [documentIdColumn], + identityTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + // Abstract union view + var viewName = new DbTableName(schema, "EducationOrganization_View"); + List outputColumns = + [ + new(documentIdColumn, new RelationalScalarType(ScalarKind.Int64), null, null), + new(organizationIdColumn, new RelationalScalarType(ScalarKind.Int32), null, null), + new(discriminatorColumn, new RelationalScalarType(ScalarKind.String, MaxLength: 50), null, null), + ]; + + var schoolArm = new AbstractUnionViewArm( + schoolResourceKey, + schoolTableName, + [ + new AbstractUnionViewProjectionExpression.SourceColumn(documentIdColumn), + new AbstractUnionViewProjectionExpression.SourceColumn(organizationIdColumn), + new AbstractUnionViewProjectionExpression.StringLiteral("Ed-Fi:School"), + ] + ); + + var leaArm = new AbstractUnionViewArm( + leaResourceKey, + leaTableName, + [ + new AbstractUnionViewProjectionExpression.SourceColumn(documentIdColumn), + new AbstractUnionViewProjectionExpression.SourceColumn(organizationIdColumn), + new AbstractUnionViewProjectionExpression.StringLiteral("Ed-Fi:LocalEducationAgency"), + ] + ); + + var unionView = new AbstractUnionViewInfo( + abstractResourceKey, + viewName, + outputColumns, + [schoolArm, leaArm] + ); + + var abstractIdentityTable = new AbstractIdentityTableInfo(abstractResourceKey, identityTable); + + var schoolRelationalModel = new RelationalResourceModel( + schoolResource, + schema, + ResourceStorageKind.RelationalTables, + schoolTable, + [schoolTable], + [], + [] + ); + + var leaRelationalModel = new RelationalResourceModel( + leaResource, + schema, + ResourceStorageKind.RelationalTables, + leaTable, + [leaTable], + [], + [] + ); + + // Triggers + var superclassAlias = new SuperclassAliasInfo( + 1, + "Ed-Fi", + "EducationOrganization", + [ + new IdentityElementMapping( + organizationIdColumn, + "$.educationOrganizationId", + new RelationalScalarType(ScalarKind.Int32) + ), + ] + ); + + List triggers = + [ + // DocumentStamping on LEA root (with identity projection) + new( + new DbTriggerName("TR_LocalEducationAgency_Stamp"), + leaTableName, + [documentIdColumn], + [organizationIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + // AbstractIdentityMaintenance on LEA → EducationOrganizationIdentity + new( + new DbTriggerName("TR_LocalEducationAgency_AbstractIdentity"), + leaTableName, + [documentIdColumn], + [organizationIdColumn], + new TriggerKindParameters.AbstractIdentityMaintenance( + identityTableName, + [new TriggerColumnMapping(organizationIdColumn, organizationIdColumn)], + "Ed-Fi:LocalEducationAgency" + ) + ), + // ReferentialIdentityMaintenance on LEA + new( + new DbTriggerName("TR_LocalEducationAgency_ReferentialIdentity"), + leaTableName, + [documentIdColumn], + [organizationIdColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 3, + "Ed-Fi", + "LocalEducationAgency", + [ + new IdentityElementMapping( + organizationIdColumn, + "$.educationOrganizationId", + new RelationalScalarType(ScalarKind.Int32) + ), + ], + superclassAlias + ) + ), + // DocumentStamping on School root (with identity projection) + new( + new DbTriggerName("TR_School_Stamp"), + schoolTableName, + [documentIdColumn], + [organizationIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + // AbstractIdentityMaintenance on School → EducationOrganizationIdentity + new( + new DbTriggerName("TR_School_AbstractIdentity"), + schoolTableName, + [documentIdColumn], + [organizationIdColumn], + new TriggerKindParameters.AbstractIdentityMaintenance( + identityTableName, + [new TriggerColumnMapping(organizationIdColumn, organizationIdColumn)], + "Ed-Fi:School" + ) + ), + // ReferentialIdentityMaintenance on School + new( + new DbTriggerName("TR_School_ReferentialIdentity"), + schoolTableName, + [documentIdColumn], + [organizationIdColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 2, + "Ed-Fi", + "School", + [ + new IdentityElementMapping( + organizationIdColumn, + "$.educationOrganizationId", + new RelationalScalarType(ScalarKind.Int32) + ), + ], + superclassAlias + ) + ), + ]; + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 3, + [0x01, 0x02, 0x03], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [abstractResourceKey, schoolResourceKey, leaResourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [ + new ConcreteResourceModel( + schoolResourceKey, + ResourceStorageKind.RelationalTables, + schoolRelationalModel + ), + new ConcreteResourceModel( + leaResourceKey, + ResourceStorageKind.RelationalTables, + leaRelationalModel + ), + ], + [abstractIdentityTable], + [unionView], + [], + triggers + ); + } +} + +/// +/// Fixture for extension mapping scenario: +/// School (core) with Sample extension at root and nested collection levels +/// +internal static class ExtensionMappingFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var edfiSchema = new DbSchemaName("edfi"); + var sampleSchema = new DbSchemaName("sample"); + var resource = new QualifiedResourceName("Ed-Fi", "School"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); + + // Column names + var documentIdColumn = new DbColumnName("DocumentId"); + var schoolIdColumn = new DbColumnName("SchoolId"); + var addressOrdinalColumn = new DbColumnName("AddressOrdinal"); + var streetColumn = new DbColumnName("Street"); + var extensionDataColumn = new DbColumnName("ExtensionData"); + var addressExtDataColumn = new DbColumnName("AddressExtensionData"); + + // Core table: School + var schoolTableName = new DbTableName(edfiSchema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + // Core collection: SchoolAddress + var addressTableName = new DbTableName(edfiSchema, "SchoolAddress"); + var addressTable = new DbTableModel( + addressTableName, + new JsonPathExpression("$.addresses[*]", []), + new TableKey( + "PK_SchoolAddress", + [ + new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart), + new DbKeyColumn(addressOrdinalColumn, ColumnKind.Scalar), + ] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + addressOrdinalColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + streetColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 100), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolAddress_School", + [documentIdColumn], + schoolTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + // Root extension: SchoolExtension + var schoolExtTableName = new DbTableName(sampleSchema, "SchoolExtension"); + var schoolExtTable = new DbTableModel( + schoolExtTableName, + new JsonPathExpression("$._ext.sample", []), + new TableKey("PK_SchoolExtension", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + extensionDataColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 200), + IsNullable: true, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolExtension_School", + [documentIdColumn], + schoolTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + // Nested extension: SchoolAddressExtension + var addressExtTableName = new DbTableName(sampleSchema, "SchoolAddressExtension"); + var addressExtTable = new DbTableModel( + addressExtTableName, + new JsonPathExpression("$.addresses[*]._ext.sample", []), + new TableKey( + "PK_SchoolAddressExtension", + [ + new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart), + new DbKeyColumn(addressOrdinalColumn, ColumnKind.ParentKeyPart), + ] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + addressOrdinalColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + addressExtDataColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 100), + IsNullable: true, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolAddressExtension_SchoolAddress", + [documentIdColumn, addressOrdinalColumn], + addressTableName, + [documentIdColumn, addressOrdinalColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + var relationalModel = new RelationalResourceModel( + resource, + edfiSchema, + ResourceStorageKind.RelationalTables, + schoolTable, + [schoolTable, addressTable, schoolExtTable, addressExtTable], + [], + [] + ); + + // Triggers + List triggers = + [ + // DocumentStamping on root table (with identity projection column SchoolId) + new( + new DbTriggerName("TR_School_Stamp"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + // DocumentStamping on child table SchoolAddress (no identity projection) + new( + new DbTriggerName("TR_SchoolAddress_Stamp"), + addressTableName, + [documentIdColumn], + [], + new TriggerKindParameters.DocumentStamping() + ), + // DocumentStamping on extension table SchoolAddressExtension (no identity projection) + new( + new DbTriggerName("TR_SchoolAddressExtension_Stamp"), + addressExtTableName, + [documentIdColumn], + [], + new TriggerKindParameters.DocumentStamping() + ), + // DocumentStamping on extension table SchoolExtension (no identity projection) + new( + new DbTriggerName("TR_SchoolExtension_Stamp"), + schoolExtTableName, + [documentIdColumn], + [], + new TriggerKindParameters.DocumentStamping() + ), + // ReferentialIdentityMaintenance on root table + new( + new DbTriggerName("TR_School_ReferentialIdentity"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 1, + "Ed-Fi", + "School", + [ + new IdentityElementMapping( + schoolIdColumn, + "$.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + ] + ) + ), + ]; + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + new SchemaComponentInfo( + "sample", + "Sample", + "1.0.0", + false, + "aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000" + ), + ], + [resourceKey] + ), + dialect, + [ + new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, edfiSchema), + new ProjectSchemaInfo("sample", "Sample", "1.0.0", false, sampleSchema), + ], + [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], + [], + [], + [], + triggers + ); + } +} + +/// +/// Fixture for identity propagation fallback scenario (MSSQL only): +/// StudentSchoolAssociation references School via SchoolId FK. +/// On MSSQL, an IdentityPropagationFallback trigger on StudentSchoolAssociation +/// propagates SchoolId changes to the School root table (replacing ON UPDATE CASCADE). +/// On PostgreSQL, only DocumentStamping and ReferentialIdentityMaintenance are emitted. +/// +internal static class IdentityPropagationFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var documentIdColumn = new DbColumnName("DocumentId"); + var schoolIdColumn = new DbColumnName("SchoolId"); + var schoolDocumentIdColumn = new DbColumnName("School_DocumentId"); + var studentIdColumn = new DbColumnName("StudentUniqueId"); + var entryDateColumn = new DbColumnName("EntryDate"); + var entryTimestampColumn = new DbColumnName("EntryTimestamp"); + var isActiveColumn = new DbColumnName("IsActive"); + + // School resource + var schoolResource = new QualifiedResourceName("Ed-Fi", "School"); + var schoolResourceKey = new ResourceKeyEntry(1, schoolResource, "1.0.0", false); + + var schoolTableName = new DbTableName(schema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + // StudentSchoolAssociation resource + var assocResource = new QualifiedResourceName("Ed-Fi", "StudentSchoolAssociation"); + var assocResourceKey = new ResourceKeyEntry(2, assocResource, "1.0.0", false); + + var assocTableName = new DbTableName(schema, "StudentSchoolAssociation"); + var assocTable = new DbTableModel( + assocTableName, + new JsonPathExpression("$", []), + new TableKey( + "PK_StudentSchoolAssociation", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolDocumentIdColumn, + ColumnKind.DocumentFk, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: schoolResource + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + studentIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + entryDateColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Date), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + entryTimestampColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.DateTime), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + isActiveColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Boolean), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_StudentSchoolAssociation_School", + [schoolDocumentIdColumn], + schoolTableName, + [documentIdColumn], + ReferentialAction.NoAction, + ReferentialAction.NoAction + ), + ] + ); + + var schoolRelationalModel = new RelationalResourceModel( + schoolResource, + schema, + ResourceStorageKind.RelationalTables, + schoolTable, + [schoolTable], + [], + [] + ); + + var assocRelationalModel = new RelationalResourceModel( + assocResource, + schema, + ResourceStorageKind.RelationalTables, + assocTable, + [assocTable], + [], + [] + ); + + // Triggers + List triggers = + [ + // DocumentStamping on School root + new( + new DbTriggerName("TR_School_Stamp"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + // ReferentialIdentityMaintenance on School + new( + new DbTriggerName("TR_School_ReferentialIdentity"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 1, + "Ed-Fi", + "School", + [ + new IdentityElementMapping( + schoolIdColumn, + "$.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + ] + ) + ), + // DocumentStamping on StudentSchoolAssociation root + new( + new DbTriggerName("TR_StudentSchoolAssociation_Stamp"), + assocTableName, + [documentIdColumn], + [schoolIdColumn, studentIdColumn, entryDateColumn, entryTimestampColumn, isActiveColumn], + new TriggerKindParameters.DocumentStamping() + ), + // ReferentialIdentityMaintenance on StudentSchoolAssociation + new( + new DbTriggerName("TR_StudentSchoolAssociation_ReferentialIdentity"), + assocTableName, + [documentIdColumn], + [schoolIdColumn, studentIdColumn, entryDateColumn, entryTimestampColumn, isActiveColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 2, + "Ed-Fi", + "StudentSchoolAssociation", + [ + new IdentityElementMapping( + schoolIdColumn, + "$.schoolReference.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + new IdentityElementMapping( + studentIdColumn, + "$.studentReference.studentUniqueId", + new RelationalScalarType(ScalarKind.String) + ), + new IdentityElementMapping( + entryDateColumn, + "$.entryDate", + new RelationalScalarType(ScalarKind.Date) + ), + new IdentityElementMapping( + entryTimestampColumn, + "$.entryTimestamp", + new RelationalScalarType(ScalarKind.DateTime) + ), + new IdentityElementMapping( + isActiveColumn, + "$.isActive", + new RelationalScalarType(ScalarKind.Boolean) + ), + ] + ) + ), + ]; + + // IdentityPropagationFallback — MSSQL only, trigger on referenced entity (School) + if (dialect == SqlDialect.Mssql) + { + triggers.Add( + new DbTriggerInfo( + new DbTriggerName("TR_School_Propagation"), + schoolTableName, + [new DbColumnName("DocumentId")], + [schoolIdColumn], + new TriggerKindParameters.IdentityPropagationFallback([ + new PropagationReferrerTarget( + assocTableName, + new DbColumnName("School_DocumentId"), + [new TriggerColumnMapping(schoolIdColumn, schoolIdColumn)] + ), + ]) + ) + ); + } + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 2, + [0x01, 0x02], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [schoolResourceKey, assocResourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [ + new ConcreteResourceModel( + schoolResourceKey, + ResourceStorageKind.RelationalTables, + schoolRelationalModel + ), + new ConcreteResourceModel( + assocResourceKey, + ResourceStorageKind.RelationalTables, + assocRelationalModel + ), + ], + [], + [], + [], + triggers + ); + } +} + +/// +/// Fixture for FK-support index scenario: +/// Enrollment references School via SchoolId FK, with an explicit FK-support index. +/// Tests that FK-support indexes are emitted exactly once and not duplicated. +/// +internal static class FkSupportIndexFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var documentIdColumn = new DbColumnName("DocumentId"); + var schoolIdColumn = new DbColumnName("SchoolId"); + var enrollmentIdColumn = new DbColumnName("EnrollmentId"); + + // School resource (parent) + var schoolResource = new QualifiedResourceName("Ed-Fi", "School"); + var schoolResourceKey = new ResourceKeyEntry(1, schoolResource, "1.0.0", false); + + var schoolTableName = new DbTableName(schema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + // Enrollment resource (child with FK to School) + var enrollmentResource = new QualifiedResourceName("Ed-Fi", "Enrollment"); + var enrollmentResourceKey = new ResourceKeyEntry(2, enrollmentResource, "1.0.0", false); + + var enrollmentTableName = new DbTableName(schema, "Enrollment"); + var enrollmentTable = new DbTableModel( + enrollmentTableName, + new JsonPathExpression("$", []), + new TableKey("PK_Enrollment", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + enrollmentIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_Enrollment_School", + [schoolIdColumn], + schoolTableName, + [schoolIdColumn], + ReferentialAction.NoAction, + ReferentialAction.NoAction + ), + ] + ); + + var schoolRelationalModel = new RelationalResourceModel( + schoolResource, + schema, + ResourceStorageKind.RelationalTables, + schoolTable, + [schoolTable], + [], + [] + ); + + var enrollmentRelationalModel = new RelationalResourceModel( + enrollmentResource, + schema, + ResourceStorageKind.RelationalTables, + enrollmentTable, + [enrollmentTable], + [], + [] + ); + + // FK-support index on Enrollment.SchoolId for join performance + List indexes = + [ + new( + new DbIndexName("IX_Enrollment_SchoolId"), + enrollmentTableName, + [schoolIdColumn], + IsUnique: false, + DbIndexKind.ForeignKeySupport + ), + ]; + + // Minimal triggers (document stamping only) + List triggers = + [ + new( + new DbTriggerName("TR_School_Stamp"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + new( + new DbTriggerName("TR_Enrollment_Stamp"), + enrollmentTableName, + [documentIdColumn], + [enrollmentIdColumn, schoolIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + ]; + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 2, + [0x01, 0x02], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [schoolResourceKey, enrollmentResourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [ + new ConcreteResourceModel( + schoolResourceKey, + ResourceStorageKind.RelationalTables, + schoolRelationalModel + ), + new ConcreteResourceModel( + enrollmentResourceKey, + ResourceStorageKind.RelationalTables, + enrollmentRelationalModel + ), + ], + [], + [], + indexes, + triggers + ); + } +} + +/// +/// Fixture for key unification with triggers scenario: +/// CourseRegistration has two references (courseOfferingReference and schoolReference) that both +/// carry a SchoolId identity field. Key unification merges them into a canonical SchoolId_Unified +/// column with two persisted computed alias columns (CourseOffering_SchoolId, School_SchoolId). +/// +/// Validates: +/// - Computed column definitions (PERSISTED for MSSQL, GENERATED ALWAYS AS ... STORED for PostgreSQL) +/// - UPDATE() guards in MSSQL triggers reference the canonical stored column, not aliases +/// - Propagation trigger SET targets reference canonical stored columns, not aliases +/// - Identity hash expressions in ReferentialIdentity triggers read alias columns from inserted/NEW +/// - FK constraints use the DocumentId FK columns (not identity alias columns) +/// +internal static class KeyUnificationFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var documentIdColumn = new DbColumnName("DocumentId"); + + // ── School resource (referenced entity, source of propagation) ── + var schoolResource = new QualifiedResourceName("Ed-Fi", "School"); + var schoolResourceKey = new ResourceKeyEntry(1, schoolResource, "1.0.0", false); + var schoolIdColumn = new DbColumnName("SchoolId"); + + var schoolTableName = new DbTableName(schema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + var schoolRelationalModel = new RelationalResourceModel( + schoolResource, + schema, + ResourceStorageKind.RelationalTables, + schoolTable, + [schoolTable], + [], + [] + ); + + // ── CourseRegistration resource (referrer with key-unified alias columns) ── + var regResource = new QualifiedResourceName("Ed-Fi", "CourseRegistration"); + var regResourceKey = new ResourceKeyEntry(2, regResource, "1.0.0", false); + + // Column names — post-unification layout + var courseOfferingDocIdColumn = new DbColumnName("CourseOffering_DocumentId"); + var schoolDocIdColumn = new DbColumnName("School_DocumentId"); + var courseOfferingSchoolIdColumn = new DbColumnName("CourseOffering_SchoolId"); + var schoolSchoolIdColumn = new DbColumnName("School_SchoolId"); + var schoolIdUnifiedColumn = new DbColumnName("SchoolId_Unified"); + var localCourseCodeColumn = new DbColumnName("CourseOffering_LocalCourseCode"); + var registrationDateColumn = new DbColumnName("RegistrationDate"); + + var regTableName = new DbTableName(schema, "CourseRegistration"); + var regTable = new DbTableModel( + regTableName, + new JsonPathExpression("$", []), + new TableKey( + "PK_CourseRegistration", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + // DocumentId (PK) + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + // CourseOffering_DocumentId (FK to CourseOffering) + new DbColumnModel( + courseOfferingDocIdColumn, + ColumnKind.DocumentFk, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: new QualifiedResourceName("Ed-Fi", "CourseOffering") + ), + // School_DocumentId (FK to School) + new DbColumnModel( + schoolDocIdColumn, + ColumnKind.DocumentFk, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: schoolResource + ), + // CourseOffering_SchoolId — UNIFIED ALIAS → SchoolId_Unified (presence-gated by CourseOffering_DocumentId) + new( + courseOfferingSchoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: new JsonPathExpression("$.courseOfferingReference.schoolId", []), + TargetResource: null, + Storage: new ColumnStorage.UnifiedAlias(schoolIdUnifiedColumn, courseOfferingDocIdColumn) + ), + // CourseOffering_LocalCourseCode — stored identity column + new DbColumnModel( + localCourseCodeColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 60), + IsNullable: false, + SourceJsonPath: new JsonPathExpression("$.courseOfferingReference.localCourseCode", []), + TargetResource: null + ), + // School_SchoolId — UNIFIED ALIAS → SchoolId_Unified (presence-gated by School_DocumentId) + new( + schoolSchoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: new JsonPathExpression("$.schoolReference.schoolId", []), + TargetResource: null, + Storage: new ColumnStorage.UnifiedAlias(schoolIdUnifiedColumn, schoolDocIdColumn) + ), + // RegistrationDate — stored own-identity column + new DbColumnModel( + registrationDateColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Date), + IsNullable: false, + SourceJsonPath: new JsonPathExpression("$.registrationDate", []), + TargetResource: null + ), + // SchoolId_Unified — canonical stored column (added by key unification) + new DbColumnModel( + schoolIdUnifiedColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_CourseRegistration_CourseOffering", + [courseOfferingDocIdColumn], + new DbTableName(schema, "CourseOffering"), + [documentIdColumn], + ReferentialAction.NoAction, + ReferentialAction.NoAction + ), + new TableConstraint.ForeignKey( + "FK_CourseRegistration_School", + [schoolDocIdColumn], + schoolTableName, + [documentIdColumn], + ReferentialAction.NoAction, + ReferentialAction.NoAction + ), + ] + ) + { + KeyUnificationClasses = + [ + new KeyUnificationClass( + schoolIdUnifiedColumn, + [courseOfferingSchoolIdColumn, schoolSchoolIdColumn] + ), + ], + }; + + var regRelationalModel = new RelationalResourceModel( + regResource, + schema, + ResourceStorageKind.RelationalTables, + regTable, + [regTable], + [], + [] + ); + + // ── Triggers ── + + // Identity projection columns for CourseRegistration use CANONICAL stored columns only. + // The two alias columns (CourseOffering_SchoolId, School_SchoolId) resolve to the same + // canonical SchoolId_Unified, so after de-duplication the projection is: + // [SchoolId_Unified, CourseOffering_LocalCourseCode, RegistrationDate] + IReadOnlyList regIdentityProjectionColumns = + [ + schoolIdUnifiedColumn, + localCourseCodeColumn, + registrationDateColumn, + ]; + + List triggers = + [ + // ── School triggers ── + // DocumentStamping on School root + new( + new DbTriggerName("TR_School_Stamp"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.DocumentStamping() + ), + // ReferentialIdentityMaintenance on School + new( + new DbTriggerName("TR_School_ReferentialIdentity"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 1, + "Ed-Fi", + "School", + [ + new IdentityElementMapping( + schoolIdColumn, + "$.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + ] + ) + ), + // ── CourseRegistration triggers ── + // DocumentStamping on CourseRegistration root (identity projection = canonical columns) + new( + new DbTriggerName("TR_CourseRegistration_Stamp"), + regTableName, + [documentIdColumn], + regIdentityProjectionColumns, + new TriggerKindParameters.DocumentStamping() + ), + // ReferentialIdentityMaintenance on CourseRegistration + // IdentityElements use alias columns (readable from inserted/NEW for hash computation). + // IdentityProjectionColumns use canonical stored columns (for UPDATE guards). + new( + new DbTriggerName("TR_CourseRegistration_ReferentialIdentity"), + regTableName, + [documentIdColumn], + regIdentityProjectionColumns, + new TriggerKindParameters.ReferentialIdentityMaintenance( + 2, + "Ed-Fi", + "CourseRegistration", + [ + new IdentityElementMapping( + courseOfferingSchoolIdColumn, + "$.courseOfferingReference.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + new IdentityElementMapping( + localCourseCodeColumn, + "$.courseOfferingReference.localCourseCode", + new RelationalScalarType(ScalarKind.String) + ), + new IdentityElementMapping( + schoolSchoolIdColumn, + "$.schoolReference.schoolId", + new RelationalScalarType(ScalarKind.Int32) + ), + new IdentityElementMapping( + registrationDateColumn, + "$.registrationDate", + new RelationalScalarType(ScalarKind.Date) + ), + ] + ) + ), + ]; + + // IdentityPropagationFallback — MSSQL only. + // School propagates SchoolId changes to CourseRegistration. + // The target column is the CANONICAL stored column (SchoolId_Unified), not the alias. + if (dialect == SqlDialect.Mssql) + { + triggers.Add( + new DbTriggerInfo( + new DbTriggerName("TR_School_Propagation"), + schoolTableName, + [documentIdColumn], + [schoolIdColumn], + new TriggerKindParameters.IdentityPropagationFallback([ + new PropagationReferrerTarget( + regTableName, + schoolDocIdColumn, + [new TriggerColumnMapping(schoolIdColumn, schoolIdUnifiedColumn)] + ), + ]) + ) + ); + } + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 2, + [0x01, 0x02], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [schoolResourceKey, regResourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [ + new ConcreteResourceModel( + schoolResourceKey, + ResourceStorageKind.RelationalTables, + schoolRelationalModel + ), + new ConcreteResourceModel( + regResourceKey, + ResourceStorageKind.RelationalTables, + regRelationalModel + ), + ], + [], + [], + [], + triggers + ); + } +} diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/extension-mapping.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/extension-mapping.sql new file mode 100644 index 000000000..d9632c93e --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/extension-mapping.sql @@ -0,0 +1,167 @@ +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'edfi') + EXEC('CREATE SCHEMA [edfi]'); +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'sample') + EXEC('CREATE SCHEMA [sample]'); + +IF OBJECT_ID(N'edfi.School', N'U') IS NULL +CREATE TABLE [edfi].[School] +( + [DocumentId] bigint NOT NULL, + [SchoolId] int NOT NULL, + CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.SchoolAddress', N'U') IS NULL +CREATE TABLE [edfi].[SchoolAddress] +( + [DocumentId] bigint NOT NULL, + [AddressOrdinal] int NOT NULL, + [Street] nvarchar(100) NOT NULL, + CONSTRAINT [PK_SchoolAddress] PRIMARY KEY ([DocumentId], [AddressOrdinal]) +); + +IF OBJECT_ID(N'sample.SchoolExtension', N'U') IS NULL +CREATE TABLE [sample].[SchoolExtension] +( + [DocumentId] bigint NOT NULL, + [ExtensionData] nvarchar(200) NULL, + CONSTRAINT [PK_SchoolExtension] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'sample.SchoolAddressExtension', N'U') IS NULL +CREATE TABLE [sample].[SchoolAddressExtension] +( + [DocumentId] bigint NOT NULL, + [AddressOrdinal] int NOT NULL, + [AddressExtensionData] nvarchar(100) NULL, + CONSTRAINT [PK_SchoolAddressExtension] PRIMARY KEY ([DocumentId], [AddressOrdinal]) +); + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_SchoolAddress_School' AND parent_object_id = OBJECT_ID(N'edfi.SchoolAddress') +) +ALTER TABLE [edfi].[SchoolAddress] +ADD CONSTRAINT [FK_SchoolAddress_School] +FOREIGN KEY ([DocumentId]) +REFERENCES [edfi].[School] ([DocumentId]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_SchoolExtension_School' AND parent_object_id = OBJECT_ID(N'sample.SchoolExtension') +) +ALTER TABLE [sample].[SchoolExtension] +ADD CONSTRAINT [FK_SchoolExtension_School] +FOREIGN KEY ([DocumentId]) +REFERENCES [edfi].[School] ([DocumentId]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_SchoolAddressExtension_SchoolAddress' AND parent_object_id = OBJECT_ID(N'sample.SchoolAddressExtension') +) +ALTER TABLE [sample].[SchoolAddressExtension] +ADD CONSTRAINT [FK_SchoolAddressExtension_SchoolAddress] +FOREIGN KEY ([DocumentId], [AddressOrdinal]) +REFERENCES [edfi].[SchoolAddress] ([DocumentId], [AddressOrdinal]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Stamp] +ON [edfi].[School] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_SchoolAddress_Stamp] +ON [edfi].[SchoolAddress] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; +END; + +GO +CREATE OR ALTER TRIGGER [sample].[TR_SchoolAddressExtension_Stamp] +ON [sample].[SchoolAddressExtension] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; +END; + +GO +CREATE OR ALTER TRIGGER [sample].[TR_SchoolExtension_Stamp] +ON [sample].[SchoolExtension] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_ReferentialIdentity] +ON [edfi].[School] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i; + END + ELSE IF (UPDATE([SchoolId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/fk-support-index.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/fk-support-index.sql new file mode 100644 index 000000000..e67fafe3a --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/fk-support-index.sql @@ -0,0 +1,85 @@ +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'edfi') + EXEC('CREATE SCHEMA [edfi]'); + +IF OBJECT_ID(N'edfi.School', N'U') IS NULL +CREATE TABLE [edfi].[School] +( + [DocumentId] bigint NOT NULL, + [SchoolId] int NOT NULL, + CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.Enrollment', N'U') IS NULL +CREATE TABLE [edfi].[Enrollment] +( + [DocumentId] bigint NOT NULL, + [EnrollmentId] int NOT NULL, + [SchoolId] int NOT NULL, + CONSTRAINT [PK_Enrollment] PRIMARY KEY ([DocumentId]) +); + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_Enrollment_School' AND parent_object_id = OBJECT_ID(N'edfi.Enrollment') +) +ALTER TABLE [edfi].[Enrollment] +ADD CONSTRAINT [FK_Enrollment_School] +FOREIGN KEY ([SchoolId]) +REFERENCES [edfi].[School] ([SchoolId]) +ON DELETE NO ACTION +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.indexes i + JOIN sys.tables t ON i.object_id = t.object_id + JOIN sys.schemas s ON t.schema_id = s.schema_id + WHERE s.name = N'edfi' AND t.name = N'Enrollment' AND i.name = N'IX_Enrollment_SchoolId' +) +CREATE INDEX [IX_Enrollment_SchoolId] ON [edfi].[Enrollment] ([SchoolId]); + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Stamp] +ON [edfi].[School] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_Enrollment_Stamp] +ON [edfi].[Enrollment] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([EnrollmentId]) OR UPDATE([SchoolId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[EnrollmentId] <> del.[EnrollmentId] OR (i.[EnrollmentId] IS NULL AND del.[EnrollmentId] IS NOT NULL) OR (i.[EnrollmentId] IS NOT NULL AND del.[EnrollmentId] IS NULL)) OR (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)); + END +END; + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/identity-propagation.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/identity-propagation.sql new file mode 100644 index 000000000..79a814ecc --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/identity-propagation.sql @@ -0,0 +1,160 @@ +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'edfi') + EXEC('CREATE SCHEMA [edfi]'); + +IF OBJECT_ID(N'edfi.School', N'U') IS NULL +CREATE TABLE [edfi].[School] +( + [DocumentId] bigint NOT NULL, + [SchoolId] int NOT NULL, + CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.StudentSchoolAssociation', N'U') IS NULL +CREATE TABLE [edfi].[StudentSchoolAssociation] +( + [DocumentId] bigint NOT NULL, + [School_DocumentId] bigint NOT NULL, + [SchoolId] int NOT NULL, + [StudentUniqueId] nvarchar(32) NOT NULL, + [EntryDate] date NOT NULL, + [EntryTimestamp] datetime2(7) NOT NULL, + [IsActive] bit NOT NULL, + CONSTRAINT [PK_StudentSchoolAssociation] PRIMARY KEY ([DocumentId]) +); + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_StudentSchoolAssociation_School' AND parent_object_id = OBJECT_ID(N'edfi.StudentSchoolAssociation') +) +ALTER TABLE [edfi].[StudentSchoolAssociation] +ADD CONSTRAINT [FK_StudentSchoolAssociation_School] +FOREIGN KEY ([School_DocumentId]) +REFERENCES [edfi].[School] ([DocumentId]) +ON DELETE NO ACTION +ON UPDATE NO ACTION; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Stamp] +ON [edfi].[School] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_ReferentialIdentity] +ON [edfi].[School] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i; + END + ELSE IF (UPDATE([SchoolId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_StudentSchoolAssociation_Stamp] +ON [edfi].[StudentSchoolAssociation] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId]) OR UPDATE([StudentUniqueId]) OR UPDATE([EntryDate]) OR UPDATE([EntryTimestamp]) OR UPDATE([IsActive])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)) OR (i.[StudentUniqueId] <> del.[StudentUniqueId] OR (i.[StudentUniqueId] IS NULL AND del.[StudentUniqueId] IS NOT NULL) OR (i.[StudentUniqueId] IS NOT NULL AND del.[StudentUniqueId] IS NULL)) OR (i.[EntryDate] <> del.[EntryDate] OR (i.[EntryDate] IS NULL AND del.[EntryDate] IS NOT NULL) OR (i.[EntryDate] IS NOT NULL AND del.[EntryDate] IS NULL)) OR (i.[EntryTimestamp] <> del.[EntryTimestamp] OR (i.[EntryTimestamp] IS NULL AND del.[EntryTimestamp] IS NOT NULL) OR (i.[EntryTimestamp] IS NOT NULL AND del.[EntryTimestamp] IS NULL)) OR (i.[IsActive] <> del.[IsActive] OR (i.[IsActive] IS NULL AND del.[IsActive] IS NOT NULL) OR (i.[IsActive] IS NOT NULL AND del.[IsActive] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_StudentSchoolAssociation_ReferentialIdentity] +ON [edfi].[StudentSchoolAssociation] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 2; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiStudentSchoolAssociation' AS nvarchar(max)) + N'$$.schoolReference.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max)) + N'#' + N'$$.studentReference.studentUniqueId=' + i.[StudentUniqueId] + N'#' + N'$$.entryDate=' + CONVERT(nvarchar(10), i.[EntryDate], 23) + N'#' + N'$$.entryTimestamp=' + CONVERT(nvarchar(19), i.[EntryTimestamp], 126) + N'#' + N'$$.isActive=' + CASE WHEN i.[IsActive] = 1 THEN N'true' ELSE N'false' END), i.[DocumentId], 2 + FROM inserted i; + END + ELSE IF (UPDATE([SchoolId]) OR UPDATE([StudentUniqueId]) OR UPDATE([EntryDate]) OR UPDATE([EntryTimestamp]) OR UPDATE([IsActive])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)) OR (i.[StudentUniqueId] <> d.[StudentUniqueId] OR (i.[StudentUniqueId] IS NULL AND d.[StudentUniqueId] IS NOT NULL) OR (i.[StudentUniqueId] IS NOT NULL AND d.[StudentUniqueId] IS NULL)) OR (i.[EntryDate] <> d.[EntryDate] OR (i.[EntryDate] IS NULL AND d.[EntryDate] IS NOT NULL) OR (i.[EntryDate] IS NOT NULL AND d.[EntryDate] IS NULL)) OR (i.[EntryTimestamp] <> d.[EntryTimestamp] OR (i.[EntryTimestamp] IS NULL AND d.[EntryTimestamp] IS NOT NULL) OR (i.[EntryTimestamp] IS NOT NULL AND d.[EntryTimestamp] IS NULL)) OR (i.[IsActive] <> d.[IsActive] OR (i.[IsActive] IS NULL AND d.[IsActive] IS NOT NULL) OR (i.[IsActive] IS NOT NULL AND d.[IsActive] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 2; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiStudentSchoolAssociation' AS nvarchar(max)) + N'$$.schoolReference.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max)) + N'#' + N'$$.studentReference.studentUniqueId=' + i.[StudentUniqueId] + N'#' + N'$$.entryDate=' + CONVERT(nvarchar(10), i.[EntryDate], 23) + N'#' + N'$$.entryTimestamp=' + CONVERT(nvarchar(19), i.[EntryTimestamp], 126) + N'#' + N'$$.isActive=' + CASE WHEN i.[IsActive] = 1 THEN N'true' ELSE N'false' END), i.[DocumentId], 2 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Propagation] +ON [edfi].[School] +AFTER UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF (UPDATE([SchoolId])) + BEGIN + UPDATE r + SET r.[SchoolId] = i.[SchoolId] + FROM [edfi].[StudentSchoolAssociation] r + INNER JOIN deleted d ON r.[School_DocumentId] = d.[DocumentId] + INNER JOIN inserted i ON i.[DocumentId] = d.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)); + + END +END; + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/key-unification.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/key-unification.sql new file mode 100644 index 000000000..862c7e8c2 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/key-unification.sql @@ -0,0 +1,172 @@ +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'edfi') + EXEC('CREATE SCHEMA [edfi]'); + +IF OBJECT_ID(N'edfi.School', N'U') IS NULL +CREATE TABLE [edfi].[School] +( + [DocumentId] bigint NOT NULL, + [SchoolId] int NOT NULL, + CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.CourseRegistration', N'U') IS NULL +CREATE TABLE [edfi].[CourseRegistration] +( + [DocumentId] bigint NOT NULL, + [CourseOffering_DocumentId] bigint NOT NULL, + [School_DocumentId] bigint NOT NULL, + [CourseOffering_SchoolId] AS (CASE WHEN [CourseOffering_DocumentId] IS NULL THEN NULL ELSE [SchoolId_Unified] END) PERSISTED, + [CourseOffering_LocalCourseCode] nvarchar(60) NOT NULL, + [School_SchoolId] AS (CASE WHEN [School_DocumentId] IS NULL THEN NULL ELSE [SchoolId_Unified] END) PERSISTED, + [RegistrationDate] date NOT NULL, + [SchoolId_Unified] int NOT NULL, + CONSTRAINT [PK_CourseRegistration] PRIMARY KEY ([DocumentId]) +); + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_CourseRegistration_CourseOffering' AND parent_object_id = OBJECT_ID(N'edfi.CourseRegistration') +) +ALTER TABLE [edfi].[CourseRegistration] +ADD CONSTRAINT [FK_CourseRegistration_CourseOffering] +FOREIGN KEY ([CourseOffering_DocumentId]) +REFERENCES [edfi].[CourseOffering] ([DocumentId]) +ON DELETE NO ACTION +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_CourseRegistration_School' AND parent_object_id = OBJECT_ID(N'edfi.CourseRegistration') +) +ALTER TABLE [edfi].[CourseRegistration] +ADD CONSTRAINT [FK_CourseRegistration_School] +FOREIGN KEY ([School_DocumentId]) +REFERENCES [edfi].[School] ([DocumentId]) +ON DELETE NO ACTION +ON UPDATE NO ACTION; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Stamp] +ON [edfi].[School] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_ReferentialIdentity] +ON [edfi].[School] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i; + END + ELSE IF (UPDATE([SchoolId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_CourseRegistration_Stamp] +ON [edfi].[CourseRegistration] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId_Unified]) OR UPDATE([CourseOffering_LocalCourseCode]) OR UPDATE([RegistrationDate])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId_Unified] <> del.[SchoolId_Unified] OR (i.[SchoolId_Unified] IS NULL AND del.[SchoolId_Unified] IS NOT NULL) OR (i.[SchoolId_Unified] IS NOT NULL AND del.[SchoolId_Unified] IS NULL)) OR (i.[CourseOffering_LocalCourseCode] <> del.[CourseOffering_LocalCourseCode] OR (i.[CourseOffering_LocalCourseCode] IS NULL AND del.[CourseOffering_LocalCourseCode] IS NOT NULL) OR (i.[CourseOffering_LocalCourseCode] IS NOT NULL AND del.[CourseOffering_LocalCourseCode] IS NULL)) OR (i.[RegistrationDate] <> del.[RegistrationDate] OR (i.[RegistrationDate] IS NULL AND del.[RegistrationDate] IS NOT NULL) OR (i.[RegistrationDate] IS NOT NULL AND del.[RegistrationDate] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_CourseRegistration_ReferentialIdentity] +ON [edfi].[CourseRegistration] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 2; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiCourseRegistration' AS nvarchar(max)) + N'$$.courseOfferingReference.schoolId=' + CAST(i.[CourseOffering_SchoolId] AS nvarchar(max)) + N'#' + N'$$.courseOfferingReference.localCourseCode=' + i.[CourseOffering_LocalCourseCode] + N'#' + N'$$.schoolReference.schoolId=' + CAST(i.[School_SchoolId] AS nvarchar(max)) + N'#' + N'$$.registrationDate=' + CONVERT(nvarchar(10), i.[RegistrationDate], 23)), i.[DocumentId], 2 + FROM inserted i; + END + ELSE IF (UPDATE([SchoolId_Unified]) OR UPDATE([CourseOffering_LocalCourseCode]) OR UPDATE([RegistrationDate])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId_Unified] <> d.[SchoolId_Unified] OR (i.[SchoolId_Unified] IS NULL AND d.[SchoolId_Unified] IS NOT NULL) OR (i.[SchoolId_Unified] IS NOT NULL AND d.[SchoolId_Unified] IS NULL)) OR (i.[CourseOffering_LocalCourseCode] <> d.[CourseOffering_LocalCourseCode] OR (i.[CourseOffering_LocalCourseCode] IS NULL AND d.[CourseOffering_LocalCourseCode] IS NOT NULL) OR (i.[CourseOffering_LocalCourseCode] IS NOT NULL AND d.[CourseOffering_LocalCourseCode] IS NULL)) OR (i.[RegistrationDate] <> d.[RegistrationDate] OR (i.[RegistrationDate] IS NULL AND d.[RegistrationDate] IS NOT NULL) OR (i.[RegistrationDate] IS NOT NULL AND d.[RegistrationDate] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 2; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiCourseRegistration' AS nvarchar(max)) + N'$$.courseOfferingReference.schoolId=' + CAST(i.[CourseOffering_SchoolId] AS nvarchar(max)) + N'#' + N'$$.courseOfferingReference.localCourseCode=' + i.[CourseOffering_LocalCourseCode] + N'#' + N'$$.schoolReference.schoolId=' + CAST(i.[School_SchoolId] AS nvarchar(max)) + N'#' + N'$$.registrationDate=' + CONVERT(nvarchar(10), i.[RegistrationDate], 23)), i.[DocumentId], 2 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Propagation] +ON [edfi].[School] +AFTER UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF (UPDATE([SchoolId])) + BEGIN + UPDATE r + SET r.[SchoolId_Unified] = i.[SchoolId] + FROM [edfi].[CourseRegistration] r + INNER JOIN deleted d ON r.[School_DocumentId] = d.[DocumentId] + INNER JOIN inserted i ON i.[DocumentId] = d.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)); + + END +END; + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/nested-collections.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/nested-collections.sql new file mode 100644 index 000000000..77a7441e7 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/nested-collections.sql @@ -0,0 +1,133 @@ +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'edfi') + EXEC('CREATE SCHEMA [edfi]'); + +IF OBJECT_ID(N'edfi.School', N'U') IS NULL +CREATE TABLE [edfi].[School] +( + [DocumentId] bigint NOT NULL, + [SchoolId] int NOT NULL, + CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.SchoolAddress', N'U') IS NULL +CREATE TABLE [edfi].[SchoolAddress] +( + [DocumentId] bigint NOT NULL, + [AddressOrdinal] int NOT NULL, + [Street] nvarchar(100) NOT NULL, + CONSTRAINT [PK_SchoolAddress] PRIMARY KEY ([DocumentId], [AddressOrdinal]) +); + +IF OBJECT_ID(N'edfi.SchoolAddressPhoneNumber', N'U') IS NULL +CREATE TABLE [edfi].[SchoolAddressPhoneNumber] +( + [DocumentId] bigint NOT NULL, + [AddressOrdinal] int NOT NULL, + [PhoneNumberOrdinal] int NOT NULL, + [PhoneNumber] nvarchar(20) NOT NULL, + CONSTRAINT [PK_SchoolAddressPhoneNumber] PRIMARY KEY ([DocumentId], [AddressOrdinal], [PhoneNumberOrdinal]) +); + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_SchoolAddress_School' AND parent_object_id = OBJECT_ID(N'edfi.SchoolAddress') +) +ALTER TABLE [edfi].[SchoolAddress] +ADD CONSTRAINT [FK_SchoolAddress_School] +FOREIGN KEY ([DocumentId]) +REFERENCES [edfi].[School] ([DocumentId]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_SchoolAddressPhoneNumber_SchoolAddress' AND parent_object_id = OBJECT_ID(N'edfi.SchoolAddressPhoneNumber') +) +ALTER TABLE [edfi].[SchoolAddressPhoneNumber] +ADD CONSTRAINT [FK_SchoolAddressPhoneNumber_SchoolAddress] +FOREIGN KEY ([DocumentId], [AddressOrdinal]) +REFERENCES [edfi].[SchoolAddress] ([DocumentId], [AddressOrdinal]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Stamp] +ON [edfi].[School] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([SchoolId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> del.[SchoolId] OR (i.[SchoolId] IS NULL AND del.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND del.[SchoolId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_SchoolAddress_Stamp] +ON [edfi].[SchoolAddress] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_SchoolAddressPhoneNumber_Stamp] +ON [edfi].[SchoolAddressPhoneNumber] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_ReferentialIdentity] +ON [edfi].[School] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i; + END + ELSE IF (UPDATE([SchoolId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[SchoolId] <> d.[SchoolId] OR (i.[SchoolId] IS NULL AND d.[SchoolId] IS NOT NULL) OR (i.[SchoolId] IS NOT NULL AND d.[SchoolId] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.schoolId=' + CAST(i.[SchoolId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/polymorphic-abstract.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/polymorphic-abstract.sql new file mode 100644 index 000000000..3e7899516 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/mssql/polymorphic-abstract.sql @@ -0,0 +1,256 @@ +IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = N'edfi') + EXEC('CREATE SCHEMA [edfi]'); + +IF OBJECT_ID(N'edfi.School', N'U') IS NULL +CREATE TABLE [edfi].[School] +( + [DocumentId] bigint NOT NULL, + [EducationOrganizationId] int NOT NULL, + CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.LocalEducationAgency', N'U') IS NULL +CREATE TABLE [edfi].[LocalEducationAgency] +( + [DocumentId] bigint NOT NULL, + [EducationOrganizationId] int NOT NULL, + CONSTRAINT [PK_LocalEducationAgency] PRIMARY KEY ([DocumentId]) +); + +IF OBJECT_ID(N'edfi.EducationOrganizationIdentity', N'U') IS NULL +CREATE TABLE [edfi].[EducationOrganizationIdentity] +( + [DocumentId] bigint NOT NULL, + [EducationOrganizationId] int NOT NULL, + [Discriminator] nvarchar(50) NOT NULL, + CONSTRAINT [PK_EducationOrganizationIdentity] PRIMARY KEY ([DocumentId]) +); + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_School_EducationOrganizationIdentity' AND parent_object_id = OBJECT_ID(N'edfi.School') +) +ALTER TABLE [edfi].[School] +ADD CONSTRAINT [FK_School_EducationOrganizationIdentity] +FOREIGN KEY ([DocumentId]) +REFERENCES [edfi].[EducationOrganizationIdentity] ([DocumentId]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_LocalEducationAgency_EducationOrganizationIdentity' AND parent_object_id = OBJECT_ID(N'edfi.LocalEducationAgency') +) +ALTER TABLE [edfi].[LocalEducationAgency] +ADD CONSTRAINT [FK_LocalEducationAgency_EducationOrganizationIdentity] +FOREIGN KEY ([DocumentId]) +REFERENCES [edfi].[EducationOrganizationIdentity] ([DocumentId]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +IF NOT EXISTS ( + SELECT 1 FROM sys.foreign_keys + WHERE name = N'FK_EducationOrganizationIdentity_Document' AND parent_object_id = OBJECT_ID(N'edfi.EducationOrganizationIdentity') +) +ALTER TABLE [edfi].[EducationOrganizationIdentity] +ADD CONSTRAINT [FK_EducationOrganizationIdentity_Document] +FOREIGN KEY ([DocumentId]) +REFERENCES [dms].[Document] ([DocumentId]) +ON DELETE CASCADE +ON UPDATE NO ACTION; + +GO +CREATE OR ALTER VIEW [edfi].[EducationOrganization_View] AS +SELECT [DocumentId] AS [DocumentId], [EducationOrganizationId] AS [EducationOrganizationId], CAST(N'Ed-Fi:School' AS nvarchar(50)) AS [Discriminator] +FROM [edfi].[School] +UNION ALL +SELECT [DocumentId] AS [DocumentId], [EducationOrganizationId] AS [EducationOrganizationId], CAST(N'Ed-Fi:LocalEducationAgency' AS nvarchar(50)) AS [Discriminator] +FROM [edfi].[LocalEducationAgency] +; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_LocalEducationAgency_Stamp] +ON [edfi].[LocalEducationAgency] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([EducationOrganizationId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[EducationOrganizationId] <> del.[EducationOrganizationId] OR (i.[EducationOrganizationId] IS NULL AND del.[EducationOrganizationId] IS NOT NULL) OR (i.[EducationOrganizationId] IS NOT NULL AND del.[EducationOrganizationId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_LocalEducationAgency_AbstractIdentity] +ON [edfi].[LocalEducationAgency] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + MERGE [edfi].[EducationOrganizationIdentity] AS t + USING inserted AS s ON t.[DocumentId] = s.[DocumentId] + WHEN MATCHED THEN UPDATE SET t.[EducationOrganizationId] = s.[EducationOrganizationId] + WHEN NOT MATCHED THEN INSERT ([DocumentId], [EducationOrganizationId], [Discriminator]) + VALUES (s.[DocumentId], s.[EducationOrganizationId], N'Ed-Fi:LocalEducationAgency'); + END + ELSE IF (UPDATE([EducationOrganizationId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[EducationOrganizationId] <> d.[EducationOrganizationId] OR (i.[EducationOrganizationId] IS NULL AND d.[EducationOrganizationId] IS NOT NULL) OR (i.[EducationOrganizationId] IS NOT NULL AND d.[EducationOrganizationId] IS NULL)); + MERGE [edfi].[EducationOrganizationIdentity] AS t + USING (SELECT i.* FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]) AS s ON t.[DocumentId] = s.[DocumentId] + WHEN MATCHED THEN UPDATE SET t.[EducationOrganizationId] = s.[EducationOrganizationId] + WHEN NOT MATCHED THEN INSERT ([DocumentId], [EducationOrganizationId], [Discriminator]) + VALUES (s.[DocumentId], s.[EducationOrganizationId], N'Ed-Fi:LocalEducationAgency'); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_LocalEducationAgency_ReferentialIdentity] +ON [edfi].[LocalEducationAgency] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 3; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiLocalEducationAgency' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 3 + FROM inserted i; + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiEducationOrganization' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i; + END + ELSE IF (UPDATE([EducationOrganizationId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[EducationOrganizationId] <> d.[EducationOrganizationId] OR (i.[EducationOrganizationId] IS NULL AND d.[EducationOrganizationId] IS NOT NULL) OR (i.[EducationOrganizationId] IS NOT NULL AND d.[EducationOrganizationId] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 3; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiLocalEducationAgency' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 3 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiEducationOrganization' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_Stamp] +ON [edfi].[School] +AFTER INSERT, UPDATE, DELETE +AS +BEGIN + SET NOCOUNT ON; + ;WITH affectedDocs AS (SELECT [DocumentId] FROM inserted UNION SELECT [DocumentId] FROM deleted) + UPDATE d + SET d.[ContentVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[ContentLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN affectedDocs a ON d.[DocumentId] = a.[DocumentId]; + IF EXISTS (SELECT 1 FROM deleted) AND (UPDATE([EducationOrganizationId])) + BEGIN + UPDATE d + SET d.[IdentityVersion] = NEXT VALUE FOR [dms].[ChangeVersionSequence], d.[IdentityLastModifiedAt] = sysutcdatetime() + FROM [dms].[Document] d + INNER JOIN inserted i ON d.[DocumentId] = i.[DocumentId] + INNER JOIN deleted del ON del.[DocumentId] = i.[DocumentId] + WHERE (i.[EducationOrganizationId] <> del.[EducationOrganizationId] OR (i.[EducationOrganizationId] IS NULL AND del.[EducationOrganizationId] IS NOT NULL) OR (i.[EducationOrganizationId] IS NOT NULL AND del.[EducationOrganizationId] IS NULL)); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_AbstractIdentity] +ON [edfi].[School] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + MERGE [edfi].[EducationOrganizationIdentity] AS t + USING inserted AS s ON t.[DocumentId] = s.[DocumentId] + WHEN MATCHED THEN UPDATE SET t.[EducationOrganizationId] = s.[EducationOrganizationId] + WHEN NOT MATCHED THEN INSERT ([DocumentId], [EducationOrganizationId], [Discriminator]) + VALUES (s.[DocumentId], s.[EducationOrganizationId], N'Ed-Fi:School'); + END + ELSE IF (UPDATE([EducationOrganizationId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[EducationOrganizationId] <> d.[EducationOrganizationId] OR (i.[EducationOrganizationId] IS NULL AND d.[EducationOrganizationId] IS NOT NULL) OR (i.[EducationOrganizationId] IS NOT NULL AND d.[EducationOrganizationId] IS NULL)); + MERGE [edfi].[EducationOrganizationIdentity] AS t + USING (SELECT i.* FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]) AS s ON t.[DocumentId] = s.[DocumentId] + WHEN MATCHED THEN UPDATE SET t.[EducationOrganizationId] = s.[EducationOrganizationId] + WHEN NOT MATCHED THEN INSERT ([DocumentId], [EducationOrganizationId], [Discriminator]) + VALUES (s.[DocumentId], s.[EducationOrganizationId], N'Ed-Fi:School'); + END +END; + +GO +CREATE OR ALTER TRIGGER [edfi].[TR_School_ReferentialIdentity] +ON [edfi].[School] +AFTER INSERT, UPDATE +AS +BEGIN + SET NOCOUNT ON; + IF NOT EXISTS (SELECT 1 FROM deleted) + BEGIN + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 2; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 2 + FROM inserted i; + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM inserted) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiEducationOrganization' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i; + END + ELSE IF (UPDATE([EducationOrganizationId])) + BEGIN + DECLARE @changedDocs TABLE ([DocumentId] bigint NOT NULL); + INSERT INTO @changedDocs ([DocumentId]) + SELECT i.[DocumentId] + FROM inserted i INNER JOIN deleted d ON d.[DocumentId] = i.[DocumentId] + WHERE (i.[EducationOrganizationId] <> d.[EducationOrganizationId] OR (i.[EducationOrganizationId] IS NULL AND d.[EducationOrganizationId] IS NOT NULL) OR (i.[EducationOrganizationId] IS NOT NULL AND d.[EducationOrganizationId] IS NULL)); + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 2; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiSchool' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 2 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + DELETE FROM [dms].[ReferentialIdentity] + WHERE [DocumentId] IN (SELECT [DocumentId] FROM @changedDocs) AND [ResourceKeyId] = 1; + INSERT INTO [dms].[ReferentialIdentity] ([ReferentialId], [DocumentId], [ResourceKeyId]) + SELECT [dms].[uuidv5]('edf1edf1-3df1-3df1-3df1-3df1edf1edf1', CAST(N'Ed-FiEducationOrganization' AS nvarchar(max)) + N'$$.educationOrganizationId=' + CAST(i.[EducationOrganizationId] AS nvarchar(max))), i.[DocumentId], 1 + FROM inserted i INNER JOIN @changedDocs cd ON cd.[DocumentId] = i.[DocumentId]; + END +END; + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/extension-mapping.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/extension-mapping.sql new file mode 100644 index 000000000..a582fc76e --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/extension-mapping.sql @@ -0,0 +1,196 @@ +CREATE SCHEMA IF NOT EXISTS "edfi"; +CREATE SCHEMA IF NOT EXISTS "sample"; + +CREATE TABLE IF NOT EXISTS "edfi"."School" +( + "DocumentId" bigint NOT NULL, + "SchoolId" integer NOT NULL, + CONSTRAINT "PK_School" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."SchoolAddress" +( + "DocumentId" bigint NOT NULL, + "AddressOrdinal" integer NOT NULL, + "Street" varchar(100) NOT NULL, + CONSTRAINT "PK_SchoolAddress" PRIMARY KEY ("DocumentId", "AddressOrdinal") +); + +CREATE TABLE IF NOT EXISTS "sample"."SchoolExtension" +( + "DocumentId" bigint NOT NULL, + "ExtensionData" varchar(200) NULL, + CONSTRAINT "PK_SchoolExtension" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "sample"."SchoolAddressExtension" +( + "DocumentId" bigint NOT NULL, + "AddressOrdinal" integer NOT NULL, + "AddressExtensionData" varchar(100) NULL, + CONSTRAINT "PK_SchoolAddressExtension" PRIMARY KEY ("DocumentId", "AddressOrdinal") +); + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_SchoolAddress_School' + AND conrelid = to_regclass('"edfi"."SchoolAddress"') + ) + THEN + ALTER TABLE "edfi"."SchoolAddress" + ADD CONSTRAINT "FK_SchoolAddress_School" + FOREIGN KEY ("DocumentId") + REFERENCES "edfi"."School" ("DocumentId") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_SchoolExtension_School' + AND conrelid = to_regclass('"sample"."SchoolExtension"') + ) + THEN + ALTER TABLE "sample"."SchoolExtension" + ADD CONSTRAINT "FK_SchoolExtension_School" + FOREIGN KEY ("DocumentId") + REFERENCES "edfi"."School" ("DocumentId") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_SchoolAddressExtension_SchoolAddress' + AND conrelid = to_regclass('"sample"."SchoolAddressExtension"') + ) + THEN + ALTER TABLE "sample"."SchoolAddressExtension" + ADD CONSTRAINT "FK_SchoolAddressExtension_SchoolAddress" + FOREIGN KEY ("DocumentId", "AddressOrdinal") + REFERENCES "edfi"."SchoolAddress" ("DocumentId", "AddressOrdinal") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_Stamp" ON "edfi"."School"; +CREATE TRIGGER "TR_School_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_SchoolAddress_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_SchoolAddress_Stamp" ON "edfi"."SchoolAddress"; +CREATE TRIGGER "TR_SchoolAddress_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."SchoolAddress" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_SchoolAddress_Stamp"(); + +CREATE OR REPLACE FUNCTION "sample"."TF_TR_SchoolAddressExtension_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_SchoolAddressExtension_Stamp" ON "sample"."SchoolAddressExtension"; +CREATE TRIGGER "TR_SchoolAddressExtension_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "sample"."SchoolAddressExtension" +FOR EACH ROW +EXECUTE FUNCTION "sample"."TF_TR_SchoolAddressExtension_Stamp"(); + +CREATE OR REPLACE FUNCTION "sample"."TF_TR_SchoolExtension_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_SchoolExtension_Stamp" ON "sample"."SchoolExtension"; +CREATE TRIGGER "TR_SchoolExtension_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "sample"."SchoolExtension" +FOR EACH ROW +EXECUTE FUNCTION "sample"."TF_TR_SchoolExtension_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 1; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiSchool' || '$$.schoolId=' || NEW."SchoolId"::text), NEW."DocumentId", 1); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_ReferentialIdentity" ON "edfi"."School"; +CREATE TRIGGER "TR_School_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"(); + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/fk-support-index.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/fk-support-index.sql new file mode 100644 index 000000000..af2351e1e --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/fk-support-index.sql @@ -0,0 +1,90 @@ +CREATE SCHEMA IF NOT EXISTS "edfi"; + +CREATE TABLE IF NOT EXISTS "edfi"."School" +( + "DocumentId" bigint NOT NULL, + "SchoolId" integer NOT NULL, + CONSTRAINT "PK_School" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."Enrollment" +( + "DocumentId" bigint NOT NULL, + "EnrollmentId" integer NOT NULL, + "SchoolId" integer NOT NULL, + CONSTRAINT "PK_Enrollment" PRIMARY KEY ("DocumentId") +); + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_Enrollment_School' + AND conrelid = to_regclass('"edfi"."Enrollment"') + ) + THEN + ALTER TABLE "edfi"."Enrollment" + ADD CONSTRAINT "FK_Enrollment_School" + FOREIGN KEY ("SchoolId") + REFERENCES "edfi"."School" ("SchoolId") + ON DELETE NO ACTION + ON UPDATE NO ACTION; + END IF; +END $$; + +CREATE INDEX IF NOT EXISTS "edfi"."IX_Enrollment_SchoolId" ON "edfi"."Enrollment" ("SchoolId"); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_Stamp" ON "edfi"."School"; +CREATE TRIGGER "TR_School_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_Enrollment_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."EnrollmentId" IS DISTINCT FROM NEW."EnrollmentId" OR OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_Enrollment_Stamp" ON "edfi"."Enrollment"; +CREATE TRIGGER "TR_Enrollment_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."Enrollment" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_Enrollment_Stamp"(); + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/identity-propagation.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/identity-propagation.sql new file mode 100644 index 000000000..76e767ede --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/identity-propagation.sql @@ -0,0 +1,130 @@ +CREATE SCHEMA IF NOT EXISTS "edfi"; + +CREATE TABLE IF NOT EXISTS "edfi"."School" +( + "DocumentId" bigint NOT NULL, + "SchoolId" integer NOT NULL, + CONSTRAINT "PK_School" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."StudentSchoolAssociation" +( + "DocumentId" bigint NOT NULL, + "School_DocumentId" bigint NOT NULL, + "SchoolId" integer NOT NULL, + "StudentUniqueId" varchar(32) NOT NULL, + "EntryDate" date NOT NULL, + "EntryTimestamp" timestamp with time zone NOT NULL, + "IsActive" boolean NOT NULL, + CONSTRAINT "PK_StudentSchoolAssociation" PRIMARY KEY ("DocumentId") +); + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_StudentSchoolAssociation_School' + AND conrelid = to_regclass('"edfi"."StudentSchoolAssociation"') + ) + THEN + ALTER TABLE "edfi"."StudentSchoolAssociation" + ADD CONSTRAINT "FK_StudentSchoolAssociation_School" + FOREIGN KEY ("School_DocumentId") + REFERENCES "edfi"."School" ("DocumentId") + ON DELETE NO ACTION + ON UPDATE NO ACTION; + END IF; +END $$; + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_Stamp" ON "edfi"."School"; +CREATE TRIGGER "TR_School_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 1; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiSchool' || '$$.schoolId=' || NEW."SchoolId"::text), NEW."DocumentId", 1); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_ReferentialIdentity" ON "edfi"."School"; +CREATE TRIGGER "TR_School_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_StudentSchoolAssociation_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId" OR OLD."StudentUniqueId" IS DISTINCT FROM NEW."StudentUniqueId" OR OLD."EntryDate" IS DISTINCT FROM NEW."EntryDate" OR OLD."EntryTimestamp" IS DISTINCT FROM NEW."EntryTimestamp" OR OLD."IsActive" IS DISTINCT FROM NEW."IsActive") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_StudentSchoolAssociation_Stamp" ON "edfi"."StudentSchoolAssociation"; +CREATE TRIGGER "TR_StudentSchoolAssociation_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."StudentSchoolAssociation" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_StudentSchoolAssociation_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_StudentSchoolAssociation_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId" OR OLD."StudentUniqueId" IS DISTINCT FROM NEW."StudentUniqueId" OR OLD."EntryDate" IS DISTINCT FROM NEW."EntryDate" OR OLD."EntryTimestamp" IS DISTINCT FROM NEW."EntryTimestamp" OR OLD."IsActive" IS DISTINCT FROM NEW."IsActive") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 2; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiStudentSchoolAssociation' || '$$.schoolReference.schoolId=' || NEW."SchoolId"::text || '#' || '$$.studentReference.studentUniqueId=' || NEW."StudentUniqueId"::text || '#' || '$$.entryDate=' || NEW."EntryDate"::text || '#' || '$$.entryTimestamp=' || to_char(NEW."EntryTimestamp", 'YYYY-MM-DD"T"HH24:MI:SS') || '#' || '$$.isActive=' || NEW."IsActive"::text), NEW."DocumentId", 2); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_StudentSchoolAssociation_ReferentialIdentity" ON "edfi"."StudentSchoolAssociation"; +CREATE TRIGGER "TR_StudentSchoolAssociation_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."StudentSchoolAssociation" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_StudentSchoolAssociation_ReferentialIdentity"(); + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/key-unification.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/key-unification.sql new file mode 100644 index 000000000..fd447770e --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/key-unification.sql @@ -0,0 +1,148 @@ +CREATE SCHEMA IF NOT EXISTS "edfi"; + +CREATE TABLE IF NOT EXISTS "edfi"."School" +( + "DocumentId" bigint NOT NULL, + "SchoolId" integer NOT NULL, + CONSTRAINT "PK_School" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."CourseRegistration" +( + "DocumentId" bigint NOT NULL, + "CourseOffering_DocumentId" bigint NOT NULL, + "School_DocumentId" bigint NOT NULL, + "CourseOffering_SchoolId" integer GENERATED ALWAYS AS (CASE WHEN "CourseOffering_DocumentId" IS NULL THEN NULL ELSE "SchoolId_Unified" END) STORED, + "CourseOffering_LocalCourseCode" varchar(60) NOT NULL, + "School_SchoolId" integer GENERATED ALWAYS AS (CASE WHEN "School_DocumentId" IS NULL THEN NULL ELSE "SchoolId_Unified" END) STORED, + "RegistrationDate" date NOT NULL, + "SchoolId_Unified" integer NOT NULL, + CONSTRAINT "PK_CourseRegistration" PRIMARY KEY ("DocumentId") +); + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_CourseRegistration_CourseOffering' + AND conrelid = to_regclass('"edfi"."CourseRegistration"') + ) + THEN + ALTER TABLE "edfi"."CourseRegistration" + ADD CONSTRAINT "FK_CourseRegistration_CourseOffering" + FOREIGN KEY ("CourseOffering_DocumentId") + REFERENCES "edfi"."CourseOffering" ("DocumentId") + ON DELETE NO ACTION + ON UPDATE NO ACTION; + END IF; +END $$; + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_CourseRegistration_School' + AND conrelid = to_regclass('"edfi"."CourseRegistration"') + ) + THEN + ALTER TABLE "edfi"."CourseRegistration" + ADD CONSTRAINT "FK_CourseRegistration_School" + FOREIGN KEY ("School_DocumentId") + REFERENCES "edfi"."School" ("DocumentId") + ON DELETE NO ACTION + ON UPDATE NO ACTION; + END IF; +END $$; + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_Stamp" ON "edfi"."School"; +CREATE TRIGGER "TR_School_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 1; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiSchool' || '$$.schoolId=' || NEW."SchoolId"::text), NEW."DocumentId", 1); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_ReferentialIdentity" ON "edfi"."School"; +CREATE TRIGGER "TR_School_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_CourseRegistration_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId_Unified" IS DISTINCT FROM NEW."SchoolId_Unified" OR OLD."CourseOffering_LocalCourseCode" IS DISTINCT FROM NEW."CourseOffering_LocalCourseCode" OR OLD."RegistrationDate" IS DISTINCT FROM NEW."RegistrationDate") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_CourseRegistration_Stamp" ON "edfi"."CourseRegistration"; +CREATE TRIGGER "TR_CourseRegistration_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."CourseRegistration" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_CourseRegistration_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_CourseRegistration_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."SchoolId_Unified" IS DISTINCT FROM NEW."SchoolId_Unified" OR OLD."CourseOffering_LocalCourseCode" IS DISTINCT FROM NEW."CourseOffering_LocalCourseCode" OR OLD."RegistrationDate" IS DISTINCT FROM NEW."RegistrationDate") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 2; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiCourseRegistration' || '$$.courseOfferingReference.schoolId=' || NEW."CourseOffering_SchoolId"::text || '#' || '$$.courseOfferingReference.localCourseCode=' || NEW."CourseOffering_LocalCourseCode"::text || '#' || '$$.schoolReference.schoolId=' || NEW."School_SchoolId"::text || '#' || '$$.registrationDate=' || NEW."RegistrationDate"::text), NEW."DocumentId", 2); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_CourseRegistration_ReferentialIdentity" ON "edfi"."CourseRegistration"; +CREATE TRIGGER "TR_CourseRegistration_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."CourseRegistration" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_CourseRegistration_ReferentialIdentity"(); + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/nested-collections.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/nested-collections.sql new file mode 100644 index 000000000..975fb5700 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/nested-collections.sql @@ -0,0 +1,150 @@ +CREATE SCHEMA IF NOT EXISTS "edfi"; + +CREATE TABLE IF NOT EXISTS "edfi"."School" +( + "DocumentId" bigint NOT NULL, + "SchoolId" integer NOT NULL, + CONSTRAINT "PK_School" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."SchoolAddress" +( + "DocumentId" bigint NOT NULL, + "AddressOrdinal" integer NOT NULL, + "Street" varchar(100) NOT NULL, + CONSTRAINT "PK_SchoolAddress" PRIMARY KEY ("DocumentId", "AddressOrdinal") +); + +CREATE TABLE IF NOT EXISTS "edfi"."SchoolAddressPhoneNumber" +( + "DocumentId" bigint NOT NULL, + "AddressOrdinal" integer NOT NULL, + "PhoneNumberOrdinal" integer NOT NULL, + "PhoneNumber" varchar(20) NOT NULL, + CONSTRAINT "PK_SchoolAddressPhoneNumber" PRIMARY KEY ("DocumentId", "AddressOrdinal", "PhoneNumberOrdinal") +); + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_SchoolAddress_School' + AND conrelid = to_regclass('"edfi"."SchoolAddress"') + ) + THEN + ALTER TABLE "edfi"."SchoolAddress" + ADD CONSTRAINT "FK_SchoolAddress_School" + FOREIGN KEY ("DocumentId") + REFERENCES "edfi"."School" ("DocumentId") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_SchoolAddressPhoneNumber_SchoolAddress' + AND conrelid = to_regclass('"edfi"."SchoolAddressPhoneNumber"') + ) + THEN + ALTER TABLE "edfi"."SchoolAddressPhoneNumber" + ADD CONSTRAINT "FK_SchoolAddressPhoneNumber_SchoolAddress" + FOREIGN KEY ("DocumentId", "AddressOrdinal") + REFERENCES "edfi"."SchoolAddress" ("DocumentId", "AddressOrdinal") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_Stamp" ON "edfi"."School"; +CREATE TRIGGER "TR_School_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_SchoolAddress_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_SchoolAddress_Stamp" ON "edfi"."SchoolAddress"; +CREATE TRIGGER "TR_SchoolAddress_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."SchoolAddress" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_SchoolAddress_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_SchoolAddressPhoneNumber_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_SchoolAddressPhoneNumber_Stamp" ON "edfi"."SchoolAddressPhoneNumber"; +CREATE TRIGGER "TR_SchoolAddressPhoneNumber_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."SchoolAddressPhoneNumber" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_SchoolAddressPhoneNumber_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."SchoolId" IS DISTINCT FROM NEW."SchoolId") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 1; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiSchool' || '$$.schoolId=' || NEW."SchoolId"::text), NEW."DocumentId", 1); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_ReferentialIdentity" ON "edfi"."School"; +CREATE TRIGGER "TR_School_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"(); + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/polymorphic-abstract.sql b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/polymorphic-abstract.sql new file mode 100644 index 000000000..76930009a --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/Fixtures/ddl-emission/expected/pgsql/polymorphic-abstract.sql @@ -0,0 +1,221 @@ +CREATE SCHEMA IF NOT EXISTS "edfi"; + +CREATE TABLE IF NOT EXISTS "edfi"."School" +( + "DocumentId" bigint NOT NULL, + "EducationOrganizationId" integer NOT NULL, + CONSTRAINT "PK_School" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."LocalEducationAgency" +( + "DocumentId" bigint NOT NULL, + "EducationOrganizationId" integer NOT NULL, + CONSTRAINT "PK_LocalEducationAgency" PRIMARY KEY ("DocumentId") +); + +CREATE TABLE IF NOT EXISTS "edfi"."EducationOrganizationIdentity" +( + "DocumentId" bigint NOT NULL, + "EducationOrganizationId" integer NOT NULL, + "Discriminator" varchar(50) NOT NULL, + CONSTRAINT "PK_EducationOrganizationIdentity" PRIMARY KEY ("DocumentId") +); + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_School_EducationOrganizationIdentity' + AND conrelid = to_regclass('"edfi"."School"') + ) + THEN + ALTER TABLE "edfi"."School" + ADD CONSTRAINT "FK_School_EducationOrganizationIdentity" + FOREIGN KEY ("DocumentId") + REFERENCES "edfi"."EducationOrganizationIdentity" ("DocumentId") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_LocalEducationAgency_EducationOrganizationIdentity' + AND conrelid = to_regclass('"edfi"."LocalEducationAgency"') + ) + THEN + ALTER TABLE "edfi"."LocalEducationAgency" + ADD CONSTRAINT "FK_LocalEducationAgency_EducationOrganizationIdentity" + FOREIGN KEY ("DocumentId") + REFERENCES "edfi"."EducationOrganizationIdentity" ("DocumentId") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conname = 'FK_EducationOrganizationIdentity_Document' + AND conrelid = to_regclass('"edfi"."EducationOrganizationIdentity"') + ) + THEN + ALTER TABLE "edfi"."EducationOrganizationIdentity" + ADD CONSTRAINT "FK_EducationOrganizationIdentity_Document" + FOREIGN KEY ("DocumentId") + REFERENCES "dms"."Document" ("DocumentId") + ON DELETE CASCADE + ON UPDATE NO ACTION; + END IF; +END $$; + +CREATE OR REPLACE VIEW "edfi"."EducationOrganization_View" AS +SELECT "DocumentId" AS "DocumentId", "EducationOrganizationId" AS "EducationOrganizationId", 'Ed-Fi:School'::varchar(50) AS "Discriminator" +FROM "edfi"."School" +UNION ALL +SELECT "DocumentId" AS "DocumentId", "EducationOrganizationId" AS "EducationOrganizationId", 'Ed-Fi:LocalEducationAgency'::varchar(50) AS "Discriminator" +FROM "edfi"."LocalEducationAgency" +; + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_LocalEducationAgency_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."EducationOrganizationId" IS DISTINCT FROM NEW."EducationOrganizationId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_LocalEducationAgency_Stamp" ON "edfi"."LocalEducationAgency"; +CREATE TRIGGER "TR_LocalEducationAgency_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."LocalEducationAgency" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_LocalEducationAgency_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_LocalEducationAgency_AbstractIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."EducationOrganizationId" IS DISTINCT FROM NEW."EducationOrganizationId") THEN + INSERT INTO "edfi"."EducationOrganizationIdentity" ("DocumentId", "EducationOrganizationId", "Discriminator") + VALUES (NEW."DocumentId", NEW."EducationOrganizationId", 'Ed-Fi:LocalEducationAgency') + ON CONFLICT ("DocumentId") + DO UPDATE SET "EducationOrganizationId" = EXCLUDED."EducationOrganizationId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_LocalEducationAgency_AbstractIdentity" ON "edfi"."LocalEducationAgency"; +CREATE TRIGGER "TR_LocalEducationAgency_AbstractIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."LocalEducationAgency" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_LocalEducationAgency_AbstractIdentity"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_LocalEducationAgency_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."EducationOrganizationId" IS DISTINCT FROM NEW."EducationOrganizationId") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 3; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiLocalEducationAgency' || '$$.educationOrganizationId=' || NEW."EducationOrganizationId"::text), NEW."DocumentId", 3); + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 1; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiEducationOrganization' || '$$.educationOrganizationId=' || NEW."EducationOrganizationId"::text), NEW."DocumentId", 1); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_LocalEducationAgency_ReferentialIdentity" ON "edfi"."LocalEducationAgency"; +CREATE TRIGGER "TR_LocalEducationAgency_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."LocalEducationAgency" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_LocalEducationAgency_ReferentialIdentity"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_Stamp"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'DELETE' THEN + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = OLD."DocumentId"; + RETURN OLD; + END IF; + UPDATE "dms"."Document" + SET "ContentVersion" = nextval('"dms"."ChangeVersionSequence"'), "ContentLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + IF TG_OP = 'UPDATE' AND (OLD."EducationOrganizationId" IS DISTINCT FROM NEW."EducationOrganizationId") THEN + UPDATE "dms"."Document" + SET "IdentityVersion" = nextval('"dms"."ChangeVersionSequence"'), "IdentityLastModifiedAt" = now() + WHERE "DocumentId" = NEW."DocumentId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_Stamp" ON "edfi"."School"; +CREATE TRIGGER "TR_School_Stamp" +BEFORE INSERT OR UPDATE OR DELETE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_Stamp"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_AbstractIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."EducationOrganizationId" IS DISTINCT FROM NEW."EducationOrganizationId") THEN + INSERT INTO "edfi"."EducationOrganizationIdentity" ("DocumentId", "EducationOrganizationId", "Discriminator") + VALUES (NEW."DocumentId", NEW."EducationOrganizationId", 'Ed-Fi:School') + ON CONFLICT ("DocumentId") + DO UPDATE SET "EducationOrganizationId" = EXCLUDED."EducationOrganizationId"; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_AbstractIdentity" ON "edfi"."School"; +CREATE TRIGGER "TR_School_AbstractIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_AbstractIdentity"(); + +CREATE OR REPLACE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"() +RETURNS TRIGGER AS $$ +BEGIN + IF TG_OP = 'INSERT' OR (OLD."EducationOrganizationId" IS DISTINCT FROM NEW."EducationOrganizationId") THEN + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 2; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiSchool' || '$$.educationOrganizationId=' || NEW."EducationOrganizationId"::text), NEW."DocumentId", 2); + DELETE FROM "dms"."ReferentialIdentity" + WHERE "DocumentId" = NEW."DocumentId" AND "ResourceKeyId" = 1; + INSERT INTO "dms"."ReferentialIdentity" ("ReferentialId", "DocumentId", "ResourceKeyId") + VALUES ("dms"."uuidv5"('edf1edf1-3df1-3df1-3df1-3df1edf1edf1'::uuid, 'Ed-FiEducationOrganization' || '$$.educationOrganizationId=' || NEW."EducationOrganizationId"::text), NEW."DocumentId", 1); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +DROP TRIGGER IF EXISTS "TR_School_ReferentialIdentity" ON "edfi"."School"; +CREATE TRIGGER "TR_School_ReferentialIdentity" +BEFORE INSERT OR UPDATE ON "edfi"."School" +FOR EACH ROW +EXECUTE FUNCTION "edfi"."TF_TR_School_ReferentialIdentity"(); + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/MssqlDialectTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/MssqlDialectTests.cs index f96fb78df..3c4b14aed 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/MssqlDialectTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/MssqlDialectTests.cs @@ -157,7 +157,7 @@ public void It_should_render_nvarchar_with_length() } [TestFixture] -public class Given_MssqlDialect_Rendering_String_Type_Without_Length +public class Given_MssqlDialect_Rendering_Unbounded_String_Type { private string _rendered = default!; @@ -170,9 +170,9 @@ public void Setup() } [Test] - public void It_should_render_nvarchar_without_length() + public void It_should_render_nvarchar_max() { - _rendered.Should().Be("nvarchar"); + _rendered.Should().Be("nvarchar(max)"); } } @@ -449,18 +449,6 @@ public void Setup() _dialect = new MssqlDialect(new MssqlDialectRules()); } - [Test] - public void It_should_use_create_or_alter_for_triggers() - { - _dialect.TriggerCreationPattern.Should().Be(DdlPattern.CreateOrAlter); - } - - [Test] - public void It_should_use_create_or_alter_for_functions() - { - _dialect.FunctionCreationPattern.Should().Be(DdlPattern.CreateOrAlter); - } - [Test] public void It_should_use_create_or_alter_for_views() { diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/PgsqlDialectTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/PgsqlDialectTests.cs index 68e88d88b..470bcad67 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/PgsqlDialectTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/PgsqlDialectTests.cs @@ -406,18 +406,6 @@ public void Setup() _dialect = new PgsqlDialect(new PgsqlDialectRules()); } - [Test] - public void It_should_use_drop_then_create_for_triggers() - { - _dialect.TriggerCreationPattern.Should().Be(DdlPattern.DropThenCreate); - } - - [Test] - public void It_should_use_create_or_replace_for_functions() - { - _dialect.FunctionCreationPattern.Should().Be(DdlPattern.CreateOrReplace); - } - [Test] public void It_should_use_create_or_replace_for_views() { diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/RelationalModelDdlEmitterTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/RelationalModelDdlEmitterTests.cs index 59dfa9165..d1ceaebe7 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/RelationalModelDdlEmitterTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/RelationalModelDdlEmitterTests.cs @@ -9,284 +9,1691 @@ namespace EdFi.DataManagementService.Backend.Ddl.Tests.Unit; +// ═══════════════════════════════════════════════════════════════════ +// Phase Ordering Tests +// ═══════════════════════════════════════════════════════════════════ + [TestFixture] -public class Given_Pgsql_Ddl_Emitter_With_Primary_Key_Constraint_Name +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Foreign_Keys { - private string _sql = default!; + private string _ddl = default!; [SetUp] public void Setup() { - var dialectRules = new PgsqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = PrimaryKeyFixture.Build(dialectRules.Dialect, "PK_School"); + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = ForeignKeyFixture.Build(dialect.Rules.Dialect); - _sql = emitter.Emit(modelSet); + _ddl = emitter.Emit(modelSet); } [Test] - public void It_should_emit_named_primary_key_constraint() + public void It_should_emit_schemas_first() { - _sql.Should().Contain("CONSTRAINT \"PK_School\" PRIMARY KEY (\"DocumentId\")"); + _ddl.Should().Contain("CREATE SCHEMA IF NOT EXISTS"); + } + + [Test] + public void It_should_emit_foreign_keys_after_tables() + { + // RelationalModelDdlEmitter does not emit phase comment markers (unlike CoreDdlEmitter). + // We verify ordering by finding first occurrence of each DDL construct. + var schemaIndex = _ddl.IndexOf("CREATE SCHEMA"); + var tableIndex = _ddl.IndexOf("CREATE TABLE"); + var fkIndex = _ddl.IndexOf("ALTER TABLE"); + + // First verify each construct is present + schemaIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE SCHEMA in DDL"); + tableIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE TABLE in DDL"); + fkIndex.Should().BeGreaterOrEqualTo(0, "expected ALTER TABLE in DDL"); + + // Then verify ordering: schemas before tables, tables before FKs + schemaIndex.Should().BeLessThan(tableIndex); + tableIndex.Should().BeLessThan(fkIndex); + } + + [Test] + public void It_should_not_include_foreign_keys_in_create_table() + { + var createTableEndIndex = _ddl.IndexOf(");", _ddl.IndexOf("CREATE TABLE")); + var firstFkIndex = _ddl.IndexOf("FOREIGN KEY"); + + firstFkIndex.Should().BeGreaterOrEqualTo(0, "expected at least one FOREIGN KEY in emitted DDL"); + firstFkIndex.Should().BeGreaterThan(createTableEndIndex); + } + + [Test] + public void It_should_emit_foreign_keys_with_alter_table() + { + _ddl.Should().Contain("ALTER TABLE"); + _ddl.Should().Contain("ADD CONSTRAINT"); + _ddl.Should().Contain("FOREIGN KEY"); + _ddl.Should().Contain("REFERENCES"); } } [TestFixture] -public class Given_Mssql_Ddl_Emitter_With_Primary_Key_Constraint_Name +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Foreign_Keys { - private string _sql = default!; + private string _ddl = default!; [SetUp] public void Setup() { - var dialectRules = new MssqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = PrimaryKeyFixture.Build(dialectRules.Dialect, "PK_School"); + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = ForeignKeyFixture.Build(dialect.Rules.Dialect); - _sql = emitter.Emit(modelSet); + _ddl = emitter.Emit(modelSet); } [Test] - public void It_should_emit_named_primary_key_constraint() + public void It_should_emit_foreign_keys_after_tables() { - _sql.Should().Contain("CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId])"); + var tableIndex = _ddl.IndexOf("CREATE TABLE"); + var fkIndex = _ddl.IndexOf("ALTER TABLE"); + + tableIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE TABLE in DDL"); + fkIndex.Should().BeGreaterOrEqualTo(0, "expected ALTER TABLE in DDL"); + tableIndex.Should().BeLessThan(fkIndex); + } + + [Test] + public void It_should_not_include_foreign_keys_in_create_table() + { + var createTableEndIndex = _ddl.IndexOf(");", _ddl.IndexOf("CREATE TABLE")); + var firstFkIndex = _ddl.IndexOf("FOREIGN KEY"); + + firstFkIndex.Should().BeGreaterOrEqualTo(0, "expected at least one FOREIGN KEY in emitted DDL"); + firstFkIndex.Should().BeGreaterThan(createTableEndIndex); + } + + [Test] + public void It_should_emit_schemas_first() + { + // MSSQL uses IF NOT EXISTS pattern wrapped in EXEC + _ddl.Should().Contain("CREATE SCHEMA"); + } + + [Test] + public void It_should_emit_foreign_keys_with_alter_table() + { + _ddl.Should().Contain("ALTER TABLE"); + _ddl.Should().Contain("ADD CONSTRAINT"); + _ddl.Should().Contain("FOREIGN KEY"); + _ddl.Should().Contain("REFERENCES"); } } +// ═══════════════════════════════════════════════════════════════════ +// Unbounded String Tests +// ═══════════════════════════════════════════════════════════════════ + [TestFixture] -public class Given_Pgsql_Ddl_Emitter_With_Null_Or_True_Constraint +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Unbounded_String { - private string _sql = default!; + private string _ddl = default!; [SetUp] public void Setup() { - var dialectRules = new PgsqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = NullOrTrueFixture.Build(dialectRules.Dialect); + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = UnboundedStringFixture.Build(dialect.Rules.Dialect); - _sql = emitter.Emit(modelSet); + _ddl = emitter.Emit(modelSet); } [Test] - public void It_should_emit_pgsql_null_or_true_check_expression() + public void It_should_emit_varchar_without_max_suffix() { - _sql.Should() - .Contain( - "CONSTRAINT \"CK_School_FiscalYear_Present_NullOrTrue\" CHECK (\"FiscalYear_Present\" IS NULL OR \"FiscalYear_Present\" = TRUE)" - ); + _ddl.Should().Contain("\"UnboundedColumn\" varchar NOT NULL"); + } + + [Test] + public void It_should_not_emit_varchar_max_for_postgresql() + { + _ddl.Should().NotContain("varchar(max)"); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Unbounded_String +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = UnboundedStringFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_nvarchar_max_for_unbounded_string() + { + _ddl.Should().Contain("[UnboundedColumn] nvarchar(max) NOT NULL"); + } + + [Test] + public void It_should_not_emit_bare_nvarchar() + { + _ddl.Should().NotContain("nvarchar NOT NULL"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Abstract Identity Table Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Abstract_Identity_Table +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AbstractIdentityTableFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_abstract_identity_table() + { + _ddl.Should().Contain("CREATE TABLE IF NOT EXISTS \"edfi\".\"EducationOrganizationIdentity\""); + } + + [Test] + public void It_should_include_discriminator_column() + { + _ddl.Should().Contain("\"Discriminator\""); + } + + [Test] + public void It_should_include_primary_key() + { + _ddl.Should().Contain("PRIMARY KEY"); + } + + [Test] + public void It_should_include_discriminator_as_not_null() + { + // Discriminator column must be NOT NULL to ensure every row identifies its concrete type. + _ddl.Should().MatchRegex(@"""Discriminator""\s+\w+.*NOT NULL"); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Abstract_Identity_Table +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AbstractIdentityTableFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_abstract_identity_table() + { + // MSSQL uses IF OBJECT_ID for table existence check + _ddl.Should().Contain("[EducationOrganizationIdentity]"); + _ddl.Should().Contain("IF OBJECT_ID"); + } + + [Test] + public void It_should_include_discriminator_column() + { + _ddl.Should().Contain("[Discriminator]"); + } + + [Test] + public void It_should_include_primary_key() + { + _ddl.Should().Contain("PRIMARY KEY"); + } + + [Test] + public void It_should_include_discriminator_as_not_null() + { + // Discriminator column must be NOT NULL to ensure every row identifies its concrete type. + _ddl.Should().MatchRegex(@"\[Discriminator\]\s+\w+.*NOT NULL"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Abstract Union View Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Abstract_Union_View +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AbstractUnionViewFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_create_or_replace_view() + { + _ddl.Should().Contain("CREATE OR REPLACE VIEW"); + } + + [Test] + public void It_should_include_union_all() + { + _ddl.Should().Contain("UNION ALL"); + } + + [Test] + public void It_should_include_all_union_arms() + { + // Both concrete table names should appear in the view's FROM clauses + _ddl.Should().Contain("\"School\""); + _ddl.Should().Contain("\"LocalEducationAgency\""); + } + + [Test] + public void It_should_emit_views_after_tables_and_indexes() + { + var tableIndex = _ddl.IndexOf("CREATE TABLE"); + var viewIndex = _ddl.IndexOf("CREATE OR REPLACE VIEW"); + + tableIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE TABLE in DDL"); + viewIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE OR REPLACE VIEW in DDL"); + viewIndex.Should().BeGreaterThan(tableIndex); + } + + [Test] + public void It_should_emit_discriminator_literal_with_postgresql_cast() + { + _ddl.Should().Contain("'School'::varchar"); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Abstract_Union_View +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AbstractUnionViewFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_create_or_alter_view() + { + _ddl.Should().Contain("CREATE OR ALTER VIEW"); + } + + [Test] + public void It_should_include_union_all() + { + _ddl.Should().Contain("UNION ALL"); + } + + [Test] + public void It_should_include_all_union_arms() + { + // Both concrete table names should appear in the view's FROM clauses + _ddl.Should().Contain("[School]"); + _ddl.Should().Contain("[LocalEducationAgency]"); + } + + [Test] + public void It_should_emit_discriminator_literal_with_sql_server_cast() + { + _ddl.Should().Contain("CAST(N'School' AS nvarchar("); + } + + [Test] + public void It_should_emit_views_after_tables() + { + var tableIndex = _ddl.IndexOf("CREATE TABLE"); + var viewIndex = _ddl.IndexOf("CREATE OR ALTER VIEW"); + + tableIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE TABLE in DDL"); + viewIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE OR ALTER VIEW in DDL"); + viewIndex.Should().BeGreaterThan(tableIndex); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Unbounded_String_In_Union_View +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = UnboundedStringUnionViewFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_unbounded_string_cast_with_nvarchar_max() + { + // MssqlDialect.RenderColumnType should emit nvarchar(max) for unbounded strings + _ddl.Should().Contain("CAST(N'TestValue' AS nvarchar(max))"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Abstract Identity Table FK Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Abstract_Identity_Table_FK +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AbstractIdentityTableFkFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_fk_from_abstract_identity_table_to_dms_document() + { + // Design requirement: abstract identity tables must have FK to dms.Document + _ddl.Should().Contain("FK_TestIdentity_Document"); + _ddl.Should().Contain("REFERENCES \"dms\".\"Document\""); + } + + [Test] + public void It_should_emit_abstract_identity_table_fk_in_phase_4() + { + // FK emission for abstract identity tables should come after table creation + var tableIndex = _ddl.IndexOf("CREATE TABLE IF NOT EXISTS \"edfi\".\"TestIdentity\""); + var fkIndex = _ddl.IndexOf("FK_TestIdentity_Document"); + + tableIndex.Should().BeGreaterOrEqualTo(0, "expected identity table CREATE TABLE in DDL"); + fkIndex.Should().BeGreaterOrEqualTo(0, "expected identity table FK in DDL"); + fkIndex.Should().BeGreaterThan(tableIndex); + } + + [Test] + public void It_should_emit_fk_with_cascade_delete() + { + // Abstract identity table FK to dms.Document must use CASCADE delete + // so rows are cleaned up when the Document is deleted. + _ddl.Should().Contain("ON DELETE CASCADE"); + } + + [Test] + public void It_should_follow_fk_naming_convention() + { + // FK constraint should follow FK_{TableName}_{TargetTableName} convention. + _ddl.Should().MatchRegex(@"CONSTRAINT\s+""FK_TestIdentity_Document"""); } } -[TestFixture] -public class Given_Mssql_Ddl_Emitter_With_Null_Or_True_Constraint -{ - private string _sql = default!; +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Abstract_Identity_Table_FK +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AbstractIdentityTableFkFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_fk_from_abstract_identity_table_to_dms_document() + { + // Design requirement: abstract identity tables must have FK to dms.Document + _ddl.Should().Contain("FK_TestIdentity_Document"); + _ddl.Should().Contain("REFERENCES [dms].[Document]"); + } + + [Test] + public void It_should_emit_abstract_identity_table_fk_in_phase_4() + { + // FK emission for abstract identity tables should come after table creation + var tableIndex = _ddl.IndexOf("CREATE TABLE [edfi].[TestIdentity]"); + var fkIndex = _ddl.IndexOf("FK_TestIdentity_Document"); + + tableIndex.Should().BeGreaterOrEqualTo(0, "expected identity table CREATE TABLE in DDL"); + fkIndex.Should().BeGreaterOrEqualTo(0, "expected identity table FK in DDL"); + fkIndex.Should().BeGreaterThan(tableIndex); + } + + [Test] + public void It_should_emit_fk_with_cascade_delete() + { + // Abstract identity table FK to dms.Document must use CASCADE delete + // so rows are cleaned up when the Document is deleted. + _ddl.Should().Contain("ON DELETE CASCADE"); + } + + [Test] + public void It_should_follow_fk_naming_convention() + { + // FK constraint should follow FK_{TableName}_{TargetTableName} convention. + _ddl.Should().MatchRegex(@"CONSTRAINT\s+\[FK_TestIdentity_Document\]"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// All-Or-None CHECK Constraint Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_AllOrNone_CHECK_Constraint +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AllOrNoneCheckFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_check_constraint_with_bidirectional_all_or_none() + { + // Bidirectional: (all NULL) OR (all NOT NULL) + _ddl.Should().Contain("CHK_Reference_AllOrNone"); + _ddl.Should().Contain("CHECK"); + } + + [Test] + public void It_should_require_fk_null_when_deps_null() + { + // First clause: FK IS NULL AND all deps IS NULL + _ddl.Should().Contain("\"Reference_DocumentId\" IS NULL"); + _ddl.Should().Contain("\"Reference_IdentityPart1\" IS NULL"); + _ddl.Should().Contain("\"Reference_IdentityPart2\" IS NULL"); + } + + [Test] + public void It_should_require_fk_not_null_when_deps_not_null() + { + // Second clause: FK IS NOT NULL AND all deps IS NOT NULL + _ddl.Should().Contain("\"Reference_DocumentId\" IS NOT NULL"); + _ddl.Should().Contain("\"Reference_IdentityPart1\" IS NOT NULL"); + _ddl.Should().Contain("\"Reference_IdentityPart2\" IS NOT NULL"); + } + + [Test] + public void It_should_use_or_between_all_null_and_all_not_null_clauses() + { + // Format: (all NULL) OR (all NOT NULL) + // Use [\s\S]* instead of .* to match across newlines in multiline CHECK expressions + _ddl.Should() + .MatchRegex( + @"IS NULL[\s\S]*AND[\s\S]*IS NULL[\s\S]*\)\s*OR\s*\([\s\S]*IS NOT NULL[\s\S]*AND[\s\S]*IS NOT NULL" + ); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_AllOrNone_CHECK_Constraint +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = AllOrNoneCheckFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_check_constraint_with_bidirectional_all_or_none() + { + // Bidirectional: (all NULL) OR (all NOT NULL) + _ddl.Should().Contain("CHK_Reference_AllOrNone"); + _ddl.Should().Contain("CHECK"); + } + + [Test] + public void It_should_require_fk_null_when_deps_null() + { + // First clause: FK IS NULL AND all deps IS NULL + _ddl.Should().Contain("[Reference_DocumentId] IS NULL"); + _ddl.Should().Contain("[Reference_IdentityPart1] IS NULL"); + _ddl.Should().Contain("[Reference_IdentityPart2] IS NULL"); + } + + [Test] + public void It_should_require_fk_not_null_when_deps_not_null() + { + // Second clause: FK IS NOT NULL AND all deps IS NOT NULL + _ddl.Should().Contain("[Reference_DocumentId] IS NOT NULL"); + _ddl.Should().Contain("[Reference_IdentityPart1] IS NOT NULL"); + _ddl.Should().Contain("[Reference_IdentityPart2] IS NOT NULL"); + } + + [Test] + public void It_should_use_or_between_all_null_and_all_not_null_clauses() + { + // Format: (all NULL) OR (all NOT NULL) + // Use [\s\S]* instead of .* to match across newlines in multiline CHECK expressions + _ddl.Should() + .MatchRegex( + @"IS NULL[\s\S]*AND[\s\S]*IS NULL[\s\S]*\)\s*OR\s*\([\s\S]*IS NOT NULL[\s\S]*AND[\s\S]*IS NOT NULL" + ); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Trigger Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Triggers +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = TriggerFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_trigger_function() + { + _ddl.Should().Contain("CREATE OR REPLACE FUNCTION"); + _ddl.Should().Contain("RETURNS TRIGGER"); + } + + [Test] + public void It_should_emit_trigger_with_drop_then_create_pattern() + { + // Design requires DROP + CREATE pattern, not CREATE OR REPLACE TRIGGER (ddl-generation.md:260-262) + _ddl.Should().Contain("DROP TRIGGER IF EXISTS"); + _ddl.Should().Contain("CREATE TRIGGER"); + _ddl.Should().NotContain("CREATE OR REPLACE TRIGGER"); + _ddl.Should().Contain("EXECUTE FUNCTION"); + } + + [Test] + public void It_should_emit_plpgsql_language() + { + _ddl.Should().Contain("$$ LANGUAGE plpgsql"); + } + + [Test] + public void It_should_emit_return_new() + { + _ddl.Should().Contain("RETURN NEW;"); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Triggers +{ + private string _ddl = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = TriggerFixture.Build(dialect.Rules.Dialect); + + _ddl = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_create_or_alter_trigger() + { + _ddl.Should().Contain("CREATE OR ALTER TRIGGER"); + } + + [Test] + public void It_should_emit_after_insert_update() + { + _ddl.Should().Contain("AFTER INSERT, UPDATE"); + } + + [Test] + public void It_should_emit_set_nocount_on() + { + _ddl.Should().Contain("SET NOCOUNT ON;"); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Determinism Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Pgsql_Emitting_Twice +{ + private string _first = default!; + private string _second = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var modelSet = ForeignKeyFixture.Build(dialect.Rules.Dialect); + + // Use separate emitter instances to prove construction + emission is stateless + var emitter1 = new RelationalModelDdlEmitter(dialect); + var emitter2 = new RelationalModelDdlEmitter(dialect); + + _first = emitter1.Emit(modelSet); + _second = emitter2.Emit(modelSet); + } + + [Test] + public void It_should_produce_byte_for_byte_identical_output() + { + _first.Should().Be(_second); + } +} + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Mssql_Emitting_Twice +{ + private string _first = default!; + private string _second = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var modelSet = ForeignKeyFixture.Build(dialect.Rules.Dialect); + + // Use separate emitter instances to prove construction + emission is stateless + var emitter1 = new RelationalModelDdlEmitter(dialect); + var emitter2 = new RelationalModelDdlEmitter(dialect); + + _first = emitter1.Emit(modelSet); + _second = emitter2.Emit(modelSet); + } + + [Test] + public void It_should_produce_byte_for_byte_identical_output() + { + _first.Should().Be(_second); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Component-Level Ordering Stability Tests +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_RelationalModelDdlEmitter_With_Multiple_Schemas_Emitting_Twice +{ + private string _first = default!; + private string _second = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + + // Build fixture with multiple schemas to verify ordering stability + var modelSet = MultiSchemaFixture.Build(dialect.Rules.Dialect); + + var emitter1 = new RelationalModelDdlEmitter(dialect); + var emitter2 = new RelationalModelDdlEmitter(dialect); + + _first = emitter1.Emit(modelSet); + _second = emitter2.Emit(modelSet); + } + + [Test] + public void It_should_produce_identical_output() + { + _first.Should().Be(_second); + } + + [Test] + public void It_should_emit_schemas_in_consistent_order() + { + // Verify schema creation statements appear in a deterministic order + var alphaIndex = _first.IndexOf("\"alpha\""); + var betaIndex = _first.IndexOf("\"beta\""); + + alphaIndex.Should().BeGreaterOrEqualTo(0, "expected alpha schema in DDL"); + betaIndex.Should().BeGreaterOrEqualTo(0, "expected beta schema in DDL"); + + // Alpha should appear before beta (alphabetical order) + alphaIndex.Should().BeLessThan(betaIndex); + } + + [Test] + public void It_should_emit_tables_in_consistent_order_within_schema() + { + // Verify tables within the same schema are emitted in deterministic order + var alphaAaaIndex = _first.IndexOf("\"alpha\".\"Aaa\""); + var alphaBbbIndex = _first.IndexOf("\"alpha\".\"Bbb\""); + + alphaAaaIndex.Should().BeGreaterOrEqualTo(0, "expected alpha.Aaa table in DDL"); + alphaBbbIndex.Should().BeGreaterOrEqualTo(0, "expected alpha.Bbb table in DDL"); + + // Aaa should appear before Bbb (alphabetical order by resource name) + alphaAaaIndex.Should().BeLessThan(alphaBbbIndex); + } +} + +internal static class MultiSchemaFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var alphaSchema = new DbSchemaName("alpha"); + var betaSchema = new DbSchemaName("beta"); + var documentIdColumn = new DbColumnName("DocumentId"); + + var alphaAaaResource = new QualifiedResourceName("Alpha", "Aaa"); + var alphaBbbResource = new QualifiedResourceName("Alpha", "Bbb"); + var betaCccResource = new QualifiedResourceName("Beta", "Ccc"); + + var alphaAaaKey = new ResourceKeyEntry(1, alphaAaaResource, "1.0.0", false); + var alphaBbbKey = new ResourceKeyEntry(2, alphaBbbResource, "1.0.0", false); + var betaCccKey = new ResourceKeyEntry(3, betaCccResource, "1.0.0", false); + + DbTableModel CreateTable(DbSchemaName schema, string tableName) + { + var tableDef = new DbTableName(schema, tableName); + return new DbTableModel( + tableDef, + new JsonPathExpression("$", []), + new TableKey( + $"PK_{tableName}", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + } + + RelationalResourceModel CreateResourceModel( + QualifiedResourceName resource, + DbSchemaName schema, + string tableName + ) + { + var table = CreateTable(schema, tableName); + return new RelationalResourceModel( + resource, + schema, + ResourceStorageKind.RelationalTables, + table, + [table], + [], + [] + ); + } + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 3, + [0x01, 0x02, 0x03], + [ + new SchemaComponentInfo( + "alpha", + "Alpha", + "1.0.0", + false, + "aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000" + ), + new SchemaComponentInfo( + "beta", + "Beta", + "1.0.0", + false, + "bbbb0000bbbb0000bbbb0000bbbb0000bbbb0000bbbb0000bbbb0000bbbb0000" + ), + ], + [alphaAaaKey, alphaBbbKey, betaCccKey] + ), + dialect, + [ + new ProjectSchemaInfo("alpha", "Alpha", "1.0.0", false, alphaSchema), + new ProjectSchemaInfo("beta", "Beta", "1.0.0", false, betaSchema), + ], + [ + new ConcreteResourceModel( + alphaAaaKey, + ResourceStorageKind.RelationalTables, + CreateResourceModel(alphaAaaResource, alphaSchema, "Aaa") + ), + new ConcreteResourceModel( + alphaBbbKey, + ResourceStorageKind.RelationalTables, + CreateResourceModel(alphaBbbResource, alphaSchema, "Bbb") + ), + new ConcreteResourceModel( + betaCccKey, + ResourceStorageKind.RelationalTables, + CreateResourceModel(betaCccResource, betaSchema, "Ccc") + ), + ], + [], + [], + [], + [] + ); + } +} + +// ═══════════════════════════════════════════════════════════════════ +// Basic Tests (existing) +// ═══════════════════════════════════════════════════════════════════ + +[TestFixture] +public class Given_Pgsql_Ddl_Emitter_With_Primary_Key_Constraint_Name +{ + private string _sql = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = PrimaryKeyFixture.Build(dialect.Rules.Dialect, "PK_School"); + + _sql = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_named_primary_key_constraint() + { + _sql.Should().Contain("CONSTRAINT \"PK_School\" PRIMARY KEY (\"DocumentId\")"); + } +} + +[TestFixture] +public class Given_Mssql_Ddl_Emitter_With_Primary_Key_Constraint_Name +{ + private string _sql = default!; + + [SetUp] + public void Setup() + { + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = PrimaryKeyFixture.Build(dialect.Rules.Dialect, "PK_School"); + + _sql = emitter.Emit(modelSet); + } + + [Test] + public void It_should_emit_named_primary_key_constraint() + { + _sql.Should().Contain("CONSTRAINT [PK_School] PRIMARY KEY ([DocumentId])"); + } +} + +internal static class PrimaryKeyFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect, string primaryKeyName) + { + var schema = new DbSchemaName("edfi"); + var tableName = new DbTableName(schema, "School"); + var columnName = new DbColumnName("DocumentId"); + var keyColumn = new DbKeyColumn(columnName, ColumnKind.ParentKeyPart); + var resource = new QualifiedResourceName("Ed-Fi", "School"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); + var table = new DbTableModel( + tableName, + new JsonPathExpression("$", []), + new TableKey(primaryKeyName, [keyColumn]), + [ + new DbColumnModel( + columnName, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + var relationalModel = new RelationalResourceModel( + resource, + schema, + ResourceStorageKind.RelationalTables, + table, + [table], + [], + [] + ); + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [resourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], + [], + [], + [], + [] + ); + } +} + +internal static class ForeignKeyFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var parentTableName = new DbTableName(schema, "School"); + var childTableName = new DbTableName(schema, "SchoolAddress"); + var documentIdColumn = new DbColumnName("DocumentId"); + var schoolIdColumn = new DbColumnName("SchoolId"); + var resource = new QualifiedResourceName("Ed-Fi", "School"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); + + var parentTable = new DbTableModel( + parentTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + var childTable = new DbTableModel( + childTableName, + new JsonPathExpression("$.addresses[*]", []), + new TableKey( + "PK_SchoolAddress", + [ + new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart), + new DbKeyColumn(new DbColumnName("AddressTypeId"), ColumnKind.Scalar), + ] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + new DbColumnName("AddressTypeId"), + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolAddress_School", + [documentIdColumn], + parentTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ); + + var relationalModel = new RelationalResourceModel( + resource, + schema, + ResourceStorageKind.RelationalTables, + parentTable, + [parentTable, childTable], + [], + [] + ); + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [resourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], + [], + [], + [], + [] + ); + } +} + +internal static class UnboundedStringFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var tableName = new DbTableName(schema, "School"); + var documentIdColumn = new DbColumnName("DocumentId"); + var unboundedColumn = new DbColumnName("UnboundedColumn"); + var resource = new QualifiedResourceName("Ed-Fi", "School"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); + + var table = new DbTableModel( + tableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + unboundedColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: null), // Unbounded + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + var relationalModel = new RelationalResourceModel( + resource, + schema, + ResourceStorageKind.RelationalTables, + table, + [table], + [], + [] + ); + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [resourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], + [], + [], + [], + [] + ); + } +} + +internal static class AbstractIdentityTableFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var identityTableName = new DbTableName(schema, "EducationOrganizationIdentity"); + var documentIdColumn = new DbColumnName("DocumentId"); + var discriminatorColumn = new DbColumnName("Discriminator"); + var resource = new QualifiedResourceName("Ed-Fi", "EducationOrganization"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", true); // Abstract + + var identityTable = new DbTableModel( + identityTableName, + new JsonPathExpression("$", []), + new TableKey( + "PK_EducationOrganizationIdentity", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + discriminatorColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 50), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + var abstractIdentityTable = new AbstractIdentityTableInfo(resourceKey, identityTable); + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [resourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [], + [abstractIdentityTable], + [], + [], + [] + ); + } +} + +internal static class AbstractUnionViewFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var schoolTableName = new DbTableName(schema, "School"); + var districtTableName = new DbTableName(schema, "LocalEducationAgency"); + var viewName = new DbTableName(schema, "EducationOrganization"); + var documentIdColumn = new DbColumnName("DocumentId"); + var discriminatorColumn = new DbColumnName("Discriminator"); + + var abstractResource = new QualifiedResourceName("Ed-Fi", "EducationOrganization"); + var schoolResource = new QualifiedResourceName("Ed-Fi", "School"); + var districtResource = new QualifiedResourceName("Ed-Fi", "LocalEducationAgency"); + var abstractResourceKey = new ResourceKeyEntry(1, abstractResource, "1.0.0", true); + var schoolResourceKey = new ResourceKeyEntry(2, schoolResource, "1.0.0", false); + var districtResourceKey = new ResourceKeyEntry(3, districtResource, "1.0.0", false); + + List outputColumns = + [ + new(documentIdColumn, new RelationalScalarType(ScalarKind.Int64), null, null), + new(discriminatorColumn, new RelationalScalarType(ScalarKind.String, MaxLength: 50), null, null), + ]; + + var schoolArm = new AbstractUnionViewArm( + schoolResourceKey, + schoolTableName, + [ + new AbstractUnionViewProjectionExpression.SourceColumn(documentIdColumn), + new AbstractUnionViewProjectionExpression.StringLiteral("School"), + ] + ); + + var districtArm = new AbstractUnionViewArm( + districtResourceKey, + districtTableName, + [ + new AbstractUnionViewProjectionExpression.SourceColumn(documentIdColumn), + new AbstractUnionViewProjectionExpression.StringLiteral("LocalEducationAgency"), + ] + ); + + var unionView = new AbstractUnionViewInfo( + abstractResourceKey, + viewName, + outputColumns, + [schoolArm, districtArm] + ); + + // Create identity table + var identityTable = new DbTableModel( + new DbTableName(schema, "EducationOrganizationIdentity"), + new JsonPathExpression("$", []), + new TableKey( + "PK_EducationOrganizationIdentity", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + discriminatorColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 50), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + var abstractIdentityTable = new AbstractIdentityTableInfo(abstractResourceKey, identityTable); + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 3, + [0x01, 0x02, 0x03], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [abstractResourceKey, schoolResourceKey, districtResourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [], + [abstractIdentityTable], + [unionView], + [], + [] + ); + } +} + +internal static class UnboundedStringUnionViewFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) + { + var schema = new DbSchemaName("edfi"); + var testTableName = new DbTableName(schema, "Test"); + var viewName = new DbTableName(schema, "TestView"); + var documentIdColumn = new DbColumnName("DocumentId"); + var unboundedColumn = new DbColumnName("UnboundedField"); + + var abstractResource = new QualifiedResourceName("Ed-Fi", "TestAbstract"); + var concreteResource = new QualifiedResourceName("Ed-Fi", "Test"); + var abstractResourceKey = new ResourceKeyEntry(1, abstractResource, "1.0.0", true); + var concreteResourceKey = new ResourceKeyEntry(2, concreteResource, "1.0.0", false); - [SetUp] - public void Setup() - { - var dialectRules = new MssqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = NullOrTrueFixture.Build(dialectRules.Dialect); + // Output column with unbounded string (no MaxLength) + List outputColumns = + [ + new(documentIdColumn, new RelationalScalarType(ScalarKind.Int64), null, null), + new(unboundedColumn, new RelationalScalarType(ScalarKind.String), null, null), // No MaxLength = unbounded + ]; - _sql = emitter.Emit(modelSet); - } + var testArm = new AbstractUnionViewArm( + concreteResourceKey, + testTableName, + [ + new AbstractUnionViewProjectionExpression.SourceColumn(documentIdColumn), + new AbstractUnionViewProjectionExpression.StringLiteral("TestValue"), + ] + ); - [Test] - public void It_should_emit_mssql_null_or_true_check_expression() - { - _sql.Should() - .Contain( - "CONSTRAINT [CK_School_FiscalYear_Present_NullOrTrue] CHECK ([FiscalYear_Present] IS NULL OR [FiscalYear_Present] = 1)" - ); + var unionView = new AbstractUnionViewInfo(abstractResourceKey, viewName, outputColumns, [testArm]); + + return new DerivedRelationalModelSet( + new EffectiveSchemaInfo( + "1.0.0", + "1.0.0", + "hash", + 1, + [0x01], + [ + new SchemaComponentInfo( + "ed-fi", + "Ed-Fi", + "1.0.0", + false, + "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" + ), + ], + [abstractResourceKey, concreteResourceKey] + ), + dialect, + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [], + [], + [unionView], + [], + [] + ); } } +// ═══════════════════════════════════════════════════════════════════ +// Extension Table Tests +// ═══════════════════════════════════════════════════════════════════ + [TestFixture] -public class Given_Pgsql_Ddl_Emitter_With_Trigger_Inventory +public class Given_RelationalModelDdlEmitter_With_Pgsql_And_Extension_Tables { - private string _sql = default!; + private string _ddl = default!; [SetUp] public void Setup() { - var dialectRules = new PgsqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = TriggerFixture.Build(dialectRules.Dialect); + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = ExtensionTableFixture.Build(dialect.Rules.Dialect); - _sql = emitter.Emit(modelSet); + _ddl = emitter.Emit(modelSet); } [Test] - public void It_should_emit_triggers_using_TriggerTable_for_all_kinds() + public void It_should_create_core_schema() { - _sql.Should().Contain("CREATE TRIGGER \"TR_School_Stamp\" ON \"edfi\".\"School\" WHEN ("); - _sql.Should() - .Contain("CREATE TRIGGER \"TR_Student_ReferentialIdentity\" ON \"edfi\".\"Student\" WHEN ("); - _sql.Should().Contain("CREATE TRIGGER \"TR_School_AbstractIdentity\" ON \"edfi\".\"School\" WHEN ("); - _sql.Should() - .Contain( - "CREATE TRIGGER \"TR_EducationOrganizationIdentity_PropagateIdentity\" ON \"edfi\".\"EducationOrganizationIdentity\" EXECUTE FUNCTION \"noop\"();" - ); + _ddl.Should().Contain("CREATE SCHEMA IF NOT EXISTS \"edfi\""); } [Test] - public void It_should_not_use_maintenance_target_table_as_trigger_owner() + public void It_should_create_extension_schema() { - _sql.Should() - .NotContain( - "CREATE TRIGGER \"TR_School_AbstractIdentity\" ON \"dms\".\"EducationOrganizationIdentity\"" - ); + _ddl.Should().Contain("CREATE SCHEMA IF NOT EXISTS \"sample\""); } [Test] - public void It_should_emit_null_safe_identity_value_diff_predicates() - { - _sql.Should().Contain("(OLD.\"SchoolId\") IS DISTINCT FROM (NEW.\"SchoolId\")"); - _sql.Should().Contain("(OLD.\"StudentUniqueId\") IS DISTINCT FROM (NEW.\"StudentUniqueId\")"); - } -} - -[TestFixture] -public class Given_Mssql_Ddl_Emitter_With_Trigger_Inventory -{ - private string _sql = default!; - - [SetUp] - public void Setup() + public void It_should_create_extension_table_in_extension_schema() { - var dialectRules = new MssqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = TriggerFixture.Build(dialectRules.Dialect); - - _sql = emitter.Emit(modelSet); + _ddl.Should().Contain("CREATE TABLE IF NOT EXISTS \"sample\".\"SchoolExtension\""); } [Test] - public void It_should_emit_schema_qualified_trigger_names_and_use_TriggerTable_for_all_kinds() + public void It_should_create_cascade_fk_to_base_table() { - _sql.Should().Contain("CREATE TRIGGER [edfi].[TR_School_Stamp] ON [edfi].[School] AS"); - _sql.Should() - .Contain("CREATE TRIGGER [edfi].[TR_Student_ReferentialIdentity] ON [edfi].[Student] AS"); - _sql.Should().Contain("CREATE TRIGGER [edfi].[TR_School_AbstractIdentity] ON [edfi].[School] AS"); - _sql.Should() - .Contain( - "CREATE TRIGGER [edfi].[TR_EducationOrganizationIdentity_PropagateIdentity] ON [edfi].[EducationOrganizationIdentity] AS" - ); + _ddl.Should().Contain("\"FK_SchoolExtension_School\""); + _ddl.Should().Contain("REFERENCES \"edfi\".\"School\""); + _ddl.Should().Contain("ON DELETE CASCADE"); } [Test] - public void It_should_not_use_maintenance_target_table_as_trigger_owner() + public void It_should_emit_extension_schema_before_extension_tables() { - _sql.Should() - .NotContain( - "CREATE TRIGGER [edfi].[TR_School_AbstractIdentity] ON [dms].[EducationOrganizationIdentity]" + var sampleSchemaIndex = _ddl.IndexOf("CREATE SCHEMA IF NOT EXISTS \"sample\""); + var extensionTableIndex = _ddl.IndexOf("CREATE TABLE IF NOT EXISTS \"sample\".\"SchoolExtension\""); + + sampleSchemaIndex + .Should() + .BeGreaterOrEqualTo(0, "expected CREATE SCHEMA IF NOT EXISTS \"sample\" in DDL"); + extensionTableIndex + .Should() + .BeGreaterOrEqualTo( + 0, + "expected CREATE TABLE IF NOT EXISTS \"sample\".\"SchoolExtension\" in DDL" ); + sampleSchemaIndex.Should().BeLessThan(extensionTableIndex); } [Test] - public void It_should_emit_null_safe_identity_value_diff_predicates() + public void It_should_emit_base_table_before_extension_table() { - _sql.Should().Contain("FULL OUTER JOIN deleted d"); - _sql.Should().Contain("(d.[SchoolId] <> i.[SchoolId])"); - _sql.Should().Contain("(d.[StudentUniqueId] <> i.[StudentUniqueId])"); + var baseTableIndex = _ddl.IndexOf("CREATE TABLE IF NOT EXISTS \"edfi\".\"School\""); + var extensionTableIndex = _ddl.IndexOf("CREATE TABLE IF NOT EXISTS \"sample\".\"SchoolExtension\""); + + baseTableIndex + .Should() + .BeGreaterOrEqualTo(0, "expected CREATE TABLE IF NOT EXISTS \"edfi\".\"School\" in DDL"); + extensionTableIndex + .Should() + .BeGreaterOrEqualTo( + 0, + "expected CREATE TABLE IF NOT EXISTS \"sample\".\"SchoolExtension\" in DDL" + ); + baseTableIndex.Should().BeLessThan(extensionTableIndex); } } [TestFixture] -public class Given_Mssql_Ddl_Emitter_With_Presence_Gated_Unified_Alias_Trigger_Columns +public class Given_RelationalModelDdlEmitter_With_Mssql_And_Extension_Tables { - private string _sql = default!; + private string _ddl = default!; [SetUp] public void Setup() { - var dialectRules = new MssqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = UnifiedAliasTriggerFixture.Build(dialectRules.Dialect); + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var emitter = new RelationalModelDdlEmitter(dialect); + var modelSet = ExtensionTableFixture.Build(dialect.Rules.Dialect); - _sql = emitter.Emit(modelSet); + _ddl = emitter.Emit(modelSet); } [Test] - public void It_should_compare_presence_gated_canonical_values_not_alias_columns() + public void It_should_create_extension_table_in_extension_schema() { - _sql.Should() - .Contain("CASE WHEN d.[School_DocumentId] IS NULL THEN NULL ELSE d.[SchoolId_Unified] END"); - _sql.Should() - .Contain("CASE WHEN i.[School_DocumentId] IS NULL THEN NULL ELSE i.[SchoolId_Unified] END"); - _sql.Should().NotContain("(d.[SchoolId] <> i.[SchoolId])"); - _sql.Should().NotContain("UPDATE([SchoolId])"); + // MSSQL uses IF OBJECT_ID() IS NULL pattern for idempotent table creation + _ddl.Should().Contain("CREATE TABLE [sample].[SchoolExtension]"); + _ddl.Should().Contain("IF OBJECT_ID(N'sample.SchoolExtension', N'U') IS NULL"); } -} - -[TestFixture] -public class Given_Pgsql_Ddl_Emitter_With_Presence_Gated_Unified_Alias_Trigger_Columns -{ - private string _sql = default!; - [SetUp] - public void Setup() + [Test] + public void It_should_create_cascade_fk_to_base_table() { - var dialectRules = new PgsqlDialectRules(); - var emitter = new RelationalModelDdlEmitter(dialectRules); - var modelSet = UnifiedAliasTriggerFixture.Build(dialectRules.Dialect); - - _sql = emitter.Emit(modelSet); + _ddl.Should().Contain("[FK_SchoolExtension_School]"); + _ddl.Should().Contain("REFERENCES [edfi].[School]"); + _ddl.Should().Contain("ON DELETE CASCADE"); } [Test] - public void It_should_compare_presence_gated_canonical_values_not_alias_columns() + public void It_should_emit_base_table_before_extension_table() { - _sql.Should() - .Contain( - "CASE WHEN OLD.\"School_DocumentId\" IS NULL THEN NULL ELSE OLD.\"SchoolId_Unified\" END" - ); - _sql.Should() - .Contain( - "CASE WHEN NEW.\"School_DocumentId\" IS NULL THEN NULL ELSE NEW.\"SchoolId_Unified\" END" - ); - _sql.Should().Contain("IS DISTINCT FROM"); - _sql.Should().NotContain("(OLD.\"SchoolId\") IS DISTINCT FROM (NEW.\"SchoolId\")"); + // MSSQL uses IF OBJECT_ID() IS NULL pattern for idempotent table creation + var baseTableIndex = _ddl.IndexOf("CREATE TABLE [edfi].[School]"); + var extensionTableIndex = _ddl.IndexOf("CREATE TABLE [sample].[SchoolExtension]"); + + baseTableIndex.Should().BeGreaterOrEqualTo(0, "expected CREATE TABLE [edfi].[School] in DDL"); + extensionTableIndex + .Should() + .BeGreaterOrEqualTo(0, "expected CREATE TABLE [sample].[SchoolExtension] in DDL"); + baseTableIndex.Should().BeLessThan(extensionTableIndex); } } -internal static class PrimaryKeyFixture +internal static class ExtensionTableFixture { - internal static DerivedRelationalModelSet Build(SqlDialect dialect, string primaryKeyName) + internal static DerivedRelationalModelSet Build(SqlDialect dialect) { - var schema = new DbSchemaName("edfi"); - var tableName = new DbTableName(schema, "School"); - var columnName = new DbColumnName("DocumentId"); - var keyColumn = new DbKeyColumn(columnName, ColumnKind.ParentKeyPart); + var edfiSchema = new DbSchemaName("edfi"); + var sampleSchema = new DbSchemaName("sample"); var resource = new QualifiedResourceName("Ed-Fi", "School"); var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); - var table = new DbTableModel( - tableName, - new JsonPathExpression("$", Array.Empty()), - new TableKey(primaryKeyName, [keyColumn]), - new[] - { + + var documentIdColumn = new DbColumnName("DocumentId"); + var schoolIdColumn = new DbColumnName("SchoolId"); + var extensionDataColumn = new DbColumnName("ExtensionData"); + + // Core table: School + var schoolTableName = new DbTableName(edfiSchema, "School"); + var schoolTable = new DbTableModel( + schoolTableName, + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ new DbColumnModel( - columnName, + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + schoolIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [] + ); + + // Extension table: SchoolExtension + var schoolExtTableName = new DbTableName(sampleSchema, "SchoolExtension"); + var schoolExtTable = new DbTableModel( + schoolExtTableName, + new JsonPathExpression("$._ext.sample", []), + new TableKey("PK_SchoolExtension", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ + new DbColumnModel( + documentIdColumn, ColumnKind.ParentKeyPart, new RelationalScalarType(ScalarKind.Int64), IsNullable: false, SourceJsonPath: null, TargetResource: null ), - }, - Array.Empty() + new DbColumnModel( + extensionDataColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 200), + IsNullable: true, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + new TableConstraint.ForeignKey( + "FK_SchoolExtension_School", + [documentIdColumn], + schoolTableName, + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] ); + var relationalModel = new RelationalResourceModel( resource, - schema, + edfiSchema, ResourceStorageKind.RelationalTables, - table, - [table], - Array.Empty(), - Array.Empty() + schoolTable, + [schoolTable, schoolExtTable], + [], + [] ); return new DerivedRelationalModelSet( @@ -304,37 +1711,45 @@ internal static DerivedRelationalModelSet Build(SqlDialect dialect, string prima false, "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" ), + new SchemaComponentInfo( + "sample", + "Sample", + "1.0.0", + false, + "aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000" + ), ], [resourceKey] ), dialect, - [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [ + new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, edfiSchema), + new ProjectSchemaInfo("sample", "Sample", "1.0.0", false, sampleSchema), + ], [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], - Array.Empty(), - Array.Empty(), - Array.Empty(), - Array.Empty() + [], + [], + [], + [] ); } } -internal static class NullOrTrueFixture +internal static class TriggerFixture { internal static DerivedRelationalModelSet Build(SqlDialect dialect) { var schema = new DbSchemaName("edfi"); var tableName = new DbTableName(schema, "School"); var documentIdColumn = new DbColumnName("DocumentId"); - var presenceColumn = new DbColumnName("FiscalYear_Present"); - var keyColumn = new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart); var resource = new QualifiedResourceName("Ed-Fi", "School"); var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); + var table = new DbTableModel( tableName, - new JsonPathExpression("$", Array.Empty()), - new TableKey("PK_School", [keyColumn]), - new[] - { + new JsonPathExpression("$", []), + new TableKey("PK_School", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + [ new DbColumnModel( documentIdColumn, ColumnKind.ParentKeyPart, @@ -343,28 +1758,26 @@ internal static DerivedRelationalModelSet Build(SqlDialect dialect) SourceJsonPath: null, TargetResource: null ), - new DbColumnModel( - presenceColumn, - ColumnKind.Scalar, - new RelationalScalarType(ScalarKind.Boolean), - IsNullable: true, - SourceJsonPath: null, - TargetResource: null - ), - }, - new TableConstraint[] - { - new TableConstraint.NullOrTrue("CK_School_FiscalYear_Present_NullOrTrue", presenceColumn), - } + ], + [] ); + var relationalModel = new RelationalResourceModel( resource, schema, ResourceStorageKind.RelationalTables, table, [table], - Array.Empty(), - Array.Empty() + [], + [] + ); + + var trigger = new DbTriggerInfo( + new DbTriggerName("TR_School_DocumentStamping"), + tableName, + [documentIdColumn], + [], + new TriggerKindParameters.DocumentStamping() ); return new DerivedRelationalModelSet( @@ -388,38 +1801,85 @@ internal static DerivedRelationalModelSet Build(SqlDialect dialect) dialect, [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], - Array.Empty(), - Array.Empty(), - Array.Empty(), - Array.Empty() + [], + [], + [], + [trigger] ); } } -internal static class TriggerFixture +internal static class AbstractIdentityTableFkFixture { internal static DerivedRelationalModelSet Build(SqlDialect dialect) { - var schema = new DbSchemaName("edfi"); - var schoolTable = BuildRootTable(schema, "School", "SchoolId"); - var studentTable = BuildRootTable(schema, "Student", "StudentUniqueId"); - var schoolResource = new QualifiedResourceName("Ed-Fi", "School"); - var studentResource = new QualifiedResourceName("Ed-Fi", "Student"); - var schoolResourceKey = new ResourceKeyEntry(1, schoolResource, "1.0.0", false); - var studentResourceKey = new ResourceKeyEntry(2, studentResource, "1.0.0", false); - var maintenanceTargetTable = new DbTableName( - new DbSchemaName("dms"), - "EducationOrganizationIdentity" + var edfiSchema = new DbSchemaName("edfi"); + var dmsSchema = new DbSchemaName("dms"); + var documentIdColumn = new DbColumnName("DocumentId"); + var testIdColumn = new DbColumnName("TestId"); + var discriminatorColumn = new DbColumnName("Discriminator"); + + var abstractResource = new QualifiedResourceName("Ed-Fi", "Test"); + var abstractResourceKey = new ResourceKeyEntry(1, abstractResource, "1.0.0", true); + + // Abstract identity table with FK to dms.Document + var identityTableName = new DbTableName(edfiSchema, "TestIdentity"); + var identityTable = new AbstractIdentityTableInfo( + abstractResourceKey, + new DbTableModel( + identityTableName, + new JsonPathExpression("$", []), + new TableKey( + "PK_TestIdentity", + [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] + ), + [ + new DbColumnModel( + documentIdColumn, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + testIdColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + discriminatorColumn, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 50), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + ], + [ + // FK from abstract identity table to dms.Document (as created by BuildIdentityTableConstraints) + new TableConstraint.ForeignKey( + "FK_TestIdentity_Document", + [documentIdColumn], + new DbTableName(dmsSchema, "Document"), + [documentIdColumn], + ReferentialAction.Cascade, + ReferentialAction.NoAction + ), + ] + ) ); - var propagationTriggerTable = new DbTableName(schema, "EducationOrganizationIdentity"); return new DerivedRelationalModelSet( new EffectiveSchemaInfo( "1.0.0", "1.0.0", "hash", - 2, - [0x01, 0x02], + 1, + [0x01], [ new SchemaComponentInfo( "ed-fi", @@ -429,101 +1889,39 @@ internal static DerivedRelationalModelSet Build(SqlDialect dialect) "edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1edf1" ), ], - [schoolResourceKey, studentResourceKey] + [abstractResourceKey] ), dialect, - [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], - [ - BuildResourceModel(schoolResourceKey, schoolResource, schema, schoolTable), - BuildResourceModel(studentResourceKey, studentResource, schema, studentTable), - ], - Array.Empty(), - Array.Empty(), - Array.Empty(), - [ - new DbTriggerInfo( - new DbTriggerName("TR_School_Stamp"), - schoolTable.Table, - DbTriggerKind.DocumentStamping, - [new DbColumnName("DocumentId")], - [new DbColumnName("SchoolId")] - ), - new DbTriggerInfo( - new DbTriggerName("TR_Student_ReferentialIdentity"), - studentTable.Table, - DbTriggerKind.ReferentialIdentityMaintenance, - [new DbColumnName("DocumentId")], - [new DbColumnName("StudentUniqueId")] - ), - new DbTriggerInfo( - new DbTriggerName("TR_School_AbstractIdentity"), - schoolTable.Table, - DbTriggerKind.AbstractIdentityMaintenance, - [new DbColumnName("DocumentId")], - [new DbColumnName("SchoolId")], - MaintenanceTargetTable: maintenanceTargetTable - ), - new DbTriggerInfo( - new DbTriggerName("TR_EducationOrganizationIdentity_PropagateIdentity"), - propagationTriggerTable, - DbTriggerKind.IdentityPropagationFallback, - [], - [], - MaintenanceTargetTable: null, - PropagationFallback: new DbIdentityPropagationFallbackInfo([ - new DbIdentityPropagationReferrerAction( - schoolTable.Table, - new DbColumnName("EducationOrganizationReference_DocumentId"), - new DbColumnName("DocumentId"), - [ - new DbIdentityPropagationColumnPair( - new DbColumnName( - "EducationOrganizationReference_EducationOrganizationId" - ), - new DbColumnName("EducationOrganizationId") - ), - ] - ), - ]) - ), - ] + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, edfiSchema)], + [], + [identityTable], + [], + [], + [] ); } +} - private static ConcreteResourceModel BuildResourceModel( - ResourceKeyEntry resourceKey, - QualifiedResourceName resource, - DbSchemaName schema, - DbTableModel rootTable - ) +internal static class AllOrNoneCheckFixture +{ + internal static DerivedRelationalModelSet Build(SqlDialect dialect) { - var relationalModel = new RelationalResourceModel( - resource, - schema, - ResourceStorageKind.RelationalTables, - rootTable, - [rootTable], - Array.Empty(), - Array.Empty() - ); - - return new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel); - } + var edfiSchema = new DbSchemaName("edfi"); + var resource = new QualifiedResourceName("Ed-Fi", "Test"); + var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); - private static DbTableModel BuildRootTable( - DbSchemaName schema, - string tableName, - string identityColumnName - ) - { - var table = new DbTableName(schema, tableName); var documentIdColumn = new DbColumnName("DocumentId"); - var identityColumn = new DbColumnName(identityColumnName); + var testIdColumn = new DbColumnName("TestId"); + var referenceFkColumn = new DbColumnName("Reference_DocumentId"); + var identityPart1Column = new DbColumnName("Reference_IdentityPart1"); + var identityPart2Column = new DbColumnName("Reference_IdentityPart2"); - return new DbTableModel( - table, - new JsonPathExpression("$", Array.Empty()), - new TableKey($"PK_{tableName}", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), + // Root table with a document reference that has an all-or-none check constraint + var tableName = new DbTableName(edfiSchema, "Test"); + var table = new DbTableModel( + tableName, + new JsonPathExpression("$", []), + new TableKey("PK_Test", [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)]), [ new DbColumnModel( documentIdColumn, @@ -534,35 +1932,58 @@ string identityColumnName TargetResource: null ), new DbColumnModel( - identityColumn, + testIdColumn, ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + // Document reference FK column (nullable for optional reference) + new DbColumnModel( + referenceFkColumn, + ColumnKind.DocumentFk, new RelationalScalarType(ScalarKind.Int64), IsNullable: true, SourceJsonPath: null, TargetResource: null ), + // Propagated identity columns (nullable for optional reference) + new DbColumnModel( + identityPart1Column, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: true, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + identityPart2Column, + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.String, MaxLength: 50), + IsNullable: true, + SourceJsonPath: null, + TargetResource: null + ), ], - Array.Empty() + [ + // All-or-none check: FK and identity columns must all be null or all be not null + new TableConstraint.AllOrNoneNullability( + "CHK_Reference_AllOrNone", + referenceFkColumn, + [identityPart1Column, identityPart2Column] + ), + ] ); - } -} -internal static class UnifiedAliasTriggerFixture -{ - internal static DerivedRelationalModelSet Build(SqlDialect dialect) - { - var schema = new DbSchemaName("edfi"); - var resource = new QualifiedResourceName("Ed-Fi", "StudentSchoolAssociation"); - var resourceKey = new ResourceKeyEntry(1, resource, "1.0.0", false); - var rootTable = BuildRootTable(schema); var relationalModel = new RelationalResourceModel( resource, - schema, + edfiSchema, ResourceStorageKind.RelationalTables, - rootTable, - [rootTable], - Array.Empty(), - Array.Empty() + table, + [table], + [], + [] ); return new DerivedRelationalModelSet( @@ -584,76 +2005,36 @@ internal static DerivedRelationalModelSet Build(SqlDialect dialect) [resourceKey] ), dialect, - [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, schema)], + [new ProjectSchemaInfo("ed-fi", "Ed-Fi", "1.0.0", false, edfiSchema)], [new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel)], - Array.Empty(), - Array.Empty(), - Array.Empty(), - [ - new DbTriggerInfo( - new DbTriggerName("TR_StudentSchoolAssociation_Stamp"), - rootTable.Table, - DbTriggerKind.DocumentStamping, - [new DbColumnName("DocumentId")], - [new DbColumnName("SchoolId")] - ), - ] + [], + [], + [], + [] ); } +} - private static DbTableModel BuildRootTable(DbSchemaName schema) +// ═══════════════════════════════════════════════════════════════════ +// UUIDv5 Namespace Guard Test +// ═══════════════════════════════════════════════════════════════════ + +/// +/// Guard test ensuring the DDL emitter's embedded UUIDv5 namespace stays in sync with +/// ReferentialIdCalculator.EdFiUuidv5Namespace in EdFi.DataManagementService.Core. +/// If this test fails, either the emitter or the calculator has been changed independently, +/// which would cause emitted triggers to compute referential IDs that don't match runtime. +/// +[TestFixture] +public class Given_Uuidv5Namespace_Constant +{ + [Test] + public void It_should_match_the_canonical_EdFi_UUIDv5_namespace() { - var table = new DbTableName(schema, "StudentSchoolAssociation"); - var documentIdColumn = new DbColumnName("DocumentId"); - var schoolDocumentIdColumn = new DbColumnName("School_DocumentId"); - var canonicalColumn = new DbColumnName("SchoolId_Unified"); - var aliasColumn = new DbColumnName("SchoolId"); + // This value must match ReferentialIdCalculator.EdFiUuidv5Namespace in + // EdFi.DataManagementService.Core.Extraction. + const string expected = "edf1edf1-3df1-3df1-3df1-3df1edf1edf1"; - return new DbTableModel( - table, - new JsonPathExpression("$", Array.Empty()), - new TableKey( - "PK_StudentSchoolAssociation", - [new DbKeyColumn(documentIdColumn, ColumnKind.ParentKeyPart)] - ), - [ - new DbColumnModel( - documentIdColumn, - ColumnKind.ParentKeyPart, - new RelationalScalarType(ScalarKind.Int64), - IsNullable: false, - SourceJsonPath: null, - TargetResource: null - ), - new DbColumnModel( - schoolDocumentIdColumn, - ColumnKind.DocumentFk, - new RelationalScalarType(ScalarKind.Int64), - IsNullable: true, - SourceJsonPath: null, - TargetResource: null - ), - new DbColumnModel( - canonicalColumn, - ColumnKind.Scalar, - new RelationalScalarType(ScalarKind.Int64), - IsNullable: true, - SourceJsonPath: null, - TargetResource: null - ), - new DbColumnModel( - aliasColumn, - ColumnKind.Scalar, - new RelationalScalarType(ScalarKind.Int64), - IsNullable: true, - SourceJsonPath: null, - TargetResource: null - ) - { - Storage = new ColumnStorage.UnifiedAlias(canonicalColumn, schoolDocumentIdColumn), - }, - ], - Array.Empty() - ); + RelationalModelDdlEmitter.Uuidv5Namespace.Should().Be(expected); } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/SqlWriterTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/SqlWriterTests.cs index 3b978a613..a82522b60 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/SqlWriterTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl.Tests.Unit/SqlWriterTests.cs @@ -203,132 +203,6 @@ public void It_should_concatenate_appends_on_same_line() } } -[TestFixture] -public class Given_SqlWriter_With_Quoted_Identifier -{ - private string _pgsqlOutput = default!; - private string _mssqlOutput = default!; - - [SetUp] - public void Setup() - { - var pgsqlDialect = new PgsqlDialect(new PgsqlDialectRules()); - var pgsqlWriter = new SqlWriter(pgsqlDialect); - pgsqlWriter.AppendQuoted("MyTable"); - _pgsqlOutput = pgsqlWriter.ToString(); - - var mssqlDialect = new MssqlDialect(new MssqlDialectRules()); - var mssqlWriter = new SqlWriter(mssqlDialect); - mssqlWriter.AppendQuoted("MyTable"); - _mssqlOutput = mssqlWriter.ToString(); - } - - [Test] - public void It_should_quote_with_double_quotes_for_pgsql() - { - _pgsqlOutput.Should().Be("\"MyTable\""); - } - - [Test] - public void It_should_quote_with_brackets_for_mssql() - { - _mssqlOutput.Should().Be("[MyTable]"); - } -} - -[TestFixture] -public class Given_SqlWriter_With_Table_Name -{ - private string _pgsqlOutput = default!; - private string _mssqlOutput = default!; - - [SetUp] - public void Setup() - { - var table = new DbTableName(new DbSchemaName("edfi"), "School"); - - var pgsqlDialect = new PgsqlDialect(new PgsqlDialectRules()); - var pgsqlWriter = new SqlWriter(pgsqlDialect); - pgsqlWriter.AppendTable(table); - _pgsqlOutput = pgsqlWriter.ToString(); - - var mssqlDialect = new MssqlDialect(new MssqlDialectRules()); - var mssqlWriter = new SqlWriter(mssqlDialect); - mssqlWriter.AppendTable(table); - _mssqlOutput = mssqlWriter.ToString(); - } - - [Test] - public void It_should_qualify_with_double_quotes_for_pgsql() - { - _pgsqlOutput.Should().Be("\"edfi\".\"School\""); - } - - [Test] - public void It_should_qualify_with_brackets_for_mssql() - { - _mssqlOutput.Should().Be("[edfi].[School]"); - } -} - -[TestFixture] -public class Given_SqlWriter_With_Column_Type -{ - private string _pgsqlStringOutput = default!; - private string _mssqlStringOutput = default!; - private string _pgsqlDecimalOutput = default!; - private string _mssqlDecimalOutput = default!; - - [SetUp] - public void Setup() - { - var stringType = new RelationalScalarType(ScalarKind.String, MaxLength: 100); - var decimalType = new RelationalScalarType(ScalarKind.Decimal, Decimal: (18, 4)); - - var pgsqlDialect = new PgsqlDialect(new PgsqlDialectRules()); - var pgsqlWriter1 = new SqlWriter(pgsqlDialect); - pgsqlWriter1.AppendColumnType(stringType); - _pgsqlStringOutput = pgsqlWriter1.ToString(); - - var pgsqlWriter2 = new SqlWriter(pgsqlDialect); - pgsqlWriter2.AppendColumnType(decimalType); - _pgsqlDecimalOutput = pgsqlWriter2.ToString(); - - var mssqlDialect = new MssqlDialect(new MssqlDialectRules()); - var mssqlWriter1 = new SqlWriter(mssqlDialect); - mssqlWriter1.AppendColumnType(stringType); - _mssqlStringOutput = mssqlWriter1.ToString(); - - var mssqlWriter2 = new SqlWriter(mssqlDialect); - mssqlWriter2.AppendColumnType(decimalType); - _mssqlDecimalOutput = mssqlWriter2.ToString(); - } - - [Test] - public void It_should_render_varchar_for_pgsql_string() - { - _pgsqlStringOutput.Should().Be("varchar(100)"); - } - - [Test] - public void It_should_render_nvarchar_for_mssql_string() - { - _mssqlStringOutput.Should().Be("nvarchar(100)"); - } - - [Test] - public void It_should_render_numeric_for_pgsql_decimal() - { - _pgsqlDecimalOutput.Should().Be("numeric(18,4)"); - } - - [Test] - public void It_should_render_decimal_for_mssql_decimal() - { - _mssqlDecimalOutput.Should().Be("decimal(18,4)"); - } -} - [TestFixture] public class Given_SqlWriter_Determinism_With_Same_Input_Sequence { @@ -367,40 +241,3 @@ public void It_should_produce_byte_for_byte_identical_output() _output1.Should().Be(_output2); } } - -[TestFixture] -public class Given_SqlWriter_Clear_Method -{ - private SqlWriter _writer = default!; - private int _lengthBeforeClear; - private int _lengthAfterClear; - - [SetUp] - public void Setup() - { - var dialect = new PgsqlDialect(new PgsqlDialectRules()); - _writer = new SqlWriter(dialect); - _writer.AppendLine("SELECT 1;"); - _lengthBeforeClear = _writer.Length; - _writer.Clear(); - _lengthAfterClear = _writer.Length; - } - - [Test] - public void It_should_have_content_before_clear() - { - _lengthBeforeClear.Should().BeGreaterThan(0); - } - - [Test] - public void It_should_be_empty_after_clear() - { - _lengthAfterClear.Should().Be(0); - } - - [Test] - public void It_should_return_empty_string_after_clear() - { - _writer.ToString().Should().BeEmpty(); - } -} diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/CoreDdlEmitter.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/CoreDdlEmitter.cs index a80c4f91f..43d9fb818 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/CoreDdlEmitter.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/CoreDdlEmitter.cs @@ -31,13 +31,12 @@ public sealed class CoreDdlEmitter(ISqlDialect dialect) { private readonly ISqlDialect _dialect = dialect ?? throw new ArgumentNullException(nameof(dialect)); - private static readonly DbSchemaName _dmsSchema = new("dms"); - private static readonly DbTableName _descriptorTable = new(_dmsSchema, "Descriptor"); - private static readonly DbTableName _documentTable = new(_dmsSchema, "Document"); - private static readonly DbTableName _documentCacheTable = new(_dmsSchema, "DocumentCache"); - private static readonly DbTableName _documentChangeEventTable = new(_dmsSchema, "DocumentChangeEvent"); + private static readonly DbTableName _descriptorTable = DmsTableNames.Descriptor; + private static readonly DbTableName _documentTable = DmsTableNames.Document; + private static readonly DbTableName _documentCacheTable = DmsTableNames.DocumentCache; + private static readonly DbTableName _documentChangeEventTable = DmsTableNames.DocumentChangeEvent; private static readonly DbTableName _effectiveSchemaTable = DmsTableNames.EffectiveSchema; - private static readonly DbTableName _referentialIdentityTable = new(_dmsSchema, "ReferentialIdentity"); + private static readonly DbTableName _referentialIdentityTable = DmsTableNames.ReferentialIdentity; private static readonly DbTableName _resourceKeyTable = DmsTableNames.ResourceKey; private static readonly DbTableName _schemaComponentTable = DmsTableNames.SchemaComponent; @@ -71,7 +70,7 @@ private string StringType(int maxLength) => /// Gets the default expression for generating change/version values from the core change-version sequence. /// private string SequenceDefault => - _dialect.RenderSequenceDefaultExpression(_dmsSchema, "ChangeVersionSequence"); + _dialect.RenderSequenceDefaultExpression(DmsTableNames.DmsSchema, "ChangeVersionSequence"); /// /// Generates the complete core dms.* DDL script for the configured dialect. @@ -105,7 +104,7 @@ private void EmitSchemas(SqlWriter writer) writer.AppendLine("-- =========================================================="); writer.AppendLine(); - writer.AppendLine(_dialect.CreateSchemaIfNotExists(_dmsSchema)); + writer.AppendLine(_dialect.CreateSchemaIfNotExists(DmsTableNames.DmsSchema)); writer.AppendLine(); } @@ -129,7 +128,9 @@ private void EmitSequences(SqlWriter writer) /// private void EmitChangeVersionSequence(SqlWriter writer) { - writer.AppendLine(_dialect.CreateSequenceIfNotExists(_dmsSchema, "ChangeVersionSequence")); + writer.AppendLine( + _dialect.CreateSequenceIfNotExists(DmsTableNames.DmsSchema, "ChangeVersionSequence") + ); writer.AppendLine(); } @@ -740,11 +741,9 @@ private void EmitTriggers(SqlWriter writer) /// private void EmitPgsqlJournalingTrigger(SqlWriter writer) { - string Q(string id) => _dialect.QuoteIdentifier(id); - var docTable = _dialect.QualifyTable(_documentTable); var changeTable = _dialect.QualifyTable(_documentChangeEventTable); - var funcName = $"{Q(_dmsSchema.Value)}.{Q("TF_Document_Journal")}"; + var funcName = $"{Quote(DmsTableNames.DmsSchema.Value)}.{Quote("TF_Document_Journal")}"; // Trigger function writer.AppendLine($"CREATE OR REPLACE FUNCTION {funcName}()"); @@ -753,16 +752,16 @@ private void EmitPgsqlJournalingTrigger(SqlWriter writer) using (writer.Indent()) { writer.AppendLine( - $"INSERT INTO {changeTable} ({Q("ChangeVersion")}, {Q("DocumentId")}, {Q("ResourceKeyId")}, {Q("CreatedAt")})" + $"INSERT INTO {changeTable} ({Quote("ChangeVersion")}, {Quote("DocumentId")}, {Quote("ResourceKeyId")}, {Quote("CreatedAt")})" ); writer.AppendLine( - $"SELECT d.{Q("ContentVersion")}, d.{Q("DocumentId")}, d.{Q("ResourceKeyId")}, now()" + $"SELECT d.{Quote("ContentVersion")}, d.{Quote("DocumentId")}, d.{Quote("ResourceKeyId")}, now()" ); writer.AppendLine("FROM ("); using (writer.Indent()) { writer.AppendLine( - $"SELECT DISTINCT ON ({Q("DocumentId")}) {Q("ContentVersion")}, {Q("DocumentId")}, {Q("ResourceKeyId")}" + $"SELECT DISTINCT ON ({Quote("DocumentId")}) {Quote("ContentVersion")}, {Quote("DocumentId")}, {Quote("ResourceKeyId")}" ); writer.AppendLine("FROM new_table"); } @@ -775,10 +774,10 @@ private void EmitPgsqlJournalingTrigger(SqlWriter writer) // Drop and recreate trigger writer.AppendLine(_dialect.DropTriggerIfExists(_documentTable, "TR_Document_Journal")); - writer.AppendLine($"CREATE TRIGGER {Q("TR_Document_Journal")}"); + writer.AppendLine($"CREATE TRIGGER {Quote("TR_Document_Journal")}"); using (writer.Indent()) { - writer.AppendLine($"AFTER INSERT OR UPDATE OF {Q("ContentVersion")} ON {docTable}"); + writer.AppendLine($"AFTER INSERT OR UPDATE OF {Quote("ContentVersion")} ON {docTable}"); writer.AppendLine("REFERENCING NEW TABLE AS new_table"); writer.AppendLine("FOR EACH STATEMENT"); writer.AppendLine($"EXECUTE FUNCTION {funcName}();"); @@ -793,12 +792,12 @@ private void EmitPgsqlJournalingTrigger(SqlWriter writer) /// private void EmitMssqlJournalingTrigger(SqlWriter writer) { - string Q(string id) => _dialect.QuoteIdentifier(id); - var docTable = _dialect.QualifyTable(_documentTable); var changeTable = _dialect.QualifyTable(_documentChangeEventTable); - var triggerName = $"{Q(_dmsSchema.Value)}.{Q("TR_Document_Journal")}"; + var triggerName = $"{Quote(DmsTableNames.DmsSchema.Value)}.{Quote("TR_Document_Journal")}"; + // CREATE OR ALTER TRIGGER must be the first statement in a T-SQL batch. + writer.AppendLine("GO"); writer.AppendLine($"CREATE OR ALTER TRIGGER {triggerName}"); writer.AppendLine($"ON {docTable}"); writer.AppendLine("AFTER INSERT, UPDATE"); @@ -807,15 +806,15 @@ private void EmitMssqlJournalingTrigger(SqlWriter writer) using (writer.Indent()) { writer.AppendLine("SET NOCOUNT ON;"); - writer.AppendLine($"IF UPDATE({Q("ContentVersion")}) OR NOT EXISTS (SELECT 1 FROM deleted)"); + writer.AppendLine($"IF UPDATE({Quote("ContentVersion")}) OR NOT EXISTS (SELECT 1 FROM deleted)"); writer.AppendLine("BEGIN"); using (writer.Indent()) { writer.AppendLine( - $"INSERT INTO {changeTable} ({Q("ChangeVersion")}, {Q("DocumentId")}, {Q("ResourceKeyId")}, {Q("CreatedAt")})" + $"INSERT INTO {changeTable} ({Quote("ChangeVersion")}, {Quote("DocumentId")}, {Quote("ResourceKeyId")}, {Quote("CreatedAt")})" ); writer.AppendLine( - $"SELECT i.{Q("ContentVersion")}, i.{Q("DocumentId")}, i.{Q("ResourceKeyId")}, sysutcdatetime()" + $"SELECT i.{Quote("ContentVersion")}, i.{Quote("DocumentId")}, i.{Quote("ResourceKeyId")}, sysutcdatetime()" ); writer.AppendLine("FROM inserted i;"); } @@ -824,4 +823,6 @@ private void EmitMssqlJournalingTrigger(SqlWriter writer) writer.AppendLine("END;"); writer.AppendLine(); } + + private string Quote(string identifier) => _dialect.QuoteIdentifier(identifier); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DdlPattern.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DdlPattern.cs index 1b6f21199..fa02cba44 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DdlPattern.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DdlPattern.cs @@ -20,10 +20,4 @@ public enum DdlPattern /// SQL Server-style: CREATE OR ALTER FUNCTION/VIEW/TRIGGER. /// CreateOrAlter, - - /// - /// Drop-then-create pattern for objects that do not support idempotent creation - /// (e.g., PostgreSQL triggers). - /// - DropThenCreate, } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DmsTableNames.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DmsTableNames.cs index 76d5c2036..93359bc66 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DmsTableNames.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/DmsTableNames.cs @@ -13,9 +13,16 @@ namespace EdFi.DataManagementService.Backend.Ddl; /// internal static class DmsTableNames { - private static readonly DbSchemaName _dmsSchema = new("dms"); + public static readonly DbSchemaName DmsSchema = new("dms"); - public static readonly DbTableName EffectiveSchema = new(_dmsSchema, "EffectiveSchema"); - public static readonly DbTableName ResourceKey = new(_dmsSchema, "ResourceKey"); - public static readonly DbTableName SchemaComponent = new(_dmsSchema, "SchemaComponent"); + public static readonly DbTableName Descriptor = new(DmsSchema, "Descriptor"); + public static readonly DbTableName Document = new(DmsSchema, "Document"); + public static readonly DbTableName DocumentCache = new(DmsSchema, "DocumentCache"); + public static readonly DbTableName DocumentChangeEvent = new(DmsSchema, "DocumentChangeEvent"); + public static readonly DbTableName EffectiveSchema = new(DmsSchema, "EffectiveSchema"); + public static readonly DbTableName ReferentialIdentity = new(DmsSchema, "ReferentialIdentity"); + public static readonly DbTableName ResourceKey = new(DmsSchema, "ResourceKey"); + public static readonly DbTableName SchemaComponent = new(DmsSchema, "SchemaComponent"); + + public const string ChangeVersionSequence = "ChangeVersionSequence"; } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/EdFi.DataManagementService.Backend.Ddl.csproj b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/EdFi.DataManagementService.Backend.Ddl.csproj index 01dd3013e..e8b19a413 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/EdFi.DataManagementService.Backend.Ddl.csproj +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/EdFi.DataManagementService.Backend.Ddl.csproj @@ -5,6 +5,9 @@ enable true + + + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/ISqlDialect.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/ISqlDialect.cs index 4ac0cc48f..229d3473a 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/ISqlDialect.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/ISqlDialect.cs @@ -72,16 +72,6 @@ public interface ISqlDialect /// The DROP TRIGGER IF EXISTS statement. string DropTriggerIfExists(DbTableName table, string triggerName); - /// - /// Gets the DDL pattern used for trigger creation. - /// - DdlPattern TriggerCreationPattern { get; } - - /// - /// Gets the DDL pattern used for function creation. - /// - DdlPattern FunctionCreationPattern { get; } - /// /// Gets the DDL pattern used for view creation. /// @@ -326,4 +316,23 @@ string RenderNamedPrimaryKeyClause( /// The integer value. /// The literal string representation. string RenderIntegerLiteral(int value); + + /// + /// Renders a computed column definition for a unified alias column. + /// The computed value is the canonical column when the presence column is non-NULL + /// (or always, when there is no presence column), otherwise NULL. + /// PostgreSQL: "alias" type GENERATED ALWAYS AS (CASE WHEN "presence" IS NULL THEN NULL ELSE "canonical" END) STORED. + /// SQL Server: [alias] AS (CASE WHEN [presence] IS NULL THEN NULL ELSE [canonical] END) PERSISTED. + /// + /// The alias column name. + /// The SQL type for the column. + /// The source canonical column name. + /// Optional presence-gate column; when NULL, no presence check is performed. + /// The computed column definition. + string RenderComputedColumnDefinition( + DbColumnName columnName, + string sqlType, + DbColumnName canonicalColumn, + DbColumnName? presenceColumn + ); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/MssqlDialect.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/MssqlDialect.cs index 0c81db83e..55eef22f5 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/MssqlDialect.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/MssqlDialect.cs @@ -38,12 +38,6 @@ public MssqlDialect(ISqlDialectRules rules) /// public override string OrdinalColumnType => "int"; - /// - public override DdlPattern TriggerCreationPattern => DdlPattern.CreateOrAlter; - - /// - public override DdlPattern FunctionCreationPattern => DdlPattern.CreateOrAlter; - /// public override DdlPattern ViewCreationPattern => DdlPattern.CreateOrAlter; @@ -84,7 +78,7 @@ public override string CreateTableHeader(DbTableName table) // SQL Server does not support IF NOT EXISTS for CREATE TABLE directly, // so we use an OBJECT_ID check pattern. var qualifiedTable = QualifyTable(table); - var escapedTableForObjectId = $"{table.Schema.Value}.{table.Name}".Replace("'", "''"); + var escapedTableForObjectId = EscapeTableForObjectId(table); return $"IF OBJECT_ID(N'{escapedTableForObjectId}', N'U') IS NULL\n" + $"CREATE TABLE {qualifiedTable}"; @@ -191,7 +185,7 @@ public override string AddForeignKeyConstraint( var targetColumnList = string.Join(", ", targetColumns.Select(c => QuoteIdentifier(c.Value))); var quotedConstraint = QuoteIdentifier(constraintName); var escapedConstraint = constraintName.Replace("'", "''"); - var escapedTableForObjectId = $"{table.Schema.Value}.{table.Name}".Replace("'", "''"); + var escapedTableForObjectId = EscapeTableForObjectId(table); return $""" IF NOT EXISTS ( @@ -228,7 +222,7 @@ IReadOnlyList columns var columnList = string.Join(", ", columns.Select(c => QuoteIdentifier(c.Value))); var quotedConstraint = QuoteIdentifier(constraintName); var escapedConstraint = constraintName.Replace("'", "''"); - var escapedTableForObjectId = $"{table.Schema.Value}.{table.Name}".Replace("'", "''"); + var escapedTableForObjectId = EscapeTableForObjectId(table); return $""" IF NOT EXISTS ( @@ -252,7 +246,7 @@ string checkExpression var quotedConstraint = QuoteIdentifier(constraintName); var escapedConstraint = constraintName.Replace("'", "''"); - var escapedTableForObjectId = $"{table.Schema.Value}.{table.Name}".Replace("'", "''"); + var escapedTableForObjectId = EscapeTableForObjectId(table); return $""" IF NOT EXISTS ( @@ -324,6 +318,26 @@ RETURN CAST( """; } + // ── Scalar type rendering ────────────────────────────────────────── + + /// + /// + /// Overrides base to emit nvarchar(max) for unbounded strings. + /// SQL Server requires an explicit length or (max) suffix. + /// + public override string RenderColumnType(RelationalScalarType scalarType) + { + ArgumentNullException.ThrowIfNull(scalarType); + + // Handle unbounded strings: SQL Server needs (max) suffix + if (scalarType.Kind == ScalarKind.String && !scalarType.MaxLength.HasValue) + { + return $"{Rules.ScalarTypeDefaults.StringType}(max)"; + } + + return base.RenderColumnType(scalarType); + } + // ── Core-table type properties ────────────────────────────────────── /// @@ -385,7 +399,7 @@ public override string RenderStringLiteral(string value) { ArgumentNullException.ThrowIfNull(value); - return $"N'{value.Replace("'", "''")}'"; + return $"N'{EscapeSingleQuote(value)}'"; } /// @@ -436,4 +450,38 @@ public override string RenderNamedPrimaryKeyClause( return $"CONSTRAINT {QuoteIdentifier(constraintName)} PRIMARY KEY {clusterKeyword} ({columnList})"; } + + /// + public override string RenderComputedColumnDefinition( + DbColumnName columnName, + string sqlType, + DbColumnName canonicalColumn, + DbColumnName? presenceColumn + ) + { + ArgumentNullException.ThrowIfNull(sqlType); + + var quotedColumn = QuoteIdentifier(columnName.Value); + var quotedCanonical = QuoteIdentifier(canonicalColumn.Value); + + // SQL Server uses AS (...) PERSISTED for computed columns. + // When presenceColumn is provided, emit a CASE expression that returns NULL + // when the presence column is NULL; otherwise, return the canonical value. + if (presenceColumn is { Value: var presenceValue }) + { + var quotedPresence = QuoteIdentifier(presenceValue); + return $"{quotedColumn} AS (CASE WHEN {quotedPresence} IS NULL THEN NULL ELSE {quotedCanonical} END) PERSISTED"; + } + + // No presence column — alias always returns the canonical value. + return $"{quotedColumn} AS ({quotedCanonical}) PERSISTED"; + } + + /// + /// Returns the schema-qualified table name escaped for use in OBJECT_ID() calls. + /// + private static string EscapeTableForObjectId(DbTableName table) + { + return $"{table.Schema.Value}.{table.Name}".Replace("'", "''"); + } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/PgsqlDialect.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/PgsqlDialect.cs index d619548d1..16bc29d2b 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/PgsqlDialect.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/PgsqlDialect.cs @@ -38,12 +38,6 @@ public PgsqlDialect(ISqlDialectRules rules) /// public override string OrdinalColumnType => "integer"; - /// - public override DdlPattern TriggerCreationPattern => DdlPattern.DropThenCreate; - - /// - public override DdlPattern FunctionCreationPattern => DdlPattern.CreateOrReplace; - /// public override DdlPattern ViewCreationPattern => DdlPattern.CreateOrReplace; @@ -154,8 +148,9 @@ public override string AddForeignKeyConstraint( var targetColumnList = string.Join(", ", targetColumns.Select(c => QuoteIdentifier(c.Value))); var quotedConstraint = QuoteIdentifier(constraintName); var escapedConstraint = constraintName.Replace("'", "''"); - var escapedSchema = table.Schema.Value.Replace("'", "''"); - var escapedTable = table.Name.Replace("'", "''"); + // Pass the already-quoted identifier to to_regclass(); PostgreSQL needs the double + // quotes inside the string literal to preserve case for PascalCase table names. + var escapedQualifiedTable = EscapeQualifiedTable(table); // Use DO block to check if constraint exists before adding return $""" @@ -164,7 +159,7 @@ public override string AddForeignKeyConstraint( IF NOT EXISTS ( SELECT 1 FROM pg_constraint WHERE conname = '{escapedConstraint}' - AND conrelid = to_regclass('{escapedSchema}.{escapedTable}') + AND conrelid = to_regclass('{escapedQualifiedTable}') ) THEN ALTER TABLE {QualifyTable(table)} @@ -199,8 +194,9 @@ IReadOnlyList columns var columnList = string.Join(", ", columns.Select(c => QuoteIdentifier(c.Value))); var quotedConstraint = QuoteIdentifier(constraintName); var escapedConstraint = constraintName.Replace("'", "''"); - var escapedSchema = table.Schema.Value.Replace("'", "''"); - var escapedTable = table.Name.Replace("'", "''"); + // Pass the already-quoted identifier to to_regclass(); PostgreSQL needs the double + // quotes inside the string literal to preserve case for PascalCase table names. + var escapedQualifiedTable = EscapeQualifiedTable(table); return $""" DO $$ @@ -208,7 +204,7 @@ IReadOnlyList columns IF NOT EXISTS ( SELECT 1 FROM pg_constraint WHERE conname = '{escapedConstraint}' - AND conrelid = to_regclass('{escapedSchema}.{escapedTable}') + AND conrelid = to_regclass('{escapedQualifiedTable}') ) THEN ALTER TABLE {QualifyTable(table)} @@ -230,8 +226,9 @@ string checkExpression var quotedConstraint = QuoteIdentifier(constraintName); var escapedConstraint = constraintName.Replace("'", "''"); - var escapedSchema = table.Schema.Value.Replace("'", "''"); - var escapedTable = table.Name.Replace("'", "''"); + // Pass the already-quoted identifier to to_regclass(); PostgreSQL needs the double + // quotes inside the string literal to preserve case for PascalCase table names. + var escapedQualifiedTable = EscapeQualifiedTable(table); return $""" DO $$ @@ -239,7 +236,7 @@ string checkExpression IF NOT EXISTS ( SELECT 1 FROM pg_constraint WHERE conname = '{escapedConstraint}' - AND conrelid = to_regclass('{escapedSchema}.{escapedTable}') + AND conrelid = to_regclass('{escapedQualifiedTable}') ) THEN ALTER TABLE {QualifyTable(table)} @@ -348,7 +345,7 @@ public override string RenderStringLiteral(string value) { ArgumentNullException.ThrowIfNull(value); - return $"'{value.Replace("'", "''")}'"; + return $"'{EscapeSingleQuote(value)}'"; } /// @@ -388,4 +385,39 @@ public override string RenderNamedPrimaryKeyClause( // PostgreSQL does not support CLUSTERED/NONCLUSTERED. return $"CONSTRAINT {QuoteIdentifier(constraintName)} PRIMARY KEY ({columnList})"; } + + /// + public override string RenderComputedColumnDefinition( + DbColumnName columnName, + string sqlType, + DbColumnName canonicalColumn, + DbColumnName? presenceColumn + ) + { + ArgumentNullException.ThrowIfNull(sqlType); + + var quotedColumn = QuoteIdentifier(columnName.Value); + var quotedCanonical = QuoteIdentifier(canonicalColumn.Value); + + // PostgreSQL uses GENERATED ALWAYS AS ... STORED for computed columns. + // When presenceColumn is provided, emit a CASE expression that returns NULL + // when the presence column is NULL; otherwise, return the canonical value. + if (presenceColumn is { Value: var presenceValue }) + { + var quotedPresence = QuoteIdentifier(presenceValue); + return $"{quotedColumn} {sqlType} GENERATED ALWAYS AS (CASE WHEN {quotedPresence} IS NULL THEN NULL ELSE {quotedCanonical} END) STORED"; + } + + // No presence column — alias always returns the canonical value. + return $"{quotedColumn} {sqlType} GENERATED ALWAYS AS ({quotedCanonical}) STORED"; + } + + /// + /// Returns the fully-qualified, quoted table name escaped for use in string literals + /// (e.g., to_regclass() calls). + /// + private string EscapeQualifiedTable(DbTableName table) + { + return QualifyTable(table).Replace("'", "''"); + } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/RelationalModelDdlEmitter.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/RelationalModelDdlEmitter.cs index 47db49275..5f52d8c75 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/RelationalModelDdlEmitter.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/RelationalModelDdlEmitter.cs @@ -3,106 +3,130 @@ // The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. // See the LICENSE and NOTICES files in the project root for more information. -using System.Text; +using System.Globalization; using EdFi.DataManagementService.Backend.External; namespace EdFi.DataManagementService.Backend.Ddl; /// -/// Emits dialect-specific DDL (schemas, tables, indexes, and triggers) from a derived relational model set. +/// Emits dialect-specific DDL (schemas, tables, indexes, views, and triggers) from a derived relational model set. /// -public sealed class RelationalModelDdlEmitter +public sealed class RelationalModelDdlEmitter(ISqlDialect dialect) { - private readonly ISqlDialectRules _dialectRules; + private readonly ISqlDialect _dialect = dialect ?? throw new ArgumentNullException(nameof(dialect)); + + // Frequently-used column names, allocated once to avoid repetitive allocations. + private static readonly DbColumnName DocumentIdColumn = new("DocumentId"); + private static readonly DbColumnName ContentVersionColumn = new("ContentVersion"); + private static readonly DbColumnName ContentLastModifiedAtColumn = new("ContentLastModifiedAt"); + private static readonly DbColumnName IdentityVersionColumn = new("IdentityVersion"); + private static readonly DbColumnName IdentityLastModifiedAtColumn = new("IdentityLastModifiedAt"); + private static readonly DbColumnName ReferentialIdColumn = new("ReferentialId"); + private static readonly DbColumnName ResourceKeyIdColumn = new("ResourceKeyId"); + private static readonly DbColumnName DiscriminatorColumn = new("Discriminator"); /// - /// Initializes a new DDL emitter using the specified SQL dialect rules. - /// - /// The dialect rules used for quoting and scalar type defaults. - public RelationalModelDdlEmitter(ISqlDialectRules dialectRules) - { - ArgumentNullException.ThrowIfNull(dialectRules); - _dialectRules = dialectRules; - } - - /// - /// Builds a SQL script that creates all schemas, tables, indexes, and triggers in the model set. + /// Builds a SQL script that creates all schemas, tables, indexes, views, and triggers in the model set. /// /// The derived relational model set to emit. /// The emitted DDL script. /// /// Thrown when the model set dialect does not match the emitter dialect rules. /// + /// + /// For SQL Server (MSSQL), the output contains GO batch separators required + /// for CREATE OR ALTER statements. These are processed by sqlcmd/SSMS but + /// are not valid T-SQL. ADO.NET consumers must split on GO lines and execute + /// each batch separately. + /// public string Emit(DerivedRelationalModelSet modelSet) { ArgumentNullException.ThrowIfNull(modelSet); - if (modelSet.Dialect != _dialectRules.Dialect) + if (modelSet.Dialect != _dialect.Rules.Dialect) { throw new InvalidOperationException( - $"Dialect mismatch: model={modelSet.Dialect}, rules={_dialectRules.Dialect}." + $"Dialect mismatch: model={modelSet.Dialect}, rules={_dialect.Rules.Dialect}." ); } - var builder = new StringBuilder(); + var writer = new SqlWriter(_dialect); + + // Phase 1: Schemas + EmitSchemas(writer, modelSet.ProjectSchemasInEndpointOrder); + + // Phase 2: Tables (PK/UK/CHECK only, no cross-table FKs) + EmitTables(writer, modelSet.ConcreteResourcesInNameOrder); + + // Phase 3: Abstract Identity Tables (must precede FKs that reference them) + EmitAbstractIdentityTables(writer, modelSet.AbstractIdentityTablesInNameOrder); + + // Phase 4: Foreign Keys (separate ALTER TABLE statements) + EmitForeignKeys( + writer, + modelSet.ConcreteResourcesInNameOrder, + modelSet.AbstractIdentityTablesInNameOrder + ); + + // Phase 5: Indexes + EmitIndexes(writer, modelSet.IndexesInCreateOrder); - AppendSchemas(builder, modelSet.ProjectSchemasInEndpointOrder); - AppendTables(builder, modelSet.ConcreteResourcesInNameOrder); - AppendIndexes(builder, modelSet.IndexesInCreateOrder); - var tablesByName = BuildTableLookup(modelSet); - AppendTriggers(builder, modelSet.TriggersInCreateOrder, tablesByName); + // Phase 6: Abstract Union Views (must precede Triggers per design) + EmitAbstractUnionViews(writer, modelSet.AbstractUnionViewsInNameOrder); - return builder.ToString(); + // Phase 7: Triggers + EmitTriggers(writer, modelSet.TriggersInCreateOrder); + + return writer.ToString(); } /// - /// Appends CREATE SCHEMA statements for each project schema. + /// Emits CREATE SCHEMA IF NOT EXISTS statements for each project schema. /// - private void AppendSchemas(StringBuilder builder, IReadOnlyList schemas) + private void EmitSchemas(SqlWriter writer, IReadOnlyList schemas) { foreach (var schema in schemas) { - builder.Append("CREATE SCHEMA "); - builder.Append(Quote(schema.PhysicalSchema)); - builder.AppendLine(";"); + writer.AppendLine(_dialect.CreateSchemaIfNotExists(schema.PhysicalSchema)); } if (schemas.Count > 0) { - builder.AppendLine(); + writer.AppendLine(); } } /// - /// Appends CREATE TABLE statements for each table in each concrete resource model. + /// Emits CREATE TABLE IF NOT EXISTS statements for each table in each concrete resource model. /// - private void AppendTables(StringBuilder builder, IReadOnlyList resources) + private void EmitTables(SqlWriter writer, IReadOnlyList resources) { foreach (var resource in resources) { + // Descriptor resources use the shared dms.Descriptor table (emitted by core DDL). + if (resource.StorageKind == ResourceStorageKind.SharedDescriptorTable) + continue; + foreach (var table in resource.RelationalModel.TablesInDependencyOrder) { - AppendCreateTable(builder, table); + EmitCreateTable(writer, table); } } } /// - /// Appends a CREATE TABLE statement including columns, key, and table constraints. + /// Emits a CREATE TABLE IF NOT EXISTS statement including columns, key, and table constraints. /// - private void AppendCreateTable(StringBuilder builder, DbTableModel table) + private void EmitCreateTable(SqlWriter writer, DbTableModel table) { - builder.Append("CREATE TABLE "); - builder.Append(Quote(table.Table)); - builder.AppendLine(" ("); + writer.AppendLine(_dialect.CreateTableHeader(table.Table)); + writer.AppendLine("("); var definitions = new List(); foreach (var column in table.Columns) { - var type = ResolveColumnType(column); - var nullability = column.IsNullable ? "NULL" : "NOT NULL"; - definitions.Add($"{Quote(column.ColumnName)} {type} {nullability}"); + definitions.Add(RenderColumnDefinition(column)); } if (table.Key.Columns.Count > 0) @@ -114,437 +138,1346 @@ private void AppendCreateTable(StringBuilder builder, DbTableModel table) foreach (var constraint in table.Constraints) { - definitions.Add(FormatConstraint(constraint)); + var formatted = FormatConstraint(constraint); + if (formatted is not null) // Skip null (FK) constraints + { + definitions.Add(formatted); + } } - for (var i = 0; i < definitions.Count; i++) + using (writer.Indent()) { - builder.Append(" "); - builder.Append(definitions[i]); - - if (i < definitions.Count - 1) + for (var i = 0; i < definitions.Count; i++) { - builder.Append(','); + writer.Append(definitions[i]); + + if (i < definitions.Count - 1) + { + writer.AppendLine(","); + } + else + { + writer.AppendLine(); + } } - - builder.AppendLine(); } - builder.AppendLine(");"); - builder.AppendLine(); + writer.AppendLine(");"); + writer.AppendLine(); } /// - /// Appends CREATE INDEX statements for each index in create-order. + /// Renders a column definition based on its storage type. + /// Stored columns emit a normal column definition; UnifiedAlias columns emit a computed column. /// - private void AppendIndexes(StringBuilder builder, IReadOnlyList indexes) + private string RenderColumnDefinition(DbColumnModel column) { - foreach (var index in indexes) + var type = ResolveColumnType(column); + + if (column.Storage is ColumnStorage.UnifiedAlias alias) { - var unique = index.IsUnique ? "UNIQUE " : string.Empty; - builder.Append("CREATE "); - builder.Append(unique); - builder.Append("INDEX "); - builder.Append(Quote(index.Name)); - builder.Append(" ON "); - builder.Append(Quote(index.Table)); - builder.Append(" ("); - builder.Append(FormatColumnList(index.KeyColumns)); - builder.AppendLine(");"); - builder.AppendLine(); + return _dialect.RenderComputedColumnDefinition( + column.ColumnName, + type, + alias.CanonicalColumn, + alias.PresenceColumn + ); } + + return _dialect.RenderColumnDefinition(column.ColumnName, type, column.IsNullable); } /// - /// Builds a lookup by table name for all concrete and abstract identity table models. + /// Emits idempotent ALTER TABLE ADD CONSTRAINT statements for all foreign keys. /// - private static IReadOnlyDictionary BuildTableLookup( - DerivedRelationalModelSet modelSet + private void EmitForeignKeys( + SqlWriter writer, + IReadOnlyList resources, + IReadOnlyList abstractIdentityTables ) { - Dictionary tablesByName = new(); - - foreach (var resource in modelSet.ConcreteResourcesInNameOrder) + // Emit FKs for concrete resource tables (skip descriptors — they use shared dms.Descriptor) + foreach (var resource in resources) { + if (resource.StorageKind == ResourceStorageKind.SharedDescriptorTable) + continue; + foreach (var table in resource.RelationalModel.TablesInDependencyOrder) { - tablesByName.TryAdd(table.Table, table); + EmitTableForeignKeys(writer, table); } } - foreach (var abstractIdentityTable in modelSet.AbstractIdentityTablesInNameOrder) + // Emit FKs for abstract identity tables (e.g., DocumentId -> dms.Document) + foreach (var tableInfo in abstractIdentityTables) { - tablesByName.TryAdd(abstractIdentityTable.TableModel.Table, abstractIdentityTable.TableModel); + EmitTableForeignKeys(writer, tableInfo.TableModel); } + } - return tablesByName; + /// + /// Emits foreign key constraints for a single table. + /// + private void EmitTableForeignKeys(SqlWriter writer, DbTableModel table) + { + foreach (var fk in table.Constraints.OfType()) + { + writer.AppendLine( + _dialect.AddForeignKeyConstraint( + table.Table, + fk.Name, + fk.Columns, + fk.TargetTable, + fk.TargetColumns, + fk.OnDelete, + fk.OnUpdate + ) + ); + writer.AppendLine(); + } } /// - /// Appends CREATE TRIGGER statements for each trigger in create-order. + /// Emits CREATE TABLE IF NOT EXISTS statements for abstract identity tables. /// - private void AppendTriggers( - StringBuilder builder, - IReadOnlyList triggers, - IReadOnlyDictionary tablesByName - ) + private void EmitAbstractIdentityTables(SqlWriter writer, IReadOnlyList tables) + { + foreach (var tableInfo in tables) + { + // Reuse existing EmitCreateTable - it already handles all table types + EmitCreateTable(writer, tableInfo.TableModel); + } + } + + /// + /// Emits CREATE INDEX IF NOT EXISTS statements for each index in create-order. + /// Only FK-support and explicit indexes are emitted, since PK and UK indexes are + /// already created by their respective constraint definitions. + /// + private void EmitIndexes(SqlWriter writer, IReadOnlyList indexes) + { + foreach (var index in indexes) + { + // Skip PK and UK indexes - they are already created by constraint definitions + if (index.Kind is DbIndexKind.PrimaryKey or DbIndexKind.UniqueConstraint) + { + continue; + } + + writer.AppendLine( + _dialect.CreateIndexIfNotExists( + index.Table, + index.Name.Value, + index.KeyColumns, + index.IsUnique + ) + ); + writer.AppendLine(); + } + } + + /// + /// Emits CREATE TRIGGER statements for each trigger in create-order. + /// + private void EmitTriggers(SqlWriter writer, IReadOnlyList triggers) { foreach (var trigger in triggers) { - builder.Append("CREATE TRIGGER "); - builder.Append(FormatTriggerName(trigger)); - builder.Append(" ON "); - builder.Append(Quote(trigger.TriggerTable)); - builder.Append(' '); - builder.AppendLine(BuildTriggerBody(trigger, tablesByName)); - builder.AppendLine(); + // Dispatch by dialect enum rather than pattern abstraction for trigger generation. + // Adding a new dialect requires updating this site and: EmitDocumentStampingBody, + // EmitReferentialIdentityBody, EmitAbstractIdentityBody, FormatNullOrTrueCheck, + // EmitStringLiteralWithCast. + if (_dialect.Rules.Dialect == SqlDialect.Pgsql) + { + EmitPgsqlTrigger(writer, trigger); + } + else + { + EmitMssqlTrigger(writer, trigger); + } } } /// - /// Builds a dialect-specific trigger body statement. + /// Emits a PostgreSQL trigger (function + trigger). + /// Uses DROP TRIGGER IF EXISTS + CREATE TRIGGER per design (not CREATE OR REPLACE TRIGGER). /// - private string BuildTriggerBody( - DbTriggerInfo trigger, - IReadOnlyDictionary tablesByName - ) + private void EmitPgsqlTrigger(SqlWriter writer, DbTriggerInfo trigger) { - return _dialectRules.Dialect switch + var funcName = _dialect.Rules.ShortenIdentifier($"TF_{trigger.Name.Value}"); + var schema = trigger.Table.Schema; + + // Function: CREATE OR REPLACE is supported and idempotent + writer.Append("CREATE OR REPLACE FUNCTION "); + writer.Append(Quote(schema)); + writer.Append("."); + writer.Append(Quote(funcName)); + writer.AppendLine("()"); + writer.AppendLine("RETURNS TRIGGER AS $$"); + writer.AppendLine("BEGIN"); + using (writer.Indent()) { - SqlDialect.Pgsql => BuildPgsqlTriggerBody(trigger, tablesByName), - SqlDialect.Mssql => BuildMssqlTriggerBody(trigger, tablesByName), - _ => throw new ArgumentOutOfRangeException( - nameof(_dialectRules.Dialect), - _dialectRules.Dialect, - "Unsupported SQL dialect." - ), + // DocumentStamping triggers fire on DELETE as well. On DELETE there is no NEW row, + // so we bump ContentVersion via OLD, return OLD, and skip the normal body. + if (trigger.Parameters is TriggerKindParameters.DocumentStamping) + { + if (trigger.KeyColumns.Count != 1) + { + throw new InvalidOperationException( + $"DocumentStamping trigger '{trigger.Name.Value}' requires exactly one key column in the PgSQL path, but has {trigger.KeyColumns.Count}." + ); + } + + var deleteKeyColumn = trigger.KeyColumns[0]; + writer.AppendLine("IF TG_OP = 'DELETE' THEN"); + using (writer.Indent()) + { + writer.Append("UPDATE "); + writer.AppendLine(Quote(DmsTableNames.Document)); + writer.Append("SET "); + writer.Append(Quote(ContentVersionColumn)); + writer.Append(" = nextval('"); + writer.Append(FormatSequenceName()); + writer.Append("'), "); + writer.Append(Quote(ContentLastModifiedAtColumn)); + writer.AppendLine(" = now()"); + writer.Append("WHERE "); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" = OLD."); + writer.Append(Quote(deleteKeyColumn)); + writer.AppendLine(";"); + writer.AppendLine("RETURN OLD;"); + } + writer.AppendLine("END IF;"); + } + + EmitTriggerBody(writer, trigger); + writer.AppendLine("RETURN NEW;"); + } + writer.AppendLine("END;"); + writer.AppendLine("$$ LANGUAGE plpgsql;"); + writer.AppendLine(); + + // Trigger: Use DROP + CREATE pattern per design (ddl-generation.md:260-262) + // PostgreSQL's CREATE OR REPLACE TRIGGER is not available in all versions, + // so we use the idempotent DROP IF EXISTS + CREATE pattern. + writer.AppendLine(_dialect.DropTriggerIfExists(trigger.Table, trigger.Name.Value)); + writer.Append("CREATE TRIGGER "); + writer.AppendLine(Quote(trigger.Name)); + + // DocumentStamping triggers must also fire on DELETE so that change-event consumers + // detect document removal via a bumped ContentVersion. + var pgsqlTriggerEvent = + trigger.Parameters is TriggerKindParameters.DocumentStamping + ? "BEFORE INSERT OR UPDATE OR DELETE ON " + : "BEFORE INSERT OR UPDATE ON "; + writer.Append(pgsqlTriggerEvent); + writer.AppendLine(Quote(trigger.Table)); + writer.AppendLine("FOR EACH ROW"); + writer.Append("EXECUTE FUNCTION "); + writer.Append(Quote(schema)); + writer.Append("."); + writer.Append(Quote(funcName)); + writer.AppendLine("();"); + writer.AppendLine(); + } + + /// + /// Emits a SQL Server trigger. + /// + private void EmitMssqlTrigger(SqlWriter writer, DbTriggerInfo trigger) + { + // CREATE OR ALTER TRIGGER must be the first statement in a T-SQL batch. + writer.AppendLine("GO"); + writer.Append("CREATE OR ALTER TRIGGER "); + writer.Append(Quote(trigger.Table.Schema)); + writer.Append("."); + writer.AppendLine(Quote(trigger.Name)); + writer.Append("ON "); + writer.AppendLine(Quote(trigger.Table)); + var mssqlTriggerEvent = trigger.Parameters switch + { + TriggerKindParameters.IdentityPropagationFallback => "AFTER UPDATE", + TriggerKindParameters.DocumentStamping => "AFTER INSERT, UPDATE, DELETE", + _ => "AFTER INSERT, UPDATE", }; + writer.AppendLine(mssqlTriggerEvent); + writer.AppendLine("AS"); + writer.AppendLine("BEGIN"); + using (writer.Indent()) + { + writer.AppendLine("SET NOCOUNT ON;"); + EmitTriggerBody(writer, trigger); + } + writer.AppendLine("END;"); + writer.AppendLine(); + } + + /// + /// Emits the trigger body logic based on trigger kind. + /// + private void EmitTriggerBody(SqlWriter writer, DbTriggerInfo trigger) + { + switch (trigger.Parameters) + { + case TriggerKindParameters.DocumentStamping: + EmitDocumentStampingBody(writer, trigger); + break; + case TriggerKindParameters.ReferentialIdentityMaintenance refId: + EmitReferentialIdentityBody(writer, trigger, refId); + break; + case TriggerKindParameters.AbstractIdentityMaintenance abstractId: + EmitAbstractIdentityBody(writer, trigger, abstractId); + break; + case TriggerKindParameters.IdentityPropagationFallback propagation: + EmitIdentityPropagationBody(writer, trigger, propagation); + break; + default: + throw new ArgumentOutOfRangeException(nameof(trigger.Parameters)); + } } /// - /// Builds a PostgreSQL trigger body statement. + /// Emits document stamping trigger body that stamps dms.Document.ContentVersion + /// and (for root tables with identity projection columns) IdentityVersion on writes. /// - private string BuildPgsqlTriggerBody( + private void EmitDocumentStampingBody(SqlWriter writer, DbTriggerInfo trigger) + { + if (trigger.KeyColumns.Count != 1) + throw new InvalidOperationException( + $"DocumentStamping trigger '{trigger.Name.Value}' requires exactly one key column, but has {trigger.KeyColumns.Count}." + ); + + var documentTable = Quote(DmsTableNames.Document); + var sequenceName = FormatSequenceName(); + var keyColumn = trigger.KeyColumns[0]; + + if (_dialect.Rules.Dialect == SqlDialect.Pgsql) + { + EmitPgsqlDocumentStampingBody(writer, trigger, documentTable, sequenceName, keyColumn); + } + else + { + EmitMssqlDocumentStampingBody(writer, trigger, documentTable, sequenceName, keyColumn); + } + } + + private void EmitPgsqlDocumentStampingBody( + SqlWriter writer, DbTriggerInfo trigger, - IReadOnlyDictionary tablesByName + string documentTable, + string sequenceName, + DbColumnName keyColumn ) { - if (!TriggerNeedsIdentityDiffCompare(trigger)) + // ContentVersion stamp + writer.Append("UPDATE "); + writer.AppendLine(documentTable); + writer.Append("SET "); + writer.Append(Quote(ContentVersionColumn)); + writer.Append(" = nextval('"); + writer.Append(sequenceName); + writer.Append("'), "); + writer.Append(Quote(ContentLastModifiedAtColumn)); + writer.AppendLine(" = now()"); + writer.Append("WHERE "); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" = NEW."); + writer.Append(Quote(keyColumn)); + writer.AppendLine(";"); + + // IdentityVersion stamp for root tables with identity projection columns + if (trigger.IdentityProjectionColumns.Count > 0) { - return $"EXECUTE FUNCTION {Quote("noop")}();"; + // PostgreSQL: IS DISTINCT FROM provides null-safe inequality comparison. + // (NULL IS DISTINCT FROM NULL) → false, (NULL IS DISTINCT FROM value) → true. + // Equivalent to MSSQL's EmitMssqlNullSafeNotEqual pattern which expands to: + // (a <> b OR (a IS NULL AND b IS NOT NULL) OR (a IS NOT NULL AND b IS NULL)) + writer.Append("IF TG_OP = 'UPDATE' AND ("); + EmitPgsqlValueDiffDisjunction(writer, trigger.IdentityProjectionColumns); + writer.AppendLine(") THEN"); + + using (writer.Indent()) + { + writer.Append("UPDATE "); + writer.AppendLine(documentTable); + writer.Append("SET "); + writer.Append(Quote(IdentityVersionColumn)); + writer.Append(" = nextval('"); + writer.Append(sequenceName); + writer.Append("'), "); + writer.Append(Quote(IdentityLastModifiedAtColumn)); + writer.AppendLine(" = now()"); + writer.Append("WHERE "); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" = NEW."); + writer.Append(Quote(keyColumn)); + writer.AppendLine(";"); + } + + writer.AppendLine("END IF;"); } + } - var triggerTable = ResolveTriggerTable(trigger, tablesByName); - var identityDiffPredicate = BuildIdentityDiffPredicate( - trigger, - triggerTable, - oldRowAlias: "OLD", - newRowAlias: "NEW" - ); + private void EmitMssqlDocumentStampingBody( + SqlWriter writer, + DbTriggerInfo trigger, + string documentTable, + string sequenceName, + DbColumnName keyColumn + ) + { + // ContentVersion stamp — use a CTE that unions inserted and deleted so that + // INSERT, UPDATE, and DELETE all bump the version. + var quotedKeyColumn = Quote(keyColumn); + writer.Append(";WITH affectedDocs AS (SELECT "); + writer.Append(quotedKeyColumn); + writer.Append(" FROM inserted UNION SELECT "); + writer.Append(quotedKeyColumn); + writer.AppendLine(" FROM deleted)"); + writer.AppendLine("UPDATE d"); + writer.Append("SET d."); + writer.Append(Quote(ContentVersionColumn)); + writer.Append(" = NEXT VALUE FOR "); + writer.Append(sequenceName); + writer.Append(", d."); + writer.Append(Quote(ContentLastModifiedAtColumn)); + writer.AppendLine(" = sysutcdatetime()"); + writer.Append("FROM "); + writer.Append(documentTable); + writer.AppendLine(" d"); + writer.Append("INNER JOIN affectedDocs a ON d."); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" = a."); + writer.Append(quotedKeyColumn); + writer.AppendLine(";"); + + // IdentityVersion stamp for root tables with identity projection columns + if (trigger.IdentityProjectionColumns.Count > 0) + { + // Performance pre-filter: UPDATE(col) returns true if the column appeared in the SET clause, + // regardless of whether the value actually changed. The WHERE clause below (using null-safe + // inequality) is the authoritative value-change check that filters to only actually changed rows. + writer.Append("IF EXISTS (SELECT 1 FROM deleted) AND ("); + EmitMssqlUpdateColumnDisjunction(writer, trigger.IdentityProjectionColumns); + writer.AppendLine(")"); + + writer.AppendLine("BEGIN"); + + using (writer.Indent()) + { + writer.AppendLine("UPDATE d"); + writer.Append("SET d."); + writer.Append(Quote(IdentityVersionColumn)); + writer.Append(" = NEXT VALUE FOR "); + writer.Append(sequenceName); + writer.Append(", d."); + writer.Append(Quote(IdentityLastModifiedAtColumn)); + writer.AppendLine(" = sysutcdatetime()"); + writer.Append("FROM "); + writer.Append(documentTable); + writer.AppendLine(" d"); + writer.Append("INNER JOIN inserted i ON d."); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" = i."); + writer.AppendLine(Quote(keyColumn)); + writer.Append("INNER JOIN deleted del ON del."); + writer.Append(Quote(keyColumn)); + writer.Append(" = i."); + writer.AppendLine(Quote(keyColumn)); + writer.Append("WHERE "); + for (int i = 0; i < trigger.IdentityProjectionColumns.Count; i++) + { + if (i > 0) + { + writer.Append(" OR "); + } + var col = Quote(trigger.IdentityProjectionColumns[i]); + EmitMssqlNullSafeNotEqual(writer, "i", col, "del", col); + } + writer.AppendLine(";"); + } - return $"WHEN ({identityDiffPredicate}) EXECUTE FUNCTION {Quote("noop")}();"; + writer.AppendLine("END"); + } } /// - /// Builds a SQL Server trigger body statement. + /// Emits referential identity maintenance trigger body that maintains + /// dms.ReferentialIdentity rows via UUIDv5 computation. /// - private string BuildMssqlTriggerBody( + private void EmitReferentialIdentityBody( + SqlWriter writer, DbTriggerInfo trigger, - IReadOnlyDictionary tablesByName + TriggerKindParameters.ReferentialIdentityMaintenance refId ) { - if (!TriggerNeedsIdentityDiffCompare(trigger)) + // Consolidated guard: both dialect paths require at least one identity element. + if (refId.IdentityElements.Count == 0) { - return """ -AS -BEGIN - SET NOCOUNT ON; -END; -"""; + throw new InvalidOperationException( + $"ReferentialIdentityMaintenance trigger requires at least one identity element " + + $"for resource '{refId.ResourceName}'. This indicates a bug in the model derivation phase." + ); } - if (trigger.KeyColumns.Count == 0) + if (_dialect.Rules.Dialect == SqlDialect.Pgsql) { - throw new InvalidOperationException( - $"Trigger '{trigger.Name.Value}' on '{trigger.TriggerTable}' requires key columns for identity diff comparison." + EmitPgsqlReferentialIdentityBody(writer, trigger.IdentityProjectionColumns, refId); + } + else + { + EmitMssqlReferentialIdentityBody(writer, trigger.IdentityProjectionColumns, refId); + } + } + + private void EmitPgsqlReferentialIdentityBody( + SqlWriter writer, + IReadOnlyList identityProjectionColumns, + TriggerKindParameters.ReferentialIdentityMaintenance refId + ) + { + // Guard: skip recomputation on no-op UPDATEs where identity columns didn't change + writer.Append("IF TG_OP = 'INSERT' OR ("); + EmitPgsqlValueDiffDisjunction(writer, identityProjectionColumns); + writer.AppendLine(") THEN"); + + using (writer.Indent()) + { + var refIdTable = Quote(DmsTableNames.ReferentialIdentity); + + // Primary referential identity + EmitPgsqlReferentialIdentityBlock( + writer, + refIdTable, + refId.ResourceKeyId, + refId.ProjectName, + refId.ResourceName, + refId.IdentityElements ); + + // Superclass alias + if (refId.SuperclassAlias is { } alias) + { + EmitPgsqlReferentialIdentityBlock( + writer, + refIdTable, + alias.ResourceKeyId, + alias.ProjectName, + alias.ResourceName, + alias.IdentityElements + ); + } } - var triggerTable = ResolveTriggerTable(trigger, tablesByName); - var keyJoinPredicate = BuildKeyJoinPredicate(trigger.KeyColumns, "i", "d"); - var identityDiffPredicate = BuildIdentityDiffPredicate( - trigger, - triggerTable, - oldRowAlias: "d", - newRowAlias: "i" - ); - var firstKeyColumn = trigger.KeyColumns[0]; - - return $$""" -AS -BEGIN - SET NOCOUNT ON; - IF EXISTS ( - SELECT 1 - FROM inserted i - FULL OUTER JOIN deleted d - ON {{keyJoinPredicate}} - WHERE {{QualifyColumn("i", firstKeyColumn)}} IS NULL - OR {{QualifyColumn("d", firstKeyColumn)}} IS NULL - OR {{identityDiffPredicate}} + writer.AppendLine("END IF;"); + } + + private void EmitPgsqlReferentialIdentityBlock( + SqlWriter writer, + string refIdTable, + short resourceKeyId, + string projectName, + string resourceName, + IReadOnlyList identityElements ) - BEGIN - END -END; -"""; + { + var uuidv5Func = FormatUuidv5FunctionName(); + + // DELETE existing row + writer.Append("DELETE FROM "); + writer.AppendLine(refIdTable); + writer.Append("WHERE "); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" = NEW."); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(" AND "); + writer.Append(Quote(ResourceKeyIdColumn)); + writer.Append(" = "); + writer.Append(resourceKeyId.ToString(CultureInfo.InvariantCulture)); + writer.AppendLine(";"); + + // INSERT new row with UUIDv5 + writer.Append("INSERT INTO "); + writer.Append(refIdTable); + writer.Append(" ("); + writer.Append(Quote(ReferentialIdColumn)); + writer.Append(", "); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(", "); + writer.Append(Quote(ResourceKeyIdColumn)); + writer.AppendLine(")"); + writer.Append("VALUES ("); + writer.Append(uuidv5Func); + writer.Append("('"); + writer.Append(Uuidv5Namespace); + // Format intentionally matches ReferentialIdCalculator.ResourceInfoString: {ProjectName}{ResourceName} + // with no separator — do not add one without updating the calculator. + writer.Append("'::uuid, '"); + writer.Append(SqlDialectBase.EscapeSingleQuote(projectName)); + writer.Append(SqlDialectBase.EscapeSingleQuote(resourceName)); + writer.Append("' || "); + EmitPgsqlIdentityHashExpression(writer, identityElements); + writer.Append("), NEW."); + writer.Append(Quote(DocumentIdColumn)); + writer.Append(", "); + writer.Append(resourceKeyId.ToString(CultureInfo.InvariantCulture)); + writer.AppendLine(");"); } /// - /// Resolves the trigger table model required for storage-aware identity expressions. + /// Emits the PostgreSQL identity hash expression for UUIDv5 computation. /// - private static DbTableModel ResolveTriggerTable( - DbTriggerInfo trigger, - IReadOnlyDictionary tablesByName + /// + /// Identity columns are guaranteed NOT NULL because they are resource key parts + /// (the identity of the resource). The column model derivation ensures these columns + /// are created with NOT NULL constraints, so COALESCE is not needed here. + /// + private void EmitPgsqlIdentityHashExpression( + SqlWriter writer, + IReadOnlyList elements ) { - if (tablesByName.TryGetValue(trigger.TriggerTable, out var triggerTable)) + for (int i = 0; i < elements.Count; i++) { - return triggerTable; + if (i > 0) + writer.Append(" || '#' || "); + writer.Append("'$"); + writer.Append(SqlDialectBase.EscapeSingleQuote(elements[i].IdentityJsonPath)); + writer.Append("=' || "); + EmitPgsqlColumnToText(writer, elements[i].Column, elements[i].ScalarType); } - - throw new InvalidOperationException( - $"Trigger '{trigger.Name.Value}' referenced table '{trigger.TriggerTable}' that was not found in the model set." - ); } /// - /// Determines whether a trigger kind requires identity value-diff comparison logic. + /// Emits a type-aware text conversion for an identity column value in PostgreSQL. + /// Uses ::text for most types (already ISO-stable) but explicit to_char() + /// for where ::text omits the ISO 8601 T separator. /// - private static bool TriggerNeedsIdentityDiffCompare(DbTriggerInfo trigger) + private void EmitPgsqlColumnToText(SqlWriter writer, DbColumnName column, RelationalScalarType scalarType) { - return trigger.Kind is not DbTriggerKind.IdentityPropagationFallback - && trigger.IdentityProjectionColumns.Count > 0; + var quoted = Quote(column); + switch (scalarType.Kind) + { + case ScalarKind.DateTime: + // PG timestamp::text gives 'YYYY-MM-DD HH:MM:SS' (space, no T). + // Use to_char for ISO 8601 with T separator. + // + // No AT TIME ZONE 'UTC' conversion: the PG column type is timestamptz, which + // stores UTC internally but displays in the session timezone. The trigger fires + // in the same session as the INSERT/UPDATE, so to_char always reproduces the + // original literal that was inserted — matching what Core's ReferentialIdCalculator + // hashes from the raw JSON string. Adding AT TIME ZONE 'UTC' here would break + // parity because the C# path does not normalize to UTC before hashing. + // The DMS application must use a consistent session timezone (UTC recommended). + // See also EmitMssqlColumnToNvarchar (datetime2 is timezone-naive, no issue). + writer.Append("to_char(NEW."); + writer.Append(quoted); + writer.Append(", 'YYYY-MM-DD\"T\"HH24:MI:SS')"); + break; + + default: + // String, Int32, Int64, Date, Time, Decimal, Boolean — ::text is deterministic. + writer.Append("NEW."); + writer.Append(quoted); + writer.Append("::text"); + break; + } } - /// - /// Builds an identity value-diff predicate by expanding each identity projection column through storage metadata. - /// - private string BuildIdentityDiffPredicate( - DbTriggerInfo trigger, - DbTableModel triggerTable, - string oldRowAlias, - string newRowAlias + private void EmitMssqlReferentialIdentityBody( + SqlWriter writer, + IReadOnlyList identityProjectionColumns, + TriggerKindParameters.ReferentialIdentityMaintenance refId ) { - var columnsByName = triggerTable.Columns.ToDictionary(c => c.ColumnName); - - return string.Join( - " OR ", - trigger.IdentityProjectionColumns.Select(identityColumn => - { - var oldValueExpression = BuildIdentityValueExpression( - trigger, - columnsByName, - identityColumn, - oldRowAlias - ); - var newValueExpression = BuildIdentityValueExpression( - trigger, - columnsByName, - identityColumn, - newRowAlias - ); + var refIdTable = Quote(DmsTableNames.ReferentialIdentity); - return BuildNullSafeDifferencePredicate(oldValueExpression, newValueExpression); - }) + EmitMssqlInsertUpdateDispatch( + writer, + identityProjectionColumns, + isInsert => EmitMssqlReferentialIdentityBlock(writer, refIdTable, refId, isInsert) ); } /// - /// Builds the storage-aware SQL value expression for an identity projection column. + /// Emits the DELETE + INSERT block for one referential identity resource key. + /// When is true, scopes to all inserted rows; + /// otherwise scopes to the @changedDocs value-diff workset. /// - private string BuildIdentityValueExpression( - DbTriggerInfo trigger, - IReadOnlyDictionary columnsByName, - DbColumnName identityColumn, - string rowAlias + private void EmitMssqlReferentialIdentityBlock( + SqlWriter writer, + string refIdTable, + TriggerKindParameters.ReferentialIdentityMaintenance refId, + bool isInsert ) { - if (!columnsByName.TryGetValue(identityColumn, out var column)) + // Primary referential identity + EmitMssqlReferentialIdentityUpsert( + writer, + refIdTable, + refId.ResourceKeyId, + refId.ProjectName, + refId.ResourceName, + refId.IdentityElements, + isInsert + ); + + // Superclass alias + if (refId.SuperclassAlias is { } alias) { - throw new InvalidOperationException( - $"Trigger '{trigger.Name.Value}' on '{trigger.TriggerTable}' referenced identity projection column " - + $"'{identityColumn.Value}' that was not found on the trigger table." + EmitMssqlReferentialIdentityUpsert( + writer, + refIdTable, + alias.ResourceKeyId, + alias.ProjectName, + alias.ResourceName, + alias.IdentityElements, + isInsert ); } - - return column.Storage switch - { - ColumnStorage.Stored => QualifyColumn(rowAlias, identityColumn), - ColumnStorage.UnifiedAlias unifiedAlias => BuildUnifiedAliasExpression(rowAlias, unifiedAlias), - _ => throw new ArgumentOutOfRangeException( - nameof(column.Storage), - column.Storage, - "Unsupported column storage." - ), - }; } /// - /// Builds the value expression for a unified alias column, including optional presence gating. + /// Emits a DELETE + INSERT pair for a single resource key's referential identity rows. + /// When is true, scopes to all inserted rows; + /// otherwise scopes to the @changedDocs value-diff workset. /// - private string BuildUnifiedAliasExpression(string rowAlias, ColumnStorage.UnifiedAlias unifiedAlias) + private void EmitMssqlReferentialIdentityUpsert( + SqlWriter writer, + string refIdTable, + short resourceKeyId, + string projectName, + string resourceName, + IReadOnlyList identityElements, + bool isInsert + ) { - var canonicalExpression = QualifyColumn(rowAlias, unifiedAlias.CanonicalColumn); - - if (unifiedAlias.PresenceColumn is not { } presenceColumn) + var sourceAlias = isInsert ? "inserted" : "@changedDocs"; + var uuidv5Func = FormatUuidv5FunctionName(); + var documentIdCol = Quote(DocumentIdColumn); + + // DELETE existing rows scoped to the source (all inserted or only changed) + writer.Append("DELETE FROM "); + writer.AppendLine(refIdTable); + writer.Append("WHERE "); + writer.Append(documentIdCol); + writer.Append(" IN (SELECT "); + writer.Append(documentIdCol); + writer.Append(" FROM "); + writer.Append(sourceAlias); + writer.Append(") AND "); + writer.Append(Quote(ResourceKeyIdColumn)); + writer.Append(" = "); + writer.Append(resourceKeyId.ToString(CultureInfo.InvariantCulture)); + writer.AppendLine(";"); + + // INSERT new rows with UUIDv5 — always join back to 'inserted' for column values + // (changedDocs only carries DocumentId; inserted has the full row). + writer.Append("INSERT INTO "); + writer.Append(refIdTable); + writer.Append(" ("); + writer.Append(Quote(ReferentialIdColumn)); + writer.Append(", "); + writer.Append(documentIdCol); + writer.Append(", "); + writer.Append(Quote(ResourceKeyIdColumn)); + writer.AppendLine(")"); + writer.Append("SELECT "); + writer.Append(uuidv5Func); + writer.Append("('"); + writer.Append(Uuidv5Namespace); + // Format intentionally matches ReferentialIdCalculator.ResourceInfoString: {ProjectName}{ResourceName} + // with no separator — do not add one without updating the calculator. + writer.Append("', CAST(N'"); + writer.Append(SqlDialectBase.EscapeSingleQuote(projectName)); + writer.Append(SqlDialectBase.EscapeSingleQuote(resourceName)); + writer.Append("' AS nvarchar(max)) + "); + EmitMssqlIdentityHashExpression(writer, identityElements); + writer.Append("), i."); + writer.Append(documentIdCol); + writer.Append(", "); + writer.AppendLine(resourceKeyId.ToString(CultureInfo.InvariantCulture)); + writer.Append("FROM inserted i"); + if (!isInsert) { - return canonicalExpression; + writer.Append(" INNER JOIN "); + writer.Append(sourceAlias); + writer.Append(" cd ON cd."); + writer.Append(documentIdCol); + writer.Append(" = i."); + writer.Append(documentIdCol); } + writer.AppendLine(";"); + } - return $"CASE WHEN {QualifyColumn(rowAlias, presenceColumn)} IS NULL THEN NULL ELSE {canonicalExpression} END"; + private void EmitMssqlIdentityHashExpression( + SqlWriter writer, + IReadOnlyList elements + ) + { + for (int i = 0; i < elements.Count; i++) + { + if (i > 0) + writer.Append(" + N'#' + "); + writer.Append("N'$"); + writer.Append(SqlDialectBase.EscapeSingleQuote(elements[i].IdentityJsonPath)); + writer.Append("=' + "); + EmitMssqlColumnToNvarchar(writer, elements[i].Column, elements[i].ScalarType); + } } /// - /// Builds a null-safe value-diff predicate for a pair of SQL expressions. + /// Emits a type-aware nvarchar conversion for an identity column value in MSSQL. + /// Uses deterministic CONVERT styles for temporal types to ensure cross-engine parity + /// with PostgreSQL and Core's JsonValue.ToString(). /// - private string BuildNullSafeDifferencePredicate(string oldValueExpression, string newValueExpression) + private void EmitMssqlColumnToNvarchar( + SqlWriter writer, + DbColumnName column, + RelationalScalarType scalarType + ) { - return _dialectRules.Dialect switch + var quoted = Quote(column); + switch (scalarType.Kind) { - SqlDialect.Pgsql => $"(({oldValueExpression}) IS DISTINCT FROM ({newValueExpression}))", - SqlDialect.Mssql => $"(({oldValueExpression} <> {newValueExpression}) " - + $"OR ({oldValueExpression} IS NULL AND {newValueExpression} IS NOT NULL) " - + $"OR ({oldValueExpression} IS NOT NULL AND {newValueExpression} IS NULL))", - _ => throw new ArgumentOutOfRangeException( - nameof(_dialectRules.Dialect), - _dialectRules.Dialect, - "Unsupported SQL dialect." - ), - }; + case ScalarKind.String: + // Already nvarchar — no cast needed. + writer.Append("i."); + writer.Append(quoted); + break; + + case ScalarKind.Date: + // ISO 8601: YYYY-MM-DD (CONVERT style 23). + writer.Append("CONVERT(nvarchar(10), i."); + writer.Append(quoted); + writer.Append(", 23)"); + break; + + case ScalarKind.DateTime: + // ISO 8601: YYYY-MM-DDTHH:mm:ss (CONVERT style 126, truncated to 19 chars). + // Truncation to whole seconds matches PG to_char() which also omits fractional + // seconds, ensuring cross-engine identity hash parity. + writer.Append("CONVERT(nvarchar(19), i."); + writer.Append(quoted); + writer.Append(", 126)"); + break; + + case ScalarKind.Time: + // HH:mm:ss (CONVERT style 108). + writer.Append("CONVERT(nvarchar(8), i."); + writer.Append(quoted); + writer.Append(", 108)"); + break; + + case ScalarKind.Boolean: + // CAST(bit AS nvarchar) produces '1'/'0', but Core's JsonValue.ToString() + // and PG bool::text both produce 'true'/'false'. Use CASE to match. + writer.Append("CASE WHEN i."); + writer.Append(quoted); + writer.Append(" = 1 THEN N'true' ELSE N'false' END"); + break; + + default: + // Int32, Int64, Decimal — CAST is deterministic and matches Core/PG formatting. + writer.Append("CAST(i."); + writer.Append(quoted); + writer.Append(" AS nvarchar(max))"); + break; + } } /// - /// Builds a null-safe join predicate for trigger key columns. + /// Emits abstract identity maintenance trigger body that maintains abstract identity + /// tables from concrete resource root tables. /// - private string BuildKeyJoinPredicate( - IReadOnlyList keyColumns, - string leftRowAlias, - string rightRowAlias + private void EmitAbstractIdentityBody( + SqlWriter writer, + DbTriggerInfo trigger, + TriggerKindParameters.AbstractIdentityMaintenance abstractId ) { - return string.Join( - " AND ", - keyColumns.Select(keyColumn => - BuildNullSafeEqualityPredicate( - QualifyColumn(leftRowAlias, keyColumn), - QualifyColumn(rightRowAlias, keyColumn) + if (_dialect.Rules.Dialect == SqlDialect.Pgsql) + { + EmitPgsqlAbstractIdentityBody( + writer, + trigger.IdentityProjectionColumns, + abstractId.TargetTable, + abstractId.TargetColumnMappings, + abstractId.DiscriminatorValue + ); + } + else + { + EmitMssqlAbstractIdentityBody( + writer, + trigger.IdentityProjectionColumns, + abstractId.TargetTable, + abstractId.TargetColumnMappings, + abstractId.DiscriminatorValue + ); + } + } + + private void EmitPgsqlAbstractIdentityBody( + SqlWriter writer, + IReadOnlyList identityProjectionColumns, + DbTableName targetTableName, + IReadOnlyList mappings, + string discriminatorValue + ) + { + // Guard: skip recomputation on no-op UPDATEs where identity columns didn't change + writer.Append("IF TG_OP = 'INSERT' OR ("); + EmitPgsqlValueDiffDisjunction(writer, identityProjectionColumns); + writer.AppendLine(") THEN"); + + using (writer.Indent()) + { + var targetTable = Quote(targetTableName); + + // INSERT ... ON CONFLICT DO UPDATE + writer.Append("INSERT INTO "); + writer.Append(targetTable); + writer.Append(" ("); + writer.Append(Quote(DocumentIdColumn)); + foreach (var mapping in mappings) + { + writer.Append(", "); + writer.Append(Quote(mapping.TargetColumn)); + } + writer.Append(", "); + writer.Append(Quote(DiscriminatorColumn)); + writer.AppendLine(")"); + + writer.Append("VALUES (NEW."); + writer.Append(Quote(DocumentIdColumn)); + foreach (var mapping in mappings) + { + writer.Append(", NEW."); + writer.Append(Quote(mapping.SourceColumn)); + } + writer.Append(", '"); + writer.Append(SqlDialectBase.EscapeSingleQuote(discriminatorValue)); + writer.AppendLine("')"); + + writer.Append("ON CONFLICT ("); + writer.Append(Quote(DocumentIdColumn)); + writer.AppendLine(")"); + + writer.Append("DO UPDATE SET "); + for (int i = 0; i < mappings.Count; i++) + { + if (i > 0) + writer.Append(", "); + writer.Append(Quote(mappings[i].TargetColumn)); + writer.Append(" = EXCLUDED."); + writer.Append(Quote(mappings[i].TargetColumn)); + } + writer.AppendLine(";"); + } + + writer.AppendLine("END IF;"); + } + + private void EmitMssqlAbstractIdentityBody( + SqlWriter writer, + IReadOnlyList identityProjectionColumns, + DbTableName targetTableName, + IReadOnlyList mappings, + string discriminatorValue + ) + { + EmitMssqlInsertUpdateDispatch( + writer, + identityProjectionColumns, + isInsert => + EmitMssqlAbstractIdentityMerge( + writer, + targetTableName, + mappings, + discriminatorValue, + isInsert ) - ) ); } /// - /// Builds a null-safe equality predicate for a pair of SQL expressions. + /// Shared MSSQL INSERT/UPDATE dispatch skeleton. Emits the IF NOT EXISTS (deleted) / ELSE IF UPDATE() + /// branching structure, delegating the block-specific logic to . /// - private static string BuildNullSafeEqualityPredicate( - string leftValueExpression, - string rightValueExpression + private void EmitMssqlInsertUpdateDispatch( + SqlWriter writer, + IReadOnlyList identityProjectionColumns, + Action emitBlock ) { - return $"(({leftValueExpression} = {rightValueExpression}) OR ({leftValueExpression} IS NULL AND {rightValueExpression} IS NULL))"; + // INSERT case: no deleted rows, so process all inserted rows. + writer.AppendLine("IF NOT EXISTS (SELECT 1 FROM deleted)"); + writer.AppendLine("BEGIN"); + + using (writer.Indent()) + { + emitBlock(true); + } + + writer.AppendLine("END"); + + // UPDATE case: use UPDATE(col) as a performance pre-filter only, then compute a value-diff + // workset to find rows whose identity projection values actually changed (null-safe). + // This is critical for key-unification correctness: UPDATE(aliasColumn) returns false when + // a CASCADE updates the canonical column, so UPDATE() alone would miss those changes. + writer.Append("ELSE IF ("); + EmitMssqlUpdateColumnDisjunction(writer, identityProjectionColumns); + writer.AppendLine(")"); + writer.AppendLine("BEGIN"); + + using (writer.Indent()) + { + EmitMssqlValueDiffWorkset(writer, identityProjectionColumns); + emitBlock(false); + } + + writer.AppendLine("END"); } /// - /// Formats a row-alias-qualified and quoted column reference. + /// Emits a MERGE statement for abstract identity maintenance. + /// When is true, scopes to all inserted rows; + /// otherwise scopes to the @changedDocs value-diff workset. /// - private string QualifyColumn(string rowAlias, DbColumnName column) + private void EmitMssqlAbstractIdentityMerge( + SqlWriter writer, + DbTableName targetTableName, + IReadOnlyList mappings, + string discriminatorValue, + bool isInsert + ) { - return $"{rowAlias}.{Quote(column)}"; + var targetTable = Quote(targetTableName); + var documentIdCol = Quote(DocumentIdColumn); + + // Build the USING source: either 'inserted' directly, or 'inserted' filtered via changedDocs. + writer.Append("MERGE "); + writer.Append(targetTable); + writer.AppendLine(" AS t"); + if (isInsert) + { + writer.Append("USING inserted AS s ON t."); + } + else + { + writer.Append("USING (SELECT i.* FROM inserted i INNER JOIN "); + writer.Append("@changedDocs"); + writer.Append(" cd ON cd."); + writer.Append(documentIdCol); + writer.Append(" = i."); + writer.Append(documentIdCol); + writer.Append(") AS s ON t."); + } + writer.Append(documentIdCol); + writer.Append(" = s."); + writer.AppendLine(documentIdCol); + + // WHEN MATCHED THEN UPDATE + writer.Append("WHEN MATCHED THEN UPDATE SET "); + for (int i = 0; i < mappings.Count; i++) + { + if (i > 0) + writer.Append(", "); + writer.Append("t."); + writer.Append(Quote(mappings[i].TargetColumn)); + writer.Append(" = s."); + writer.Append(Quote(mappings[i].SourceColumn)); + } + writer.AppendLine(); + + // WHEN NOT MATCHED THEN INSERT + writer.Append("WHEN NOT MATCHED THEN INSERT ("); + writer.Append(documentIdCol); + foreach (var mapping in mappings) + { + writer.Append(", "); + writer.Append(Quote(mapping.TargetColumn)); + } + writer.Append(", "); + writer.Append(Quote(DiscriminatorColumn)); + writer.AppendLine(")"); + + writer.Append("VALUES (s."); + writer.Append(documentIdCol); + foreach (var mapping in mappings) + { + writer.Append(", s."); + writer.Append(Quote(mapping.SourceColumn)); + } + writer.Append(", N'"); + writer.Append(SqlDialectBase.EscapeSingleQuote(discriminatorValue)); + writer.AppendLine("');"); } /// - /// Resolves the SQL type for a column using explicit scalar type metadata or dialect defaults. + /// Emits identity propagation fallback trigger body (MSSQL only) that cascades + /// identity column updates to referrer tables when ON UPDATE CASCADE is not available. + /// The trigger is placed on the referenced entity and propagates to all referrers. /// - private string ResolveColumnType(DbColumnModel column) + private void EmitIdentityPropagationBody( + SqlWriter writer, + DbTriggerInfo trigger, + TriggerKindParameters.IdentityPropagationFallback propagation + ) { - var scalarType = column.ScalarType; + if (_dialect.Rules.Dialect != SqlDialect.Mssql) + { + throw new InvalidOperationException( + $"Identity propagation fallback triggers are only supported for MSSQL, but dialect is {_dialect.Rules.Dialect}." + ); + } - if (scalarType is null) + if (propagation.ReferrerUpdates.Count == 0) { - return column.Kind switch + throw new InvalidOperationException( + "IdentityPropagationFallback trigger was created with zero referrer updates. " + + "This indicates a bug in DeriveTriggerInventoryPass — triggers with no " + + "referrers should be skipped." + ); + } + + var documentIdCol = Quote(DocumentIdColumn); + + // Performance pre-filter: UPDATE(col) returns true if the column appeared in the SET + // clause, regardless of whether the value actually changed. This short-circuits the + // entire trigger body when non-identity columns are updated, avoiding the cost of + // joining inserted/deleted for every UPDATE on the table. + writer.Append("IF ("); + EmitMssqlUpdateColumnDisjunction(writer, trigger.IdentityProjectionColumns); + writer.AppendLine(")"); + writer.AppendLine("BEGIN"); + + using (writer.Indent()) + { + // Emit an UPDATE statement for each referrer table. + foreach (var referrer in propagation.ReferrerUpdates) { - ColumnKind.Ordinal => _dialectRules.ScalarTypeDefaults.Int32Type, - _ => _dialectRules.ScalarTypeDefaults.Int64Type, - }; + var referrerTable = Quote(referrer.ReferrerTable); + var fkColumn = Quote(referrer.ReferrerFkColumn); + + writer.AppendLine("UPDATE r"); + writer.Append("SET "); + for (int i = 0; i < referrer.ColumnMappings.Count; i++) + { + if (i > 0) + writer.Append(", "); + // TargetColumn = referrer's stored identity column (e.g., School_SchoolId) + // SourceColumn = trigger table's identity column (e.g., SchoolId) + writer.Append("r."); + writer.Append(Quote(referrer.ColumnMappings[i].TargetColumn)); + writer.Append(" = i."); + writer.Append(Quote(referrer.ColumnMappings[i].SourceColumn)); + } + writer.AppendLine(); + + writer.Append("FROM "); + writer.Append(referrerTable); + writer.AppendLine(" r"); + + // Join referrer to deleted via FK column pointing to DocumentId. + writer.Append("INNER JOIN deleted d ON r."); + writer.Append(fkColumn); + writer.Append(" = d."); + writer.AppendLine(documentIdCol); + + // Correlate old/new rows by DocumentId (the universal PK of the trigger's owning table). + writer.Append("INNER JOIN inserted i ON i."); + writer.Append(documentIdCol); + writer.Append(" = d."); + writer.AppendLine(documentIdCol); + + // Only update if identity columns actually changed. + writer.Append("WHERE "); + for (int i = 0; i < referrer.ColumnMappings.Count; i++) + { + if (i > 0) + writer.Append(" OR "); + var col = Quote(referrer.ColumnMappings[i].SourceColumn); + EmitMssqlNullSafeNotEqual(writer, "i", col, "d", col); + } + writer.AppendLine(";"); + writer.AppendLine(); + } } - return ResolveColumnType(scalarType); + writer.AppendLine("END"); + } + + /// + /// Emits a PostgreSQL OLD.col IS DISTINCT FROM NEW.col disjunction for identity + /// projection columns, used as a value-diff guard in trigger bodies. + /// + private void EmitPgsqlValueDiffDisjunction( + SqlWriter writer, + IReadOnlyList identityProjectionColumns + ) + { + for (int i = 0; i < identityProjectionColumns.Count; i++) + { + if (i > 0) + writer.Append(" OR "); + var col = Quote(identityProjectionColumns[i]); + writer.Append("OLD."); + writer.Append(col); + writer.Append(" IS DISTINCT FROM NEW."); + writer.Append(col); + } } /// - /// Resolves the SQL type for a required scalar type. + /// Emits a MSSQL UPDATE(col) disjunction for identity projection columns, used + /// as a performance pre-filter only (not a correctness gate). UPDATE(col) + /// returns true if the column appeared in the SET clause regardless of whether the value + /// actually changed, and returns false for computed alias columns updated via CASCADE. /// - private string ResolveColumnType(RelationalScalarType scalarType) + private void EmitMssqlUpdateColumnDisjunction( + SqlWriter writer, + IReadOnlyList identityProjectionColumns + ) { - return scalarType.Kind switch + for (int i = 0; i < identityProjectionColumns.Count; i++) { - ScalarKind.String => FormatStringType(scalarType), - ScalarKind.Decimal => FormatDecimalType(scalarType), - ScalarKind.Int32 => _dialectRules.ScalarTypeDefaults.Int32Type, - ScalarKind.Int64 => _dialectRules.ScalarTypeDefaults.Int64Type, - ScalarKind.Boolean => _dialectRules.ScalarTypeDefaults.BooleanType, - ScalarKind.Date => _dialectRules.ScalarTypeDefaults.DateType, - ScalarKind.DateTime => _dialectRules.ScalarTypeDefaults.DateTimeType, - ScalarKind.Time => _dialectRules.ScalarTypeDefaults.TimeType, - _ => throw new ArgumentOutOfRangeException( - nameof(scalarType.Kind), - scalarType.Kind, - "Unsupported scalar kind." - ), - }; + if (i > 0) + writer.Append(" OR "); + writer.Append("UPDATE("); + writer.Append(Quote(identityProjectionColumns[i])); + writer.Append(")"); + } } /// - /// Formats a string scalar type including a length specifier when present. + /// Emits a MSSQL table variable @changedDocs populated with the set of + /// DocumentId values whose identity projection columns actually changed + /// (null-safe value diff between inserted and deleted). /// - private string FormatStringType(RelationalScalarType scalarType) + /// + /// A table variable is used instead of a CTE because T-SQL CTEs scope to the single + /// immediately-following DML statement, while triggers need the workset across multiple + /// statements (DELETE + INSERT or MERGE). The table variable persists for the entire + /// BEGIN...END block. This is the authoritative workset for UPDATE triggers and is + /// correct under key unification where UPDATE(aliasColumn) returns false for + /// CASCADE-driven canonical column changes. + /// + private void EmitMssqlValueDiffWorkset( + SqlWriter writer, + IReadOnlyList identityProjectionColumns + ) { - if (scalarType.MaxLength is null) + var documentIdCol = Quote(DocumentIdColumn); + writer.Append("DECLARE @changedDocs TABLE ("); + writer.Append(documentIdCol); + writer.AppendLine(" bigint NOT NULL);"); + writer.Append("INSERT INTO @changedDocs ("); + writer.Append(documentIdCol); + writer.AppendLine(")"); + writer.Append("SELECT i."); + writer.AppendLine(documentIdCol); + writer.Append("FROM inserted i INNER JOIN deleted d ON d."); + writer.Append(documentIdCol); + writer.Append(" = i."); + writer.AppendLine(documentIdCol); + writer.Append("WHERE "); + for (int i = 0; i < identityProjectionColumns.Count; i++) { - return _dialectRules.ScalarTypeDefaults.StringType; + if (i > 0) + writer.Append(" OR "); + var col = Quote(identityProjectionColumns[i]); + EmitMssqlNullSafeNotEqual(writer, "i", col, "d", col); } + writer.AppendLine(";"); + } - return $"{_dialectRules.ScalarTypeDefaults.StringType}({scalarType.MaxLength.Value})"; + /// + /// Emits a NULL-safe inequality comparison for MSSQL, equivalent to PostgreSQL's + /// IS DISTINCT FROM. Emits (left.col <> right.col OR (left.col IS NULL AND right.col IS NOT NULL) OR (left.col IS NOT NULL AND right.col IS NULL)). + /// + /// + /// PostgreSQL's IS DISTINCT FROM is a null-safe inequality operator: + /// NULL IS DISTINCT FROM NULL returns false (nulls are considered equal), + /// and NULL IS DISTINCT FROM value returns true. + /// SQL Server lacks this operator, so we expand to the three-part OR expression. + /// + private static void EmitMssqlNullSafeNotEqual( + SqlWriter writer, + string leftAlias, + string quotedColumn, + string rightAlias, + string rightQuotedColumn + ) + { + writer.Append("("); + writer.Append(leftAlias); + writer.Append("."); + writer.Append(quotedColumn); + writer.Append(" <> "); + writer.Append(rightAlias); + writer.Append("."); + writer.Append(rightQuotedColumn); + writer.Append(" OR ("); + writer.Append(leftAlias); + writer.Append("."); + writer.Append(quotedColumn); + writer.Append(" IS NULL AND "); + writer.Append(rightAlias); + writer.Append("."); + writer.Append(rightQuotedColumn); + writer.Append(" IS NOT NULL) OR ("); + writer.Append(leftAlias); + writer.Append("."); + writer.Append(quotedColumn); + writer.Append(" IS NOT NULL AND "); + writer.Append(rightAlias); + writer.Append("."); + writer.Append(rightQuotedColumn); + writer.Append(" IS NULL))"); } /// - /// Formats a decimal scalar type including precision and scale when present. + /// Resolves the SQL type for a column using explicit scalar type metadata or dialect defaults. + /// For columns with an explicit , delegates to + /// . For implicit key columns (Ordinal, FK, etc.), + /// falls back to dialect-specific integer defaults. /// - private string FormatDecimalType(RelationalScalarType scalarType) + private string ResolveColumnType(DbColumnModel column) { - if (scalarType.Decimal is null) + var scalarType = column.ScalarType; + + if (scalarType is null) { - return _dialectRules.ScalarTypeDefaults.DecimalType; + // ColumnKind.Scalar always has an explicit ScalarType from schema projection. + // The cases below are implicit system columns with no ScalarType. + return column.Kind switch + { + ColumnKind.Ordinal => _dialect.OrdinalColumnType, + ColumnKind.DocumentFk or ColumnKind.DescriptorFk or ColumnKind.ParentKeyPart => + _dialect.DocumentIdColumnType, + _ => throw new InvalidOperationException( + $"Column '{column.ColumnName.Value}' of kind {column.Kind} has no ScalarType." + ), + }; } - var (precision, scale) = scalarType.Decimal.Value; - return $"{_dialectRules.ScalarTypeDefaults.DecimalType}({precision},{scale})"; + return _dialect.RenderColumnType(scalarType); } /// /// Formats a table constraint for inclusion within a CREATE TABLE statement. + /// Returns null for FK constraints which are emitted separately in Phase 4. /// - private string FormatConstraint(TableConstraint constraint) + private string? FormatConstraint(TableConstraint constraint) { return constraint switch { TableConstraint.Unique unique => $"CONSTRAINT {Quote(unique.Name)} UNIQUE ({FormatColumnList(unique.Columns)})", - TableConstraint.ForeignKey foreignKey => - $"CONSTRAINT {Quote(foreignKey.Name)} FOREIGN KEY ({FormatColumnList(foreignKey.Columns)}) " - + $"REFERENCES {Quote(foreignKey.TargetTable)} ({FormatColumnList(foreignKey.TargetColumns)})" - + FormatReferentialActions(foreignKey), + TableConstraint.ForeignKey => null, // Skip FKs, emit in Phase 4 TableConstraint.AllOrNoneNullability allOrNone => $"CONSTRAINT {Quote(allOrNone.Name)} CHECK ({FormatAllOrNoneCheck(allOrNone)})", TableConstraint.NullOrTrue nullOrTrue => @@ -559,15 +1492,30 @@ private string FormatConstraint(TableConstraint constraint) /// /// Formats the expression for an all-or-none nullability check constraint. + /// Enforces bidirectional all-or-none semantics: either all columns (FK + dependents) + /// are NULL, or all columns are NOT NULL. This prevents partial composite FK values. /// private string FormatAllOrNoneCheck(TableConstraint.AllOrNoneNullability constraint) { - var dependencies = string.Join( + var fkCol = Quote(constraint.FkColumn); + + // All columns NULL case + var allNullClause = string.Join( " AND ", - constraint.DependentColumns.Select(column => $"{Quote(column)} IS NOT NULL") + constraint + .DependentColumns.Select(column => $"{Quote(column)} IS NULL") + .Prepend($"{fkCol} IS NULL") ); - return $"({Quote(constraint.FkColumn)} IS NULL) OR ({dependencies})"; + // All columns NOT NULL case + var allNotNullClause = string.Join( + " AND ", + constraint + .DependentColumns.Select(column => $"{Quote(column)} IS NOT NULL") + .Prepend($"{fkCol} IS NOT NULL") + ); + + return $"({allNullClause}) OR ({allNotNullClause})"; } /// @@ -575,136 +1523,263 @@ private string FormatAllOrNoneCheck(TableConstraint.AllOrNoneNullability constra /// private string FormatNullOrTrueCheck(TableConstraint.NullOrTrue constraint) { - var trueLiteral = _dialectRules.Dialect switch - { - SqlDialect.Pgsql => "TRUE", - SqlDialect.Mssql => "1", - _ => throw new ArgumentOutOfRangeException( - nameof(_dialectRules.Dialect), - _dialectRules.Dialect, - "Unsupported SQL dialect." - ), - }; - + var trueLiteral = _dialect.RenderBooleanLiteral(true); return $"{Quote(constraint.Column)} IS NULL OR {Quote(constraint.Column)} = {trueLiteral}"; } /// - /// Formats ON DELETE and ON UPDATE clauses for a foreign key constraint. + /// Formats a comma-separated list of quoted column names. + /// + private string FormatColumnList(IReadOnlyList columns) + { + return string.Join(", ", columns.Select(Quote)); + } + + /// + /// Formats a comma-separated list of quoted key column names. /// - private string FormatReferentialActions(TableConstraint.ForeignKey foreignKey) + private string FormatColumnList(IReadOnlyList columns) { - var deleteAction = FormatReferentialAction("DELETE", foreignKey.OnDelete); - var updateAction = FormatReferentialAction("UPDATE", foreignKey.OnUpdate); + return string.Join(", ", columns.Select(column => Quote(column.ColumnName))); + } - return $"{deleteAction}{updateAction}"; + /// + /// Emits CREATE VIEW statements for abstract union views. + /// + private void EmitAbstractUnionViews(SqlWriter writer, IReadOnlyList views) + { + foreach (var viewInfo in views) + { + EmitCreateView(writer, viewInfo); + } } /// - /// Formats a referential action keyword clause when the action is not the dialect default. + /// Emits a CREATE VIEW statement for a single abstract union view. /// - private static string FormatReferentialAction(string keyword, ReferentialAction action) + private void EmitCreateView(SqlWriter writer, AbstractUnionViewInfo viewInfo) { - return action switch + // CREATE OR ALTER must be the first statement in a T-SQL batch; emit GO separator + // when the dialect uses the CreateOrAlter pattern (e.g., MSSQL). + if (_dialect.ViewCreationPattern == DdlPattern.CreateOrAlter) + { + writer.AppendLine("GO"); + } + + // Determine view creation pattern based on dialect + var createKeyword = _dialect.ViewCreationPattern switch { - ReferentialAction.NoAction => string.Empty, - ReferentialAction.Cascade => $" ON {keyword} CASCADE", + DdlPattern.CreateOrReplace => "CREATE OR REPLACE VIEW", + DdlPattern.CreateOrAlter => "CREATE OR ALTER VIEW", _ => throw new ArgumentOutOfRangeException( - nameof(action), - action, - "Unsupported referential action." + nameof(_dialect.ViewCreationPattern), + _dialect.ViewCreationPattern, + "Unsupported view creation pattern." ), }; + + writer.Append(createKeyword); + writer.Append(" "); + writer.Append(Quote(viewInfo.ViewName)); + writer.AppendLine(" AS"); + + // Emit UNION ALL arms + if (viewInfo.UnionArmsInOrder.Count == 0) + { + throw new InvalidOperationException( + $"Abstract union view '{viewInfo.ViewName.Schema.Value}.{viewInfo.ViewName.Name}' " + + "has no union arms. This indicates a bug in the model derivation phase." + ); + } + + for (int i = 0; i < viewInfo.UnionArmsInOrder.Count; i++) + { + var arm = viewInfo.UnionArmsInOrder[i]; + + if (arm.ProjectionExpressionsInSelectOrder.Count != viewInfo.OutputColumnsInSelectOrder.Count) + throw new InvalidOperationException( + $"Union arm from table '{arm.FromTable.Schema.Value}.{arm.FromTable.Name}' has " + + $"{arm.ProjectionExpressionsInSelectOrder.Count} projection expressions but the view expects " + + $"{viewInfo.OutputColumnsInSelectOrder.Count} output columns." + ); + + if (i > 0) + { + writer.AppendLine("UNION ALL"); + } + + writer.Append("SELECT "); + + // Emit projection expressions + for (int j = 0; j < arm.ProjectionExpressionsInSelectOrder.Count; j++) + { + if (j > 0) + writer.Append(", "); + + var expr = arm.ProjectionExpressionsInSelectOrder[j]; + var outputColumn = viewInfo.OutputColumnsInSelectOrder[j]; + + EmitProjectionExpression(writer, expr, outputColumn.ScalarType); + writer.Append(" AS "); + writer.Append(Quote(outputColumn.ColumnName)); + } + + writer.AppendLine(); + writer.Append("FROM "); + writer.AppendLine(Quote(arm.FromTable)); + } + + writer.AppendLine(";"); + writer.AppendLine(); } /// - /// Formats a comma-separated list of quoted column names. + /// Emits a projection expression for an abstract union view select list. /// - private string FormatColumnList(IReadOnlyList columns) + private void EmitProjectionExpression( + SqlWriter writer, + AbstractUnionViewProjectionExpression expr, + RelationalScalarType targetType + ) { - return string.Join(", ", columns.Select(Quote)); + switch (expr) + { + case AbstractUnionViewProjectionExpression.SourceColumn sourceCol: + if (sourceCol.SourceType is not null && sourceCol.SourceType != targetType) + { + EmitColumnWithCast(writer, sourceCol.ColumnName, targetType); + } + else + { + writer.Append(Quote(sourceCol.ColumnName)); + } + break; + + case AbstractUnionViewProjectionExpression.StringLiteral literal: + EmitStringLiteralWithCast(writer, literal.Value, targetType); + break; + + default: + throw new ArgumentOutOfRangeException( + nameof(expr), + expr, + "Unsupported projection expression" + ); + } } /// - /// Formats a comma-separated list of quoted key column names. + /// Emits a string literal with dialect-specific CAST expression. /// - private string FormatColumnList(IReadOnlyList columns) + private void EmitStringLiteralWithCast(SqlWriter writer, string value, RelationalScalarType targetType) { - return string.Join(", ", columns.Select(column => Quote(column.ColumnName))); + var sqlType = _dialect.RenderColumnType(targetType); + + if (_dialect.Rules.Dialect == SqlDialect.Pgsql) + { + // PostgreSQL: 'literal'::type + writer.Append("'"); + writer.Append(SqlDialectBase.EscapeSingleQuote(value)); + writer.Append("'::"); + writer.Append(sqlType); + } + else + { + // SQL Server: CAST(N'literal' AS type) + writer.Append("CAST(N'"); + writer.Append(SqlDialectBase.EscapeSingleQuote(value)); + writer.Append("' AS "); + writer.Append(sqlType); + writer.Append(")"); + } + } + + /// + /// Emits a column reference with a dialect-specific CAST to the target type. + /// Used when a source column's type differs from the view's canonical output type. + /// + private void EmitColumnWithCast( + SqlWriter writer, + DbColumnName columnName, + RelationalScalarType targetType + ) + { + var sqlType = _dialect.RenderColumnType(targetType); + + if (_dialect.Rules.Dialect == SqlDialect.Pgsql) + { + // PostgreSQL: "ColumnName"::type + writer.Append(Quote(columnName)); + writer.Append("::"); + writer.Append(sqlType); + } + else + { + // SQL Server: CAST([ColumnName] AS type) + writer.Append("CAST("); + writer.Append(Quote(columnName)); + writer.Append(" AS "); + writer.Append(sqlType); + writer.Append(")"); + } } /// /// Resolves the primary key constraint name, falling back to a conventional default when unset. /// - private static string ResolvePrimaryKeyConstraintName(DbTableModel table) + private string ResolvePrimaryKeyConstraintName(DbTableModel table) { return string.IsNullOrWhiteSpace(table.Key.ConstraintName) - ? $"PK_{table.Table.Name}" + ? _dialect.Rules.ShortenIdentifier($"PK_{table.Table.Schema.Value}_{table.Table.Name}") : table.Key.ConstraintName; } /// - /// Quotes a raw identifier using the configured dialect rules. + /// Quotes a raw identifier using the configured dialect. /// - private string Quote(string identifier) - { - return SqlIdentifierQuoter.QuoteIdentifier(_dialectRules.Dialect, identifier); - } + private string Quote(string identifier) => _dialect.QuoteIdentifier(identifier); /// - /// Quotes a schema name using the configured dialect rules. + /// Quotes a schema name using the configured dialect. /// - private string Quote(DbSchemaName schema) - { - return SqlIdentifierQuoter.QuoteIdentifier(_dialectRules.Dialect, schema); - } + private string Quote(DbSchemaName schema) => _dialect.QuoteIdentifier(schema.Value); /// - /// Quotes a fully-qualified table name using the configured dialect rules. + /// Quotes a fully-qualified table name using the configured dialect. /// - private string Quote(DbTableName table) - { - return SqlIdentifierQuoter.QuoteTableName(_dialectRules.Dialect, table); - } + private string Quote(DbTableName table) => _dialect.QualifyTable(table); /// - /// Quotes a column name using the configured dialect rules. + /// Quotes a column name using the configured dialect. /// - private string Quote(DbColumnName column) - { - return SqlIdentifierQuoter.QuoteIdentifier(_dialectRules.Dialect, column); - } + private string Quote(DbColumnName column) => _dialect.QuoteIdentifier(column.Value); /// - /// Quotes an index name using the configured dialect rules. + /// Quotes a trigger name using the configured dialect. /// - private string Quote(DbIndexName index) - { - return SqlIdentifierQuoter.QuoteIdentifier(_dialectRules.Dialect, index); - } + private string Quote(DbTriggerName trigger) => _dialect.QuoteIdentifier(trigger.Value); + + /// + /// The UUIDv5 namespace used for referential identity computation. + /// Must match ReferentialIdCalculator.EdFiUuidv5Namespace in + /// EdFi.DataManagementService.Core. A guard test in the unit test project + /// asserts this value to prevent silent divergence. + /// + internal const string Uuidv5Namespace = "edf1edf1-3df1-3df1-3df1-3df1edf1edf1"; /// - /// Quotes a trigger name using the configured dialect rules. + /// Formats the qualified dms.ChangeVersionSequence name for the current dialect. /// - private string Quote(DbTriggerName trigger) + private string FormatSequenceName() { - return SqlIdentifierQuoter.QuoteIdentifier(_dialectRules.Dialect, trigger); + return $"{Quote(DmsTableNames.Document.Schema)}.{Quote(DmsTableNames.ChangeVersionSequence)}"; } /// - /// Formats a trigger identifier for dialect-specific trigger namespaces. + /// Formats the qualified dms.uuidv5 function name for the current dialect. /// - private string FormatTriggerName(DbTriggerInfo trigger) + private string FormatUuidv5FunctionName() { - return _dialectRules.Dialect switch - { - SqlDialect.Mssql => $"{Quote(trigger.TriggerTable.Schema)}.{Quote(trigger.Name)}", - SqlDialect.Pgsql => Quote(trigger.Name), - _ => throw new ArgumentOutOfRangeException( - nameof(_dialectRules.Dialect), - _dialectRules.Dialect, - "Unsupported SQL dialect." - ), - }; + return $"{Quote(DmsTableNames.Document.Schema)}.{Quote("uuidv5")}"; } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SeedDmlEmitter.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SeedDmlEmitter.cs index 853cc1367..ea4f61d7f 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SeedDmlEmitter.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SeedDmlEmitter.cs @@ -67,7 +67,6 @@ public string Emit(EffectiveSchemaInfo effectiveSchema) /// private void EmitEffectiveSchemaHashPreflight(SqlWriter writer, string effectiveSchemaHash) { - string Q(string id) => _dialect.QuoteIdentifier(id); var table = _dialect.QualifyTable(_effectiveSchemaTable); var hashLiteral = _dialect.RenderStringLiteral(effectiveSchemaHash); @@ -83,8 +82,8 @@ private void EmitEffectiveSchemaHashPreflight(SqlWriter writer, string effective using (writer.Indent()) { writer.AppendLine($"SELECT 1 FROM {table}"); - writer.AppendLine($"WHERE {Q("EffectiveSchemaSingletonId")} = 1"); - writer.AppendLine($"AND {Q("EffectiveSchemaHash")} <> {hashLiteral}"); + writer.AppendLine($"WHERE {Quote("EffectiveSchemaSingletonId")} = 1"); + writer.AppendLine($"AND {Quote("EffectiveSchemaHash")} <> {hashLiteral}"); } writer.AppendLine(") THEN"); using (writer.Indent()) @@ -103,8 +102,8 @@ private void EmitEffectiveSchemaHashPreflight(SqlWriter writer, string effective using (writer.Indent()) { writer.AppendLine($"SELECT 1 FROM {table}"); - writer.AppendLine($"WHERE {Q("EffectiveSchemaSingletonId")} = 1"); - writer.AppendLine($"AND {Q("EffectiveSchemaHash")} <> {hashLiteral}"); + writer.AppendLine($"WHERE {Quote("EffectiveSchemaSingletonId")} = 1"); + writer.AppendLine($"AND {Quote("EffectiveSchemaHash")} <> {hashLiteral}"); } writer.AppendLine(")"); writer.AppendLine("BEGIN"); @@ -130,7 +129,6 @@ private void EmitResourceKeySeeds(SqlWriter writer, IReadOnlyList _dialect.QuoteIdentifier(id); var table = _dialect.QualifyTable(_resourceKeyTable); writer.AppendLine("-- ResourceKey seed inserts (insert-if-missing)"); @@ -145,22 +143,22 @@ private void EmitResourceKeySeeds(SqlWriter writer, IReadOnlyList _dialect.QuoteIdentifier(id); var table = _dialect.QualifyTable(_resourceKeyTable); var expectedCount = _dialect.RenderIntegerLiteral(resourceKeys.Count); @@ -230,12 +227,16 @@ private void EmitResourceKeyValidation(SqlWriter writer, IReadOnlyList 0 THEN"); @@ -288,12 +289,12 @@ private void EmitResourceKeyValidation(SqlWriter writer, IReadOnlyList 0"); @@ -315,11 +316,10 @@ private void EmitResourceKeyValidation(SqlWriter writer, IReadOnlyList private void EmitEffectiveSchemaInsert(SqlWriter writer, EffectiveSchemaInfo effectiveSchema) { - string Q(string id) => _dialect.QuoteIdentifier(id); var table = _dialect.QualifyTable(_effectiveSchemaTable); var columns = - $"{Q("EffectiveSchemaSingletonId")}, {Q("ApiSchemaFormatVersion")}, {Q("EffectiveSchemaHash")}, {Q("ResourceKeyCount")}, {Q("ResourceKeySeedHash")}"; + $"{Quote("EffectiveSchemaSingletonId")}, {Quote("ApiSchemaFormatVersion")}, {Quote("EffectiveSchemaHash")}, {Quote("ResourceKeyCount")}, {Quote("ResourceKeySeedHash")}"; var values = string.Join( ", ", @@ -336,12 +336,12 @@ private void EmitEffectiveSchemaInsert(SqlWriter writer, EffectiveSchemaInfo eff { writer.AppendLine($"INSERT INTO {table} ({columns})"); writer.AppendLine($"VALUES ({values})"); - writer.AppendLine($"ON CONFLICT ({Q("EffectiveSchemaSingletonId")}) DO NOTHING;"); + writer.AppendLine($"ON CONFLICT ({Quote("EffectiveSchemaSingletonId")}) DO NOTHING;"); } else { writer.AppendLine( - $"IF NOT EXISTS (SELECT 1 FROM {table} WHERE {Q("EffectiveSchemaSingletonId")} = 1)" + $"IF NOT EXISTS (SELECT 1 FROM {table} WHERE {Quote("EffectiveSchemaSingletonId")} = 1)" ); using (writer.Indent()) { @@ -366,7 +366,6 @@ IReadOnlyList schemaComponents return; } - string Q(string id) => _dialect.QuoteIdentifier(id); var table = _dialect.QualifyTable(_schemaComponentTable); var hashLiteral = _dialect.RenderStringLiteral(effectiveSchemaHash); @@ -382,24 +381,24 @@ IReadOnlyList schemaComponents if (_dialect.Rules.Dialect == SqlDialect.Pgsql) { writer.AppendLine( - $"INSERT INTO {table} ({Q("EffectiveSchemaHash")}, {Q("ProjectEndpointName")}, {Q("ProjectName")}, {Q("ProjectVersion")}, {Q("IsExtensionProject")})" + $"INSERT INTO {table} ({Quote("EffectiveSchemaHash")}, {Quote("ProjectEndpointName")}, {Quote("ProjectName")}, {Quote("ProjectVersion")}, {Quote("IsExtensionProject")})" ); writer.AppendLine( $"VALUES ({hashLiteral}, {endpointLiteral}, {projectLiteral}, {versionLiteral}, {extensionLiteral})" ); writer.AppendLine( - $"ON CONFLICT ({Q("EffectiveSchemaHash")}, {Q("ProjectEndpointName")}) DO NOTHING;" + $"ON CONFLICT ({Quote("EffectiveSchemaHash")}, {Quote("ProjectEndpointName")}) DO NOTHING;" ); } else { writer.AppendLine( - $"IF NOT EXISTS (SELECT 1 FROM {table} WHERE {Q("EffectiveSchemaHash")} = {hashLiteral} AND {Q("ProjectEndpointName")} = {endpointLiteral})" + $"IF NOT EXISTS (SELECT 1 FROM {table} WHERE {Quote("EffectiveSchemaHash")} = {hashLiteral} AND {Quote("ProjectEndpointName")} = {endpointLiteral})" ); using (writer.Indent()) { writer.AppendLine( - $"INSERT INTO {table} ({Q("EffectiveSchemaHash")}, {Q("ProjectEndpointName")}, {Q("ProjectName")}, {Q("ProjectVersion")}, {Q("IsExtensionProject")})" + $"INSERT INTO {table} ({Quote("EffectiveSchemaHash")}, {Quote("ProjectEndpointName")}, {Quote("ProjectName")}, {Quote("ProjectVersion")}, {Quote("IsExtensionProject")})" ); writer.AppendLine( $"VALUES ({hashLiteral}, {endpointLiteral}, {projectLiteral}, {versionLiteral}, {extensionLiteral});" @@ -424,7 +423,6 @@ IReadOnlyList schemaComponents return; } - string Q(string id) => _dialect.QuoteIdentifier(id); var table = _dialect.QualifyTable(_schemaComponentTable); var hashLiteral = _dialect.RenderStringLiteral(effectiveSchemaHash); var expectedCount = _dialect.RenderIntegerLiteral(schemaComponents.Count); @@ -445,7 +443,7 @@ IReadOnlyList schemaComponents { // Count check writer.AppendLine( - $"SELECT COUNT(*) INTO _actual_count FROM {table} WHERE {Q("EffectiveSchemaHash")} = {hashLiteral};" + $"SELECT COUNT(*) INTO _actual_count FROM {table} WHERE {Quote("EffectiveSchemaHash")} = {hashLiteral};" ); writer.AppendLine($"IF _actual_count <> {expectedCount} THEN"); using (writer.Indent()) @@ -460,7 +458,7 @@ IReadOnlyList schemaComponents // Content check writer.AppendLine("SELECT COUNT(*) INTO _mismatched_count"); writer.AppendLine($"FROM {table} sc"); - writer.AppendLine($"WHERE sc.{Q("EffectiveSchemaHash")} = {hashLiteral}"); + writer.AppendLine($"WHERE sc.{Quote("EffectiveSchemaHash")} = {hashLiteral}"); writer.AppendLine("AND NOT EXISTS ("); using (writer.Indent()) { @@ -477,15 +475,17 @@ IReadOnlyList schemaComponents } } writer.AppendLine( - $") AS expected({Q("ProjectEndpointName")}, {Q("ProjectName")}, {Q("ProjectVersion")}, {Q("IsExtensionProject")})" + $") AS expected({Quote("ProjectEndpointName")}, {Quote("ProjectName")}, {Quote("ProjectVersion")}, {Quote("IsExtensionProject")})" ); writer.AppendLine( - $"WHERE expected.{Q("ProjectEndpointName")} = sc.{Q("ProjectEndpointName")}" + $"WHERE expected.{Quote("ProjectEndpointName")} = sc.{Quote("ProjectEndpointName")}" ); - writer.AppendLine($"AND expected.{Q("ProjectName")} = sc.{Q("ProjectName")}"); - writer.AppendLine($"AND expected.{Q("ProjectVersion")} = sc.{Q("ProjectVersion")}"); + writer.AppendLine($"AND expected.{Quote("ProjectName")} = sc.{Quote("ProjectName")}"); writer.AppendLine( - $"AND expected.{Q("IsExtensionProject")} = sc.{Q("IsExtensionProject")}" + $"AND expected.{Quote("ProjectVersion")} = sc.{Quote("ProjectVersion")}" + ); + writer.AppendLine( + $"AND expected.{Quote("IsExtensionProject")} = sc.{Quote("IsExtensionProject")}" ); } writer.AppendLine(");"); @@ -508,7 +508,7 @@ IReadOnlyList schemaComponents // Count check writer.AppendLine( - $"SELECT @sc_actual_count = COUNT(*) FROM {table} WHERE {Q("EffectiveSchemaHash")} = {hashLiteral};" + $"SELECT @sc_actual_count = COUNT(*) FROM {table} WHERE {Quote("EffectiveSchemaHash")} = {hashLiteral};" ); writer.AppendLine($"IF @sc_actual_count <> {expectedCount}"); writer.AppendLine("BEGIN"); @@ -525,7 +525,7 @@ IReadOnlyList schemaComponents // Content check writer.AppendLine("SELECT @sc_mismatched_count = COUNT(*)"); writer.AppendLine($"FROM {table} sc"); - writer.AppendLine($"WHERE sc.{Q("EffectiveSchemaHash")} = {hashLiteral}"); + writer.AppendLine($"WHERE sc.{Quote("EffectiveSchemaHash")} = {hashLiteral}"); writer.AppendLine("AND NOT EXISTS ("); using (writer.Indent()) { @@ -542,14 +542,16 @@ IReadOnlyList schemaComponents } } writer.AppendLine( - $") AS expected({Q("ProjectEndpointName")}, {Q("ProjectName")}, {Q("ProjectVersion")}, {Q("IsExtensionProject")})" + $") AS expected({Quote("ProjectEndpointName")}, {Quote("ProjectName")}, {Quote("ProjectVersion")}, {Quote("IsExtensionProject")})" + ); + writer.AppendLine( + $"WHERE expected.{Quote("ProjectEndpointName")} = sc.{Quote("ProjectEndpointName")}" ); + writer.AppendLine($"AND expected.{Quote("ProjectName")} = sc.{Quote("ProjectName")}"); + writer.AppendLine($"AND expected.{Quote("ProjectVersion")} = sc.{Quote("ProjectVersion")}"); writer.AppendLine( - $"WHERE expected.{Q("ProjectEndpointName")} = sc.{Q("ProjectEndpointName")}" + $"AND expected.{Quote("IsExtensionProject")} = sc.{Quote("IsExtensionProject")}" ); - writer.AppendLine($"AND expected.{Q("ProjectName")} = sc.{Q("ProjectName")}"); - writer.AppendLine($"AND expected.{Q("ProjectVersion")} = sc.{Q("ProjectVersion")}"); - writer.AppendLine($"AND expected.{Q("IsExtensionProject")} = sc.{Q("IsExtensionProject")}"); } writer.AppendLine(");"); writer.AppendLine("IF @sc_mismatched_count > 0"); @@ -565,4 +567,6 @@ IReadOnlyList schemaComponents } writer.AppendLine(); } + + private string Quote(string identifier) => _dialect.QuoteIdentifier(identifier); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlDialectBase.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlDialectBase.cs index a6bdb50f0..58e12847e 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlDialectBase.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlDialectBase.cs @@ -3,6 +3,7 @@ // The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. // See the LICENSE and NOTICES files in the project root for more information. +using System.Globalization; using EdFi.DataManagementService.Backend.External; namespace EdFi.DataManagementService.Backend.Ddl; @@ -22,12 +23,6 @@ public abstract class SqlDialectBase : ISqlDialect /// public abstract string OrdinalColumnType { get; } - /// - public abstract DdlPattern TriggerCreationPattern { get; } - - /// - public abstract DdlPattern FunctionCreationPattern { get; } - /// public abstract DdlPattern ViewCreationPattern { get; } @@ -224,9 +219,23 @@ public virtual string RenderReferentialAction(ReferentialAction action) /// public abstract string RenderStringLiteral(string value); + /// + /// Escapes single quotes for safe embedding in a SQL string literal. + /// Dialect-independent: both PostgreSQL and SQL Server use doubled single quotes. + /// + public static string EscapeSingleQuote(string value) => value.Replace("'", "''"); + /// - public virtual string RenderSmallintLiteral(short value) => value.ToString(); + public virtual string RenderSmallintLiteral(short value) => value.ToString(CultureInfo.InvariantCulture); /// - public virtual string RenderIntegerLiteral(int value) => value.ToString(); + public virtual string RenderIntegerLiteral(int value) => value.ToString(CultureInfo.InvariantCulture); + + /// + public abstract string RenderComputedColumnDefinition( + DbColumnName columnName, + string sqlType, + DbColumnName canonicalColumn, + DbColumnName? presenceColumn + ); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlWriter.cs b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlWriter.cs index bb99099a8..2cafa3f33 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlWriter.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Ddl/SqlWriter.cs @@ -28,22 +28,23 @@ public sealed class SqlWriter private const int SpacesPerIndent = 4; + /// + /// Gets the SQL dialect used for quoting and table qualification. + /// + public ISqlDialect Dialect { get; } + /// /// Initializes a new instance of the class. /// - /// The SQL dialect to use for quoting and type rendering. + /// The SQL dialect for identifier quoting and table qualification. /// Initial capacity of the internal buffer. public SqlWriter(ISqlDialect dialect, int initialCapacity = 4096) { - Dialect = dialect ?? throw new ArgumentNullException(nameof(dialect)); + ArgumentNullException.ThrowIfNull(dialect); + Dialect = dialect; _builder = new StringBuilder(initialCapacity); } - /// - /// Gets the SQL dialect used for quoting and type rendering. - /// - public ISqlDialect Dialect { get; } - /// /// Creates an indented scope that increments indent on construction and decrements on disposal. /// @@ -54,6 +55,30 @@ public IndentScope Indent() return new IndentScope(this); } + /// + /// Appends a quoted identifier using the dialect's quoting rules. + /// + /// The raw identifier to quote and append. + /// This writer for method chaining. + public SqlWriter AppendQuoted(string identifier) + { + WriteIndentIfNeeded(); + _builder.Append(Dialect.QuoteIdentifier(identifier)); + return this; + } + + /// + /// Appends a fully qualified table name (schema.table) using the dialect's quoting rules. + /// + /// The table name to qualify and append. + /// This writer for method chaining. + public SqlWriter AppendTable(DbTableName table) + { + WriteIndentIfNeeded(); + _builder.Append(Dialect.QualifyTable(table)); + return this; + } + /// /// Appends text without adding a newline. Applies indentation if at line start. /// @@ -100,42 +125,6 @@ public SqlWriter AppendLine() return this; } - /// - /// Appends a quoted identifier using the dialect's quoting rules. - /// - /// The identifier to quote and append. - /// This writer for method chaining. - public SqlWriter AppendQuoted(string identifier) - { - WriteIndentIfNeeded(); - _builder.Append(Dialect.QuoteIdentifier(identifier)); - return this; - } - - /// - /// Appends a qualified table name (schema.table) with quoting. - /// - /// The table name. - /// This writer for method chaining. - public SqlWriter AppendTable(DbTableName table) - { - WriteIndentIfNeeded(); - _builder.Append(Dialect.QualifyTable(table)); - return this; - } - - /// - /// Appends a column type definition. - /// - /// The scalar type metadata. - /// This writer for method chaining. - public SqlWriter AppendColumnType(RelationalScalarType scalarType) - { - WriteIndentIfNeeded(); - _builder.Append(Dialect.RenderColumnType(scalarType)); - return this; - } - /// /// Returns the canonical SQL output with Unix line endings and no trailing whitespace. /// @@ -145,21 +134,6 @@ public override string ToString() return Canonicalize(_builder.ToString()); } - /// - /// Gets the current length of the internal buffer. - /// - public int Length => _builder.Length; - - /// - /// Clears the internal buffer and resets indentation. - /// - public void Clear() - { - _builder.Clear(); - _indentLevel = 0; - _atLineStart = true; - } - /// /// Decrements the indentation level. Called by on disposal. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs b/src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs index b7833a6bf..7dcce0575 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs @@ -154,7 +154,13 @@ public abstract record AbstractUnionViewProjectionExpression /// Projects a source column from the arm's . /// /// The concrete source column. - public sealed record SourceColumn(DbColumnName ColumnName) : AbstractUnionViewProjectionExpression; + /// + /// The source column's scalar type on the concrete member table. When provided and different + /// from the view's canonical output type, the emitter wraps the column in an explicit CAST + /// to ensure cross-member type normalization in the UNION ALL. + /// + public sealed record SourceColumn(DbColumnName ColumnName, RelationalScalarType? SourceType = null) + : AbstractUnionViewProjectionExpression; /// /// Projects a string literal. @@ -212,31 +218,70 @@ DbIndexKind Kind ); /// -/// Classifies the logical intent of a derived trigger. +/// Discriminated union for trigger-kind-specific parameters. Each subtype carries exactly +/// the fields required by its trigger kind, providing compile-time type safety instead of +/// nullable optional parameters. /// -public enum DbTriggerKind +public abstract record TriggerKindParameters { + private TriggerKindParameters() { } + /// - /// Trigger that stamps document representation/identity versions. + /// Parameters for triggers that stamp document representation/identity versions. /// - DocumentStamping, + public sealed record DocumentStamping() : TriggerKindParameters; /// - /// Trigger that maintains referential identity for concrete resources. + /// Parameters for triggers that maintain referential identity for concrete resources. /// - ReferentialIdentityMaintenance, + /// The resource key ID for UUIDv5 computation. + /// The project name for UUIDv5 computation. + /// The resource name for UUIDv5 computation. + /// Identity element mappings for UUIDv5 computation. + /// + /// Superclass alias information for subclass resources. null for non-subclass resources. + /// + public sealed record ReferentialIdentityMaintenance( + short ResourceKeyId, + string ProjectName, + string ResourceName, + IReadOnlyList IdentityElements, + SuperclassAliasInfo? SuperclassAlias = null + ) : TriggerKindParameters; /// - /// Trigger that maintains abstract identity tables from concrete roots. + /// Parameters for triggers that maintain abstract identity tables from concrete roots. /// - AbstractIdentityMaintenance, + /// The abstract identity table being maintained. + /// Column mappings from the source table to the target table. + /// The discriminator value written to the abstract identity table. + public sealed record AbstractIdentityMaintenance( + DbTableName TargetTable, + IReadOnlyList TargetColumnMappings, + string DiscriminatorValue + ) : TriggerKindParameters; /// - /// Trigger-based fallback for identity propagation when cascade paths are constrained. + /// Parameters for trigger-based fallback for identity propagation when cascade paths are constrained. + /// The trigger is placed on the referenced entity and propagates identity updates to all referrers. /// - IdentityPropagationFallback, + /// The list of referrer tables to update when identity changes. + public sealed record IdentityPropagationFallback(IReadOnlyList ReferrerUpdates) + : TriggerKindParameters; } +/// +/// Describes a single referrer table to update during identity propagation fallback. +/// +/// The referrer table containing stored identity columns. +/// The FK column on the referrer pointing to the source DocumentId. +/// Maps source identity columns to referrer stored identity columns. +public sealed record PropagationReferrerTarget( + DbTableName ReferrerTable, + DbColumnName ReferrerFkColumn, + IReadOnlyList ColumnMappings +); + /// /// Represents a physical database trigger name. /// @@ -244,78 +289,60 @@ public enum DbTriggerKind public readonly record struct DbTriggerName(string Value); /// -/// Ordered storage-column mapping used by identity-propagation fallback triggers. +/// Maps a root table column to its identity JSON path for UUIDv5 computation. /// -/// The storage column on the referrer table being updated. -/// The storage column on the referenced table supplying the new value. -public sealed record DbIdentityPropagationColumnPair( - DbColumnName ReferrerStorageColumn, - DbColumnName ReferencedStorageColumn +/// The physical column on the root table. +/// The canonical JSON path label used in the UUIDv5 hash string. +/// The scalar type metadata for type-aware string formatting in hash expressions. +public sealed record IdentityElementMapping( + DbColumnName Column, + string IdentityJsonPath, + RelationalScalarType ScalarType ); /// -/// One fan-out action for an identity-propagation fallback trigger. +/// Superclass alias information for subclass resources that must also maintain referential identity +/// under their superclass resource key. /// -/// The table receiving propagated identity updates. -/// The referrer ..._DocumentId column on . -/// The referenced table document identifier column (typically DocumentId). -/// -/// Ordered pairs mapping each referrer storage identity-part column to its corresponding referenced storage column. -/// -public sealed record DbIdentityPropagationReferrerAction( - DbTableName ReferrerTable, - DbColumnName ReferrerDocumentIdColumn, - DbColumnName ReferencedDocumentIdColumn, - IReadOnlyList IdentityColumnPairs +/// The superclass resource key ID. +/// The superclass project name. +/// The superclass resource name. +/// Identity element mappings for the superclass identity. +public sealed record SuperclassAliasInfo( + short ResourceKeyId, + string ProjectName, + string ResourceName, + IReadOnlyList IdentityElements ); /// -/// Propagation payload for triggers. +/// Maps a source column on the trigger's owning table to a target column on the maintenance table. /// -/// Referrer fan-out actions executed by the trigger. -public sealed record DbIdentityPropagationFallbackInfo( - IReadOnlyList ReferrerActions -); +/// The column on the trigger's owning table. +/// The corresponding column on the target table. +public sealed record TriggerColumnMapping(DbColumnName SourceColumn, DbColumnName TargetColumn); /// /// Derived trigger inventory entry. /// /// The trigger name. -/// The table the trigger is created on and fires on. -/// The trigger intent classification. -/// -/// Key columns used by non-propagation triggers to identify affected DocumentId rows. -/// For , this is empty and -/// carries the trigger-specific payload. -/// +/// The owning table. +/// Key columns used to identify the affected DocumentId. /// -/// Null-safe, value-diff compare columns for non-propagation triggers. These are compared by -/// value (including null transitions) and are not interpreted as UPDATE(column)-style -/// updated-column gates. -/// For triggers on root tables, these are the -/// columns that additionally bump IdentityVersion. For -/// and -/// triggers, these are the columns whose -/// value-diff causes recomputation. Empty for child/extension table stamping triggers and all -/// triggers. -/// -/// -/// The maintenance target table, when applicable. For -/// triggers, this identifies the abstract -/// identity table being maintained. null for other trigger kinds. -/// -/// -/// Typed payload for triggers. null -/// for other trigger kinds. +/// Columns whose change affects the resource identity projection. For +/// triggers on root tables, these are the columns +/// that should additionally bump IdentityVersion. For +/// and +/// triggers, these are the columns that +/// trigger recomputation. Empty for child/extension table stamping triggers. /// +/// The trigger-kind-specific parameters. public sealed record DbTriggerInfo( DbTriggerName Name, - DbTableName TriggerTable, - DbTriggerKind Kind, + DbTableName Table, IReadOnlyList KeyColumns, IReadOnlyList IdentityProjectionColumns, - DbTableName? MaintenanceTargetTable = null, - DbIdentityPropagationFallbackInfo? PropagationFallback = null + TriggerKindParameters Parameters ); /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.External/RelationalModelTypes.cs b/src/dms/backend/EdFi.DataManagementService.Backend.External/RelationalModelTypes.cs index a3f3fe47d..3a2164061 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.External/RelationalModelTypes.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.External/RelationalModelTypes.cs @@ -377,14 +377,13 @@ public sealed record TableKey(string ConstraintName, IReadOnlyList public sealed record DbKeyColumn(DbColumnName ColumnName, ColumnKind Kind); /// -/// A derived table column definition. +/// Discriminated union describing how a derived table column is physically stored. +/// +/// — the column is directly stored and writable. +/// — the column is a generated (persisted computed) alias +/// over a canonical stored column, optionally gated by a presence column. +/// /// -/// The physical column name. -/// The semantic role for the column. -/// The scalar type metadata (when applicable). -/// Whether the column allows NULL. -/// The JSONPath that sources the column value (when applicable). -/// The referenced resource type for FK columns (when applicable). public abstract record ColumnStorage { /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.Postgresql/EdFi.DataManagementService.Backend.Postgresql.csproj b/src/dms/backend/EdFi.DataManagementService.Backend.Postgresql/EdFi.DataManagementService.Backend.Postgresql.csproj index b76014470..15dbf6d01 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.Postgresql/EdFi.DataManagementService.Backend.Postgresql.csproj +++ b/src/dms/backend/EdFi.DataManagementService.Backend.Postgresql/EdFi.DataManagementService.Backend.Postgresql.csproj @@ -1,9 +1,7 @@  - - - net10.0 - enable - enable - - + + net10.0 + enable + enable + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractIdentityTableDerivationTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractIdentityTableDerivationTests.cs index c44f66242..39929c01a 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractIdentityTableDerivationTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractIdentityTableDerivationTests.cs @@ -1189,6 +1189,120 @@ column.SourceJsonPath is null } } +/// +/// Test fixture for subclass members with superclassIdentityJsonPath set but multiple identity paths. +/// +[TestFixture] +public class Given_Abstract_Identity_Table_With_Superclass_Identity_Path_And_Multiple_Member_Identities +{ + private Exception? _exception; + + /// + /// Sets up the test fixture. + /// + [SetUp] + public void Setup() + { + // Build a schema where a concrete member has superclassIdentityJsonPath set (non-null) + // but also has multiple identity paths — violating the single-identity invariant. + var projectSchema = new JsonObject + { + ["projectName"] = "Ed-Fi", + ["projectEndpointName"] = "ed-fi", + ["projectVersion"] = "5.0.0", + ["abstractResources"] = new JsonObject + { + ["EducationOrganization"] = new JsonObject + { + ["resourceName"] = "EducationOrganization", + ["identityJsonPaths"] = new JsonArray { "$.educationOrganizationId" }, + }, + }, + ["resourceSchemas"] = new JsonObject + { + ["schools"] = new JsonObject + { + ["resourceName"] = "School", + ["isDescriptor"] = false, + ["isResourceExtension"] = false, + ["isSubclass"] = true, + ["subclassType"] = "association", + ["superclassProjectName"] = "Ed-Fi", + ["superclassResourceName"] = "EducationOrganization", + // Non-null superclassIdentityJsonPath triggers the guard + ["superclassIdentityJsonPath"] = "$.schoolId", + ["allowIdentityUpdates"] = false, + ["documentPathsMapping"] = new JsonObject + { + ["SchoolId"] = new JsonObject + { + ["isReference"] = false, + ["isDescriptor"] = false, + ["path"] = "$.schoolId", + }, + ["SchoolName"] = new JsonObject + { + ["isReference"] = false, + ["isDescriptor"] = false, + ["path"] = "$.schoolName", + }, + }, + ["arrayUniquenessConstraints"] = new JsonArray(), + ["decimalPropertyValidationInfos"] = new JsonArray(), + // Multiple identity paths with superclassIdentityJsonPath set + ["identityJsonPaths"] = new JsonArray { "$.schoolId", "$.schoolName" }, + ["jsonSchemaForInsert"] = new JsonObject + { + ["type"] = "object", + ["properties"] = new JsonObject + { + ["schoolId"] = new JsonObject { ["type"] = "integer", ["format"] = "int64" }, + ["schoolName"] = new JsonObject { ["type"] = "string", ["maxLength"] = 75 }, + }, + ["required"] = new JsonArray { "schoolId", "schoolName" }, + }, + }, + }, + }; + + var project = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( + projectSchema, + isExtensionProject: false + ); + var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet(new[] { project }); + var builder = new DerivedRelationalModelSetBuilder( + new IRelationalModelSetPass[] + { + new BaseTraversalAndDescriptorBindingPass(), + new AbstractIdentityTableAndUnionViewDerivationPass(), + } + ); + + try + { + builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); + } + catch (Exception exception) + { + _exception = exception; + } + } + + /// + /// It should fail fast when a member with superclassIdentityJsonPath has multiple identity paths. + /// The validation layer rejects this before the derivation pass runs. + /// + [Test] + public void It_should_fail_fast_when_superclass_identity_path_member_has_multiple_identities() + { + _exception.Should().BeOfType(); + _exception! + .Message.Should() + .Contain("superclassIdentityJsonPath but must declare exactly one identityJsonPaths entry"); + _exception.Message.Should().Contain("Ed-Fi:School"); + } +} + /// /// Test type abstract identity table test schema builder. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractUnionViewDerivationTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractUnionViewDerivationTests.cs index e5d2a4da4..4f2f03fa5 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractUnionViewDerivationTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/AbstractUnionViewDerivationTests.cs @@ -476,12 +476,14 @@ string superclassProjectName } /// -/// Test fixture for duplicate concrete member names across projects. +/// Test fixture for same-named concrete members across different projects. +/// Verifies that two projects contributing members with the same ResourceName +/// produce a valid union view with deterministic arm ordering by (ResourceName, ProjectName). /// [TestFixture] -public class Given_Abstract_Identity_Table_With_Duplicate_Member_Resource_Names_Across_Projects +public class Given_Abstract_Identity_Table_With_Same_Member_Resource_Name_Across_Projects { - private Exception? _exception; + private DerivedRelationalModelSet _result = default!; /// /// Sets up the test fixture. @@ -508,25 +510,37 @@ public void Setup() } ); - try - { - builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); - } - catch (Exception exception) - { - _exception = exception; - } + _result = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); } /// - /// It should fail fast when two projects contribute members with the same resource name. + /// It should produce a union view with both members when they share a ResourceName across projects. /// [Test] - public void It_should_fail_fast_on_duplicate_member_resource_names_across_projects() + public void It_should_produce_union_view_with_both_members() { - _exception.Should().BeOfType(); - _exception!.Message.Should().Contain("duplicate member ResourceName"); - _exception.Message.Should().Contain("'School'"); + _result.AbstractUnionViewsInNameOrder.Should().HaveCount(1); + var view = _result.AbstractUnionViewsInNameOrder[0]; + view.UnionArmsInOrder.Should().HaveCount(2); + } + + /// + /// It should order arms deterministically by (ResourceName, ProjectName). + /// + [Test] + public void It_should_order_arms_by_resource_name_then_project_name() + { + var view = _result.AbstractUnionViewsInNameOrder[0]; + // Both arms have ResourceName "School"; Ed-Fi sorts before Sample + var discriminators = view + .UnionArmsInOrder.Select(a => + a.ProjectionExpressionsInSelectOrder.OfType() + .Single() + .Value + ) + .ToArray(); + discriminators[0].Should().Be("Ed-Fi:School"); + discriminators[1].Should().Be("Sample:School"); } /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/CanonicalizeOrderingStepTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/CanonicalizeOrderingStepTests.cs index 75be37e1c..49763801e 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/CanonicalizeOrderingStepTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/CanonicalizeOrderingStepTests.cs @@ -539,15 +539,160 @@ public void It_should_place_canonical_and_presence_columns_before_dependent_alia /// /// It should keep existing grouping stable when dependencies do not require reordering. + /// Per spec: key → unification support → DocumentFk → DescriptorFk → Scalar. /// [Test] public void It_should_keep_existing_grouping_stable_when_dependencies_allow() { _columnIndexByName["DocumentId"].Should().Be(0); + // DescriptorFk (group 3) < Scalar (group 4) _columnIndexByName["GradeLevelDescriptor_DescriptorId"] .Should() .BeLessThan(_columnIndexByName["AcademicYear"]); - _columnIndexByName["LocalSchoolId"].Should().BeLessThan(_columnIndexByName["School_DocumentId"]); + // DocumentFk (group 2) < Scalar (group 4), so School_DocumentId comes before LocalSchoolId + _columnIndexByName["School_DocumentId"].Should().BeLessThan(_columnIndexByName["LocalSchoolId"]); + } +} + +/// +/// Test fixture for reference group columns being ordered adjacent to their DocumentFk. +/// +[TestFixture] +public class Given_Reference_Group_Columns_In_Column_Ordering +{ + private List _orderedColumnNames = default!; + + /// + /// Sets up the test fixture. + /// + [SetUp] + public void Setup() + { + var schema = new DbSchemaName("edfi"); + var tableName = new DbTableName(schema, "ClassPeriod"); + var jsonScope = JsonPathExpressionCompiler.Compile("$"); + var keyColumn = new DbKeyColumn( + RelationalNameConventions.DocumentIdColumnName, + ColumnKind.ParentKeyPart + ); + + var columns = new[] + { + new DbColumnModel( + RelationalNameConventions.DocumentIdColumnName, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + new DbColumnName("School_DocumentId"), + ColumnKind.DocumentFk, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: true, + SourceJsonPath: JsonPathExpressionCompiler.Compile("$.schoolReference"), + TargetResource: new QualifiedResourceName("Ed-Fi", "School") + ), + new DbColumnModel( + new DbColumnName("School_SchoolId"), + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: true, + SourceJsonPath: JsonPathExpressionCompiler.Compile("$.schoolReference.schoolId"), + TargetResource: null + ), + new DbColumnModel( + new DbColumnName("AcademicYear"), + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: true, + SourceJsonPath: JsonPathExpressionCompiler.Compile("$.academicYear"), + TargetResource: null + ), + }; + + var table = new DbTableModel( + tableName, + jsonScope, + new TableKey($"PK_{tableName.Name}", [keyColumn]), + columns, + Array.Empty() + ); + + var documentReferenceBindings = new[] + { + new DocumentReferenceBinding( + IsIdentityComponent: true, + ReferenceObjectPath: JsonPathExpressionCompiler.Compile("$.schoolReference"), + Table: tableName, + FkColumn: new DbColumnName("School_DocumentId"), + TargetResource: new QualifiedResourceName("Ed-Fi", "School"), + IdentityBindings: + [ + new ReferenceIdentityBinding( + JsonPathExpressionCompiler.Compile("$.schoolReference.schoolId"), + new DbColumnName("School_SchoolId") + ), + ] + ), + }; + + var resourceModel = new RelationalResourceModel( + new QualifiedResourceName("Ed-Fi", "ClassPeriod"), + schema, + ResourceStorageKind.RelationalTables, + table, + new[] { table }, + documentReferenceBindings, + Array.Empty() + ); + + var context = new RelationalModelBuilderContext { ResourceModel = resourceModel }; + + var canonicalize = new CanonicalizeOrderingStep(); + canonicalize.Execute(context); + + _orderedColumnNames = context.ResourceModel!.Root.Columns.Select(c => c.ColumnName.Value).ToList(); + } + + /// + /// It should place identity part column immediately after the DocumentFk column. + /// + [Test] + public void It_should_place_identity_part_immediately_after_DocumentFk() + { + var docFkIndex = _orderedColumnNames.IndexOf("School_DocumentId"); + var identityPartIndex = _orderedColumnNames.IndexOf("School_SchoolId"); + + identityPartIndex + .Should() + .Be(docFkIndex + 1, "School_SchoolId should immediately follow School_DocumentId"); + } + + /// + /// It should place standalone scalar after the reference group. + /// + [Test] + public void It_should_place_standalone_scalar_after_reference_group() + { + var identityPartIndex = _orderedColumnNames.IndexOf("School_SchoolId"); + var scalarIndex = _orderedColumnNames.IndexOf("AcademicYear"); + + scalarIndex + .Should() + .BeGreaterThan(identityPartIndex, "AcademicYear should follow the reference group"); + } + + /// + /// It should produce the expected full column order. + /// + [Test] + public void It_should_produce_expected_column_order() + { + _orderedColumnNames + .Should() + .Equal("DocumentId", "School_DocumentId", "School_SchoolId", "AcademicYear"); } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/ConstraintDerivationRelationalModelSetPassTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/ConstraintDerivationRelationalModelSetPassTests.cs index 6a75d645b..b6763a4e1 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/ConstraintDerivationRelationalModelSetPassTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/ConstraintDerivationRelationalModelSetPassTests.cs @@ -2579,7 +2579,12 @@ private static JsonObject BuildReferenceConstraintEnrollmentSchema() ["isSubclass"] = false, ["allowIdentityUpdates"] = false, ["arrayUniquenessConstraints"] = new JsonArray(), - ["identityJsonPaths"] = new JsonArray(), + ["identityJsonPaths"] = new JsonArray + { + "$.schoolReference.schoolId", + "$.schoolReference.educationOrganizationId", + "$.studentReference.studentUniqueId", + }, ["documentPathsMapping"] = new JsonObject { ["School"] = new JsonObject @@ -3209,7 +3214,10 @@ private static JsonObject BuildAbstractReferenceEnrollmentSchema() ["isSubclass"] = false, ["allowIdentityUpdates"] = false, ["arrayUniquenessConstraints"] = new JsonArray(), - ["identityJsonPaths"] = new JsonArray(), + ["identityJsonPaths"] = new JsonArray + { + "$.educationOrganizationReference.educationOrganizationId", + }, ["documentPathsMapping"] = new JsonObject { ["EducationOrganization"] = new JsonObject diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DdlIdentifierQuotingTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DdlIdentifierQuotingTests.cs index 694e777d1..fff967027 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DdlIdentifierQuotingTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DdlIdentifierQuotingTests.cs @@ -25,9 +25,9 @@ public class Given_Pgsql_Ddl_Emission_With_Reserved_Identifiers [SetUp] public void Setup() { - var dialectRules = new PgsqlDialectRules(); - var modelSet = ReservedIdentifierFixture.Build(dialectRules.Dialect); - var emitter = new RelationalModelDdlEmitter(dialectRules); + var dialect = SqlDialectFactory.Create(SqlDialect.Pgsql); + var modelSet = ReservedIdentifierFixture.Build(dialect.Rules.Dialect); + var emitter = new RelationalModelDdlEmitter(dialect); _sql = emitter.Emit(modelSet); } @@ -56,9 +56,9 @@ public class Given_Mssql_Ddl_Emission_With_Reserved_Identifiers [SetUp] public void Setup() { - var dialectRules = new MssqlDialectRules(); - var modelSet = ReservedIdentifierFixture.Build(dialectRules.Dialect); - var emitter = new RelationalModelDdlEmitter(dialectRules); + var dialect = SqlDialectFactory.Create(SqlDialect.Mssql); + var modelSet = ReservedIdentifierFixture.Build(dialect.Rules.Dialect); + var emitter = new RelationalModelDdlEmitter(dialect); _sql = emitter.Emit(modelSet); } @@ -91,7 +91,7 @@ public static void AssertQuotedIdentifiers(string sql, SqlDialect dialect) sql.Should().Contain(quoted); sql.Should().Contain("CREATE TABLE"); Regex.IsMatch(sql, @"CREATE\s+(UNIQUE\s+)?INDEX").Should().BeTrue(); - sql.Should().Contain("CREATE TRIGGER"); + Regex.IsMatch(sql, @"CREATE\s+(OR\s+(REPLACE|ALTER)\s+)?TRIGGER").Should().BeTrue(); sql.Should().Contain($"CONSTRAINT {quoted}"); AssertNoUnquotedIdentifier(sql, dialect); @@ -99,9 +99,15 @@ public static void AssertQuotedIdentifiers(string sql, SqlDialect dialect) /// /// Asserts that the emitted DDL contains no unquoted occurrences of the reserved identifier for the given dialect. + /// String literals (e.g., N'Select' in MSSQL or 'Select' in Pgsql) are excluded from this check because + /// they are values for name-based lookups, not identifiers. /// private static void AssertNoUnquotedIdentifier(string sql, SqlDialect dialect) { + // Strip string literals before checking for unquoted identifiers. + // This removes N'...' and '...' sequences to avoid false positives from idempotency checks. + var sqlWithoutStringLiterals = Regex.Replace(sql, @"N?'(?:[^']|'')*'", ""); + var pattern = dialect switch { SqlDialect.Pgsql => $@"(? throw new ArgumentOutOfRangeException(nameof(dialect), dialect, "Unsupported SQL dialect."), }; - Regex.IsMatch(sql, pattern).Should().BeFalse($"Expected all {Identifier} identifiers to be quoted."); + Regex + .IsMatch(sqlWithoutStringLiterals, pattern) + .Should() + .BeFalse($"Expected all {Identifier} identifiers to be quoted."); } } @@ -188,9 +197,9 @@ [new DbIndexInfo(new DbIndexName(Identifier), table, [column], true, DbIndexKind new DbTriggerInfo( new DbTriggerName(Identifier), table, - DbTriggerKind.DocumentStamping, [column], - [] + [], + new TriggerKindParameters.DocumentStamping() ), ] ); diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveIndexInventoryPassTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveIndexInventoryPassTests.cs index 466e634e3..6b39646eb 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveIndexInventoryPassTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveIndexInventoryPassTests.cs @@ -762,6 +762,161 @@ public void It_should_allow_stored_FK_columns_with_unification_suffix_tokens() } } +/// +/// Test fixture for FK leftmost-prefix suppression when a shorter FK is a prefix of a longer FK. +/// Verifies that only the longer index survives regardless of FK iteration order. +/// +[TestFixture] +public class Given_FK_With_Leftmost_Prefix_Of_Another_FK +{ + private IReadOnlyList _indexes = default!; + + /// + /// Sets up the test fixture. + /// + [SetUp] + public void Setup() + { + var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateHandAuthoredEffectiveSchemaSet(); + var builder = new DerivedRelationalModelSetBuilder([ + new PrefixForeignKeyFixturePass(), + new DeriveIndexInventoryPass(), + ]); + + _indexes = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()).IndexesInCreateOrder; + } + + /// + /// It should suppress the shorter FK index that is a leftmost prefix of the longer FK index. + /// + [Test] + public void It_should_suppress_shorter_FK_index_that_is_prefix_of_longer() + { + var fkIndexes = _indexes + .Where(index => index.Table.Name == "Enrollment" && index.Kind == DbIndexKind.ForeignKeySupport) + .ToArray(); + + fkIndexes.Should().ContainSingle("the shorter [RefA_DocumentId] index is a prefix of the longer one"); + + var surviving = fkIndexes.Single(); + surviving.KeyColumns.Select(c => c.Value).Should().Equal("RefA_DocumentId", "RefA_IdentityPart"); + } + + /// + /// It should still produce PK and UK indexes. + /// + [Test] + public void It_should_still_produce_PK_and_UK_indexes() + { + _indexes + .Where(index => index.Table.Name == "Enrollment" && index.Kind == DbIndexKind.PrimaryKey) + .Should() + .ContainSingle(); + + _indexes + .Where(index => index.Table.Name == "Enrollment" && index.Kind == DbIndexKind.UniqueConstraint) + .Should() + .ContainSingle(); + } +} + +/// +/// Test pass that injects two FKs where one is a strict leftmost prefix of the other. +/// +file sealed class PrefixForeignKeyFixturePass : IRelationalModelSetPass +{ + /// + /// Execute. + /// + public void Execute(RelationalModelSetBuilderContext context) + { + ArgumentNullException.ThrowIfNull(context); + + var resourceKey = context.EffectiveSchemaSet.EffectiveSchema.ResourceKeysInIdOrder[0]; + var schema = new DbSchemaName("edfi"); + var rootTableName = new DbTableName(schema, "Enrollment"); + var targetTable = new DbTableName(schema, "RefTarget"); + + // Two FKs: one single-column [RefA_DocumentId], one composite [RefA_DocumentId, RefA_IdentityPart]. + // The single-column FK is a strict leftmost prefix of the composite FK. + var shortFk = new TableConstraint.ForeignKey( + "FK_Enrollment_RefA_Short", + [new DbColumnName("RefA_DocumentId")], + targetTable, + [RelationalNameConventions.DocumentIdColumnName] + ); + + var longFk = new TableConstraint.ForeignKey( + "FK_Enrollment_RefA_Long", + [new DbColumnName("RefA_DocumentId"), new DbColumnName("RefA_IdentityPart")], + targetTable, + [RelationalNameConventions.DocumentIdColumnName, new DbColumnName("IdentityPart")] + ); + + // Use a unique constraint on a different column so it doesn't suppress either FK index. + var uniqueConstraint = new TableConstraint.Unique( + "UK_Enrollment_UnrelatedKey", + [new DbColumnName("RefA_IdentityPart")] + ); + + // Deliberately order short FK first to verify descending-length sort fixes the issue. + var constraints = new TableConstraint[] { uniqueConstraint, shortFk, longFk }; + + var columns = new[] + { + new DbColumnModel( + RelationalNameConventions.DocumentIdColumnName, + ColumnKind.ParentKeyPart, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: false, + SourceJsonPath: null, + TargetResource: null + ), + new DbColumnModel( + new DbColumnName("RefA_DocumentId"), + ColumnKind.DocumentFk, + new RelationalScalarType(ScalarKind.Int64), + IsNullable: true, + SourceJsonPath: JsonPathExpressionCompiler.Compile("$.refA"), + TargetResource: new QualifiedResourceName("Ed-Fi", "RefTarget") + ), + new DbColumnModel( + new DbColumnName("RefA_IdentityPart"), + ColumnKind.Scalar, + new RelationalScalarType(ScalarKind.Int32), + IsNullable: true, + SourceJsonPath: JsonPathExpressionCompiler.Compile("$.refA.identityPart"), + TargetResource: null + ), + }; + + var rootTable = new DbTableModel( + rootTableName, + JsonPathExpressionCompiler.Compile("$"), + new TableKey( + "PK_Enrollment", + [new DbKeyColumn(RelationalNameConventions.DocumentIdColumnName, ColumnKind.ParentKeyPart)] + ), + columns, + constraints + ); + + var relationalModel = new RelationalResourceModel( + resourceKey.Resource, + schema, + ResourceStorageKind.RelationalTables, + rootTable, + [rootTable], + [], + [] + ); + + context.ConcreteResourcesInNameOrder.Add( + new ConcreteResourceModel(resourceKey, ResourceStorageKind.RelationalTables, relationalModel) + ); + } +} + /// /// Test pass that injects a key-unification-like resource model where two FK endpoints share one storage key set. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveTriggerInventoryPassTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveTriggerInventoryPassTests.cs index 7d8a60ea9..96423bef0 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveTriggerInventoryPassTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveTriggerInventoryPassTests.cs @@ -45,7 +45,7 @@ public void Setup() public void It_should_create_DocumentStamping_trigger_for_root_table() { var schoolStamp = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "School" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "School" && t.Parameters is TriggerKindParameters.DocumentStamping ); schoolStamp.Should().NotBeNull(); @@ -60,7 +60,7 @@ public void It_should_create_DocumentStamping_trigger_for_root_table() public void It_should_include_identity_projection_columns_on_root_table_stamping_trigger() { var schoolStamp = _triggers.Single(t => - t.TriggerTable.Name == "School" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "School" && t.Parameters is TriggerKindParameters.DocumentStamping ); schoolStamp.IdentityProjectionColumns.Should().NotBeEmpty(); @@ -77,7 +77,7 @@ public void It_should_include_identity_projection_columns_on_root_table_stamping public void It_should_create_DocumentStamping_trigger_for_child_table() { var childStamp = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "SchoolAddress" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddress" && t.Parameters is TriggerKindParameters.DocumentStamping ); childStamp.Should().NotBeNull(); @@ -91,7 +91,7 @@ public void It_should_create_DocumentStamping_trigger_for_child_table() public void It_should_use_root_document_ID_as_KeyColumns_on_child_table_stamping_trigger() { var childStamp = _triggers.Single(t => - t.TriggerTable.Name == "SchoolAddress" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddress" && t.Parameters is TriggerKindParameters.DocumentStamping ); childStamp.KeyColumns.Should().ContainSingle(); @@ -105,7 +105,7 @@ public void It_should_use_root_document_ID_as_KeyColumns_on_child_table_stamping public void It_should_have_empty_identity_projection_columns_on_child_table_stamping_trigger() { var childStamp = _triggers.Single(t => - t.TriggerTable.Name == "SchoolAddress" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddress" && t.Parameters is TriggerKindParameters.DocumentStamping ); childStamp.IdentityProjectionColumns.Should().BeEmpty(); @@ -118,13 +118,17 @@ public void It_should_have_empty_identity_projection_columns_on_child_table_stam public void It_should_create_ReferentialIdentityMaintenance_trigger_on_root_table() { var refIdentity = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "School" && t.Kind == DbTriggerKind.ReferentialIdentityMaintenance + t.Table.Name == "School" && t.Parameters is TriggerKindParameters.ReferentialIdentityMaintenance ); refIdentity.Should().NotBeNull(); refIdentity!.Name.Value.Should().Be("TR_School_ReferentialIdentity"); refIdentity.KeyColumns.Select(c => c.Value).Should().Equal("DocumentId"); refIdentity.IdentityProjectionColumns.Should().NotBeEmpty(); + var refIdParams = refIdentity.Parameters as TriggerKindParameters.ReferentialIdentityMaintenance; + refIdParams.Should().NotBeNull(); + refIdParams!.IdentityElements.Should().NotBeEmpty(); + refIdParams.IdentityElements.Select(e => e.Column.Value).Should().Contain("EducationOrganizationId"); } /// @@ -134,14 +138,22 @@ public void It_should_create_ReferentialIdentityMaintenance_trigger_on_root_tabl public void It_should_create_AbstractIdentityMaintenance_trigger_for_subclass_resource() { var abstractMaintenance = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "School" && t.Kind == DbTriggerKind.AbstractIdentityMaintenance + t.Table.Name == "School" && t.Parameters is TriggerKindParameters.AbstractIdentityMaintenance ); abstractMaintenance.Should().NotBeNull(); abstractMaintenance!.Name.Value.Should().Be("TR_School_AbstractIdentity"); abstractMaintenance.KeyColumns.Select(c => c.Value).Should().Equal("DocumentId"); - abstractMaintenance.MaintenanceTargetTable.Should().NotBeNull(); - abstractMaintenance.MaintenanceTargetTable!.Value.Name.Should().Be("EducationOrganizationIdentity"); + var abstractParams = + abstractMaintenance.Parameters as TriggerKindParameters.AbstractIdentityMaintenance; + abstractParams.Should().NotBeNull(); + abstractParams!.TargetTable.Name.Should().Be("EducationOrganizationIdentity"); + abstractParams.TargetColumnMappings.Should().NotBeEmpty(); + abstractParams + .TargetColumnMappings.Select(m => m.TargetColumn.Value) + .Should() + .Contain("EducationOrganizationId"); + abstractParams.DiscriminatorValue.Should().Be("Ed-Fi:School"); } } @@ -188,7 +200,7 @@ public void Setup() public void It_should_create_DocumentStamping_trigger_on_extension_table() { var extensionStamp = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "ContactExtension" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "ContactExtension" && t.Parameters is TriggerKindParameters.DocumentStamping ); extensionStamp.Should().NotBeNull(); @@ -201,7 +213,7 @@ public void It_should_create_DocumentStamping_trigger_on_extension_table() public void It_should_use_DocumentId_as_KeyColumns_on_extension_table_stamping_trigger() { var extensionStamp = _triggers.Single(t => - t.TriggerTable.Name == "ContactExtension" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "ContactExtension" && t.Parameters is TriggerKindParameters.DocumentStamping ); extensionStamp.KeyColumns.Should().ContainSingle(); @@ -282,132 +294,11 @@ public void Setup() [Test] public void It_should_not_emit_any_IdentityPropagationFallback_triggers_on_Pgsql() { - var fallbackTriggers = _triggers.Where(t => t.Kind == DbTriggerKind.IdentityPropagationFallback); - - fallbackTriggers.Should().BeEmpty(); - } -} - -/// -/// Test fixture for root trigger identity projections when identity includes reference components. -/// -[TestFixture] -public class Given_Root_Trigger_Identity_Projection_With_Identity_Component_References -{ - private IReadOnlyList _triggers = default!; - - /// - /// Sets up the test fixture. - /// - [SetUp] - public void Setup() - { - var coreProjectSchema = ConstraintDerivationTestSchemaBuilder.BuildReferenceIdentityProjectSchema(); - var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( - coreProjectSchema, - isExtensionProject: false - ); - var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); - var builder = new DerivedRelationalModelSetBuilder( - TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivation() - ); - - var result = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); - _triggers = result.TriggersInCreateOrder; - } - - /// - /// It should include identity-component reference part columns on root stamping trigger. - /// - [Test] - public void It_should_include_identity_component_reference_part_columns_on_root_stamping_trigger() - { - var enrollmentStamp = _triggers.Single(t => - t.TriggerTable.Name == "Enrollment" && t.Kind == DbTriggerKind.DocumentStamping - ); - - enrollmentStamp - .IdentityProjectionColumns.Select(c => c.Value) - .Should() - .Equal("School_SchoolId", "School_EducationOrganizationId", "Student_StudentUniqueId"); - } - - /// - /// It should include identity-component reference part columns on root referential trigger. - /// - [Test] - public void It_should_include_identity_component_reference_part_columns_on_root_referential_trigger() - { - var referentialIdentity = _triggers.Single(t => - t.TriggerTable.Name == "Enrollment" && t.Kind == DbTriggerKind.ReferentialIdentityMaintenance + var fallbackTriggers = _triggers.Where(t => + t.Parameters is TriggerKindParameters.IdentityPropagationFallback ); - referentialIdentity - .IdentityProjectionColumns.Select(c => c.Value) - .Should() - .Equal("School_SchoolId", "School_EducationOrganizationId", "Student_StudentUniqueId"); - } -} - -/// -/// Test fixture for root identity projections with interleaved identity JSON paths. -/// -[TestFixture] -public class Given_Root_Trigger_Identity_Projection_With_Interleaved_Identity_Paths -{ - private IReadOnlyList _triggers = default!; - - /// - /// Sets up the test fixture. - /// - [SetUp] - public void Setup() - { - var coreProjectSchema = - TriggerInventoryTestSchemaBuilder.BuildReferenceIdentityProjectSchemaWithInterleavedIdentityPaths(); - var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( - coreProjectSchema, - isExtensionProject: false - ); - var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); - var builder = new DerivedRelationalModelSetBuilder( - TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivation() - ); - - var result = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); - _triggers = result.TriggersInCreateOrder; - } - - /// - /// It should order root stamping identity projection columns by identityJsonPaths. - /// - [Test] - public void It_should_order_root_stamping_identity_projection_columns_by_identity_json_paths() - { - var enrollmentStamp = _triggers.Single(t => - t.TriggerTable.Name == "Enrollment" && t.Kind == DbTriggerKind.DocumentStamping - ); - - enrollmentStamp - .IdentityProjectionColumns.Select(c => c.Value) - .Should() - .Equal("School_SchoolId", "Student_StudentUniqueId", "School_EducationOrganizationId"); - } - - /// - /// It should order root referential identity projection columns by identityJsonPaths. - /// - [Test] - public void It_should_order_root_referential_identity_projection_columns_by_identity_json_paths() - { - var referentialIdentity = _triggers.Single(t => - t.TriggerTable.Name == "Enrollment" && t.Kind == DbTriggerKind.ReferentialIdentityMaintenance - ); - - referentialIdentity - .IdentityProjectionColumns.Select(c => c.Value) - .Should() - .Equal("School_SchoolId", "Student_StudentUniqueId", "School_EducationOrganizationId"); + fallbackTriggers.Should().BeEmpty(); } } @@ -441,18 +332,18 @@ public void Setup() } /// - /// It should emit propagation trigger for allowIdentityUpdates target. + /// It should emit propagation trigger on referenced resource. /// [Test] - public void It_should_emit_propagation_trigger_for_allowIdentityUpdates_target() + public void It_should_emit_propagation_trigger_on_referenced_resource() { var schoolPropagation = _triggers.SingleOrDefault(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_School_PropagateIdentity" ); schoolPropagation.Should().NotBeNull(); - schoolPropagation!.TriggerTable.Name.Should().Be("School"); + schoolPropagation!.Table.Name.Should().Be("School"); } /// @@ -462,7 +353,7 @@ public void It_should_emit_propagation_trigger_for_allowIdentityUpdates_target() public void It_should_not_emit_propagation_trigger_for_non_updatable_target() { var studentPropagation = _triggers.SingleOrDefault(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_Student_PropagateIdentity" ); @@ -470,124 +361,62 @@ public void It_should_not_emit_propagation_trigger_for_non_updatable_target() } /// - /// It should carry referrer action payload with FK document-id column. + /// It should use DocumentId as key column on referenced table. /// [Test] - public void It_should_carry_referrer_action_payload_with_FK_document_id_column() + public void It_should_use_DocumentId_as_key_column() { var schoolPropagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_School_PropagateIdentity" ); - schoolPropagation.KeyColumns.Should().BeEmpty(); - schoolPropagation.IdentityProjectionColumns.Should().BeEmpty(); - schoolPropagation.PropagationFallback.Should().NotBeNull(); - - var action = schoolPropagation.PropagationFallback!.ReferrerActions.Should().ContainSingle().Which; - action.ReferrerTable.Name.Should().Be("Enrollment"); - action.ReferrerDocumentIdColumn.Value.Should().Be("School_DocumentId"); - action.ReferencedDocumentIdColumn.Value.Should().Be("DocumentId"); + schoolPropagation.KeyColumns.Should().ContainSingle(); + schoolPropagation.KeyColumns[0].Value.Should().Be("DocumentId"); } /// - /// It should include ordered storage column pairs in propagation payload. + /// It should include identity projection columns from referenced table. /// [Test] - public void It_should_include_ordered_storage_column_pairs_in_propagation_payload() + public void It_should_include_identity_projection_columns() { var schoolPropagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_School_PropagateIdentity" ); - var identityColumnPairs = schoolPropagation - .PropagationFallback!.ReferrerActions.Single() - .IdentityColumnPairs; - - identityColumnPairs - .Select(pair => (pair.ReferrerStorageColumn.Value, pair.ReferencedStorageColumn.Value)) + schoolPropagation + .IdentityProjectionColumns.Select(c => c.Value) .Should() - .ContainInOrder( - ("School_SchoolId", "SchoolId"), - ("School_EducationOrganizationId", "EducationOrganizationId") - ); + .Contain("EducationOrganizationId") + .And.Contain("SchoolId"); } /// - /// It should not use maintenance target for propagation fallback. + /// It should include referrer updates for Enrollment. /// [Test] - public void It_should_not_set_maintenance_target_for_propagation_fallback() + public void It_should_include_referrer_updates() { var schoolPropagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_School_PropagateIdentity" ); - schoolPropagation.MaintenanceTargetTable.Should().BeNull(); - } -} - -/// -/// Test fixture for IdentityPropagationFallback fan-out on MSSQL with mixed root and child referrers. -/// -[TestFixture] -public class Given_IdentityPropagationFallback_On_Mssql_With_Non_Root_Referrers -{ - private IReadOnlyList _triggers = default!; + var propagationParams = + schoolPropagation.Parameters as TriggerKindParameters.IdentityPropagationFallback; + propagationParams.Should().NotBeNull(); + propagationParams!.ReferrerUpdates.Should().ContainSingle(); - /// - /// Sets up the test fixture. - /// - [SetUp] - public void Setup() - { - var coreProjectSchema = - ConstraintDerivationTestSchemaBuilder.BuildReferenceConstraintProjectSchemaWithChildReference(); - var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( - coreProjectSchema, - isExtensionProject: false - ); - var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); - var builder = new DerivedRelationalModelSetBuilder( - TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivation() - ); - - var result = builder.Build(schemaSet, SqlDialect.Mssql, new MssqlDialectRules()); - _triggers = result.TriggersInCreateOrder; - } - - /// - /// It should include child-table referrer actions in the referenced-table fan-out payload. - /// - [Test] - public void It_should_include_child_referrer_action_in_referenced_table_fan_out_payload() - { - var schoolPropagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback - && t.Name.Value == "TR_School_PropagateIdentity" - ); - - schoolPropagation.TriggerTable.Name.Should().Be("School"); - schoolPropagation.PropagationFallback.Should().NotBeNull(); - schoolPropagation.PropagationFallback!.ReferrerActions.Should().HaveCount(2); - - var childAction = schoolPropagation.PropagationFallback.ReferrerActions.Single(action => - action.ReferrerTable.Name == "BusRouteAddress" - ); - - childAction.ReferrerDocumentIdColumn.Value.Should().Be("School_DocumentId"); - childAction.ReferencedDocumentIdColumn.Value.Should().Be("DocumentId"); - childAction - .IdentityColumnPairs.Select(pair => - (pair.ReferrerStorageColumn.Value, pair.ReferencedStorageColumn.Value) - ) + var referrerUpdate = propagationParams.ReferrerUpdates[0]; + referrerUpdate.ReferrerTable.Name.Should().Be("Enrollment"); + referrerUpdate.ReferrerFkColumn.Value.Should().Be("School_DocumentId"); + referrerUpdate + .ColumnMappings.Select(m => m.TargetColumn.Value) .Should() - .ContainInOrder( - ("School_SchoolId", "SchoolId"), - ("School_EducationOrganizationId", "EducationOrganizationId") - ); + .Contain("School_EducationOrganizationId") + .And.Contain("School_SchoolId"); } } @@ -621,248 +450,53 @@ public void Setup() } /// - /// It should emit propagation trigger for abstract target. + /// It should emit propagation trigger on abstract identity table. /// [Test] - public void It_should_emit_propagation_trigger_for_abstract_target() + public void It_should_emit_propagation_trigger_on_abstract_identity_table() { var propagation = _triggers.SingleOrDefault(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_EducationOrganizationIdentity_PropagateIdentity" ); propagation.Should().NotBeNull(); - propagation!.TriggerTable.Name.Should().Be("EducationOrganizationIdentity"); + propagation!.Table.Name.Should().Be("EducationOrganizationIdentity"); } /// - /// It should include abstract target identity storage column in propagation payload. + /// It should include referrer updates for Enrollment. /// [Test] - public void It_should_include_abstract_target_identity_storage_column_in_propagation_payload() + public void It_should_include_referrer_updates_for_enrollment() { var propagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_EducationOrganizationIdentity_PropagateIdentity" ); - var action = propagation.PropagationFallback!.ReferrerActions.Should().ContainSingle().Which; - action.ReferencedDocumentIdColumn.Value.Should().Be("DocumentId"); - action - .IdentityColumnPairs.Select(pair => - (pair.ReferrerStorageColumn.Value, pair.ReferencedStorageColumn.Value) - ) - .Should() - .ContainSingle() - .Which.Should() - .Be(("EducationOrganization_EducationOrganizationId", "EducationOrganizationId")); + var propagationParams = propagation.Parameters as TriggerKindParameters.IdentityPropagationFallback; + propagationParams.Should().NotBeNull(); + propagationParams!.ReferrerUpdates.Should().ContainSingle(); + + var referrerUpdate = propagationParams.ReferrerUpdates[0]; + referrerUpdate.ReferrerTable.Name.Should().Be("Enrollment"); + referrerUpdate.ReferrerFkColumn.Value.Should().Be("EducationOrganization_DocumentId"); } /// - /// It should use abstract reference FK as the referrer document-id column. + /// It should use DocumentId as key column for abstract identity table. /// [Test] - public void It_should_use_abstract_reference_FK_as_the_referrer_document_ID_column() + public void It_should_use_DocumentId_as_key_column_for_abstract_identity_table() { var propagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback + t.Parameters is TriggerKindParameters.IdentityPropagationFallback && t.Name.Value == "TR_EducationOrganizationIdentity_PropagateIdentity" ); - propagation.KeyColumns.Should().BeEmpty(); - propagation.IdentityProjectionColumns.Should().BeEmpty(); - propagation.MaintenanceTargetTable.Should().BeNull(); - propagation - .PropagationFallback!.ReferrerActions.Single() - .ReferrerDocumentIdColumn.Value.Should() - .Be("EducationOrganization_DocumentId"); - } -} - -/// -/// Test fixture for IdentityPropagationFallback payload mapping with key unification on MSSQL. -/// -[TestFixture] -public class Given_IdentityPropagationFallback_On_Mssql_With_Key_Unification -{ - private IReadOnlyList _triggers = default!; - private DbTableModel _enrollmentTable = default!; - private DbTableModel _schoolTable = default!; - - /// - /// Sets up the test fixture. - /// - [SetUp] - public void Setup() - { - var coreProjectSchema = - ConstraintDerivationTestSchemaBuilder.BuildReferenceConstraintProjectSchemaWithIdentityUnification(); - var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( - coreProjectSchema, - isExtensionProject: false - ); - var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); - var builder = new DerivedRelationalModelSetBuilder( - TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivationWithKeyUnification() - ); - - var result = builder.Build(schemaSet, SqlDialect.Mssql, new MssqlDialectRules()); - _triggers = result.TriggersInCreateOrder; - _enrollmentTable = result - .ConcreteResourcesInNameOrder.Single(model => - model.ResourceKey.Resource.ResourceName == "Enrollment" - ) - .RelationalModel.Root; - _schoolTable = result - .ConcreteResourcesInNameOrder.Single(model => model.ResourceKey.Resource.ResourceName == "School") - .RelationalModel.Root; - } - - /// - /// It should collapse unified identity bindings to a single canonical storage pair. - /// - [Test] - public void It_should_collapse_unified_identity_bindings_to_a_single_canonical_storage_pair() - { - var schoolPropagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback - && t.Name.Value == "TR_School_PropagateIdentity" - ); - var action = schoolPropagation.PropagationFallback!.ReferrerActions.Should().ContainSingle().Which; - - var localCanonicalColumn = ResolveCanonicalColumn(_enrollmentTable, "School_EducationOrganizationId"); - ResolveCanonicalColumn(_enrollmentTable, "School_SchoolId").Should().Be(localCanonicalColumn); - - var targetCanonicalColumn = ResolveCanonicalColumn(_schoolTable, "EducationOrganizationId"); - ResolveCanonicalColumn(_schoolTable, "SchoolId").Should().Be(targetCanonicalColumn); - - action - .IdentityColumnPairs.Select(pair => - (pair.ReferrerStorageColumn.Value, pair.ReferencedStorageColumn.Value) - ) - .Should() - .ContainSingle() - .Which.Should() - .Be((localCanonicalColumn.Value, targetCanonicalColumn.Value)); - } - - /// - /// It should emit only stored columns in propagation identity pairs. - /// - [Test] - public void It_should_emit_only_stored_columns_in_propagation_identity_pairs() - { - var schoolPropagation = _triggers.Single(t => - t.Kind == DbTriggerKind.IdentityPropagationFallback - && t.Name.Value == "TR_School_PropagateIdentity" - ); - var action = schoolPropagation.PropagationFallback!.ReferrerActions.Should().ContainSingle().Which; - - foreach (var pair in action.IdentityColumnPairs) - { - _enrollmentTable - .Columns.Single(column => column.ColumnName.Equals(pair.ReferrerStorageColumn)) - .Storage.Should() - .BeOfType(); - _schoolTable - .Columns.Single(column => column.ColumnName.Equals(pair.ReferencedStorageColumn)) - .Storage.Should() - .BeOfType(); - } - } - - /// - /// Resolves canonical storage column for a unified alias. - /// - private static DbColumnName ResolveCanonicalColumn(DbTableModel table, string aliasColumnName) - { - var alias = table.Columns.Single(column => column.ColumnName.Value == aliasColumnName); - return alias.Storage.Should().BeOfType().Subject.CanonicalColumn; - } -} - -/// -/// Test fixture for propagation fallback mapping/binding mismatch handling. -/// -[TestFixture] -public class Given_IdentityPropagationFallback_With_Unmapped_Reference_Mapping -{ - private Action _build = default!; - - /// - /// Sets up the test fixture. - /// - [SetUp] - public void Setup() - { - var coreProjectSchema = ConstraintDerivationTestSchemaBuilder.BuildReferenceConstraintProjectSchema(); - var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( - coreProjectSchema, - isExtensionProject: false - ); - var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); - var builder = new DerivedRelationalModelSetBuilder( - TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivationWithUnmappedReferenceMapping() - ); - - _build = () => builder.Build(schemaSet, SqlDialect.Mssql, new MssqlDialectRules()); - } - - /// - /// It should fail fast when a mapping path has no derived reference binding. - /// - [Test] - public void It_should_fail_fast_when_reference_mapping_path_has_no_derived_binding() - { - var exception = _build.Should().Throw().Which; - - exception.Message.Should().Contain("Reference mapping 'UnmappedReferenceMapping'"); - exception.Message.Should().Contain("resource '"); - exception.Message.Should().Contain("Enrollment"); - exception.Message.Should().Contain("reference object path '$.unmappedReference'"); - } -} - -/// -/// Test fixture for presence-gate validation in trigger derivation without index derivation. -/// -[TestFixture] -public class Given_Trigger_Derivation_With_Invalid_Presence_Gate_Without_Index_Derivation -{ - private Action _build = default!; - - /// - /// Sets up the test fixture. - /// - [SetUp] - public void Setup() - { - var coreProjectSchema = - ConstraintDerivationTestSchemaBuilder.BuildReferenceConstraintProjectSchemaWithIdentityUnification(); - var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( - coreProjectSchema, - isExtensionProject: false - ); - var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); - var builder = new DerivedRelationalModelSetBuilder( - TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivationWithKeyUnificationAndInvalidPresenceGateWithoutIndexDerivation() - ); - - _build = () => builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); - } - - /// - /// It should fail fast on an invalid unified-alias presence gate without relying on index derivation. - /// - [Test] - public void It_should_fail_fast_on_invalid_presence_gate_without_index_derivation() - { - var exception = _build.Should().Throw().Which; - - exception.Message.Should().Contain("Unified alias column"); - exception.Message.Should().Contain("table"); - exception.Message.Should().Contain("MissingPresenceGate"); - exception.Message.Should().Contain("presence-gate column"); + propagation.KeyColumns.Should().ContainSingle(); + propagation.KeyColumns[0].Value.Should().Be("DocumentId"); } } @@ -901,7 +535,7 @@ public void Setup() public void It_should_create_DocumentStamping_trigger_for_grandchild_table() { var grandchildStamp = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "SchoolAddressPeriod" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddressPeriod" && t.Parameters is TriggerKindParameters.DocumentStamping ); grandchildStamp.Should().NotBeNull(); @@ -915,7 +549,7 @@ public void It_should_create_DocumentStamping_trigger_for_grandchild_table() public void It_should_use_root_document_ID_as_KeyColumns_on_grandchild_table() { var grandchildStamp = _triggers.Single(t => - t.TriggerTable.Name == "SchoolAddressPeriod" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddressPeriod" && t.Parameters is TriggerKindParameters.DocumentStamping ); grandchildStamp.KeyColumns.Should().ContainSingle(); @@ -929,7 +563,7 @@ public void It_should_use_root_document_ID_as_KeyColumns_on_grandchild_table() public void It_should_have_empty_identity_projection_columns_on_grandchild_table() { var grandchildStamp = _triggers.Single(t => - t.TriggerTable.Name == "SchoolAddressPeriod" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddressPeriod" && t.Parameters is TriggerKindParameters.DocumentStamping ); grandchildStamp.IdentityProjectionColumns.Should().BeEmpty(); @@ -941,7 +575,7 @@ public void It_should_have_empty_identity_projection_columns_on_grandchild_table [Test] public void It_should_create_DocumentStamping_triggers_for_all_three_levels() { - var stampTriggers = _triggers.Where(t => t.Kind == DbTriggerKind.DocumentStamping); + var stampTriggers = _triggers.Where(t => t.Parameters is TriggerKindParameters.DocumentStamping); stampTriggers.Should().HaveCount(3); } @@ -953,10 +587,10 @@ public void It_should_create_DocumentStamping_triggers_for_all_three_levels() public void It_should_use_same_root_document_ID_column_across_all_child_levels() { var childStamp = _triggers.Single(t => - t.TriggerTable.Name == "SchoolAddress" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddress" && t.Parameters is TriggerKindParameters.DocumentStamping ); var grandchildStamp = _triggers.Single(t => - t.TriggerTable.Name == "SchoolAddressPeriod" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "SchoolAddressPeriod" && t.Parameters is TriggerKindParameters.DocumentStamping ); childStamp.KeyColumns[0].Value.Should().Be("School_DocumentId"); @@ -999,10 +633,10 @@ public void Setup() public void It_should_create_DocumentStamping_trigger_for_each_sibling_collection() { var addressStamp = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "StudentAddress" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "StudentAddress" && t.Parameters is TriggerKindParameters.DocumentStamping ); var telephoneStamp = _triggers.SingleOrDefault(t => - t.TriggerTable.Name == "StudentTelephone" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "StudentTelephone" && t.Parameters is TriggerKindParameters.DocumentStamping ); addressStamp.Should().NotBeNull(); @@ -1016,10 +650,10 @@ public void It_should_create_DocumentStamping_trigger_for_each_sibling_collectio public void It_should_produce_distinct_trigger_names_for_sibling_tables() { var addressStamp = _triggers.Single(t => - t.TriggerTable.Name == "StudentAddress" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "StudentAddress" && t.Parameters is TriggerKindParameters.DocumentStamping ); var telephoneStamp = _triggers.Single(t => - t.TriggerTable.Name == "StudentTelephone" && t.Kind == DbTriggerKind.DocumentStamping + t.Table.Name == "StudentTelephone" && t.Parameters is TriggerKindParameters.DocumentStamping ); addressStamp.Name.Value.Should().Be("TR_StudentAddress_Stamp"); @@ -1032,7 +666,7 @@ public void It_should_produce_distinct_trigger_names_for_sibling_tables() [Test] public void It_should_create_three_DocumentStamping_triggers_total() { - var stampTriggers = _triggers.Where(t => t.Kind == DbTriggerKind.DocumentStamping); + var stampTriggers = _triggers.Where(t => t.Parameters is TriggerKindParameters.DocumentStamping); stampTriggers.Should().HaveCount(3); } @@ -1079,15 +713,117 @@ private static IReadOnlyList BuildTriggers() [Test] public void It_should_produce_identical_trigger_sequence_on_repeated_builds() { - var firstSequence = _triggersFirst.Select(t => (t.TriggerTable.Name, t.Name.Value, t.Kind)).ToList(); + static string KindLabel(TriggerKindParameters p) => + p switch + { + TriggerKindParameters.DocumentStamping => "DocumentStamping", + TriggerKindParameters.ReferentialIdentityMaintenance => "ReferentialIdentityMaintenance", + TriggerKindParameters.AbstractIdentityMaintenance => "AbstractIdentityMaintenance", + TriggerKindParameters.IdentityPropagationFallback => "IdentityPropagationFallback", + _ => throw new ArgumentOutOfRangeException( + nameof(p), + "Unsupported trigger kind parameters type." + ), + }; + + var firstSequence = _triggersFirst + .Select(t => (t.Table.Name, t.Name.Value, KindLabel(t.Parameters))) + .ToList(); var secondSequence = _triggersSecond - .Select(t => (t.TriggerTable.Name, t.Name.Value, t.Kind)) + .Select(t => (t.Table.Name, t.Name.Value, KindLabel(t.Parameters))) .ToList(); firstSequence.Should().Equal(secondSequence); } } +/// +/// Test fixture proving that reference-bearing identity elements resolve to identity-part +/// columns (e.g. School_SchoolId) rather than FK DocumentId columns (e.g. School_DocumentId) +/// in ReferentialIdentityMaintenance triggers. +/// +[TestFixture] +public class Given_Reference_Bearing_Identity_For_ReferentialIdentity_Trigger +{ + private IReadOnlyList _triggers = default!; + + [SetUp] + public void Setup() + { + var coreProjectSchema = ConstraintDerivationTestSchemaBuilder.BuildReferenceIdentityProjectSchema(); + var coreProject = EffectiveSchemaSetFixtureBuilder.CreateEffectiveProjectSchema( + coreProjectSchema, + isExtensionProject: false + ); + var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([coreProject]); + var builder = new DerivedRelationalModelSetBuilder( + TriggerInventoryTestSchemaBuilder.BuildPassesThroughTriggerDerivation() + ); + + var result = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); + _triggers = result.TriggersInCreateOrder; + } + + [Test] + public void It_should_use_identity_part_columns_not_FK_DocumentId_in_ReferentialIdentity_trigger() + { + var refIdentity = _triggers.SingleOrDefault(t => + t.Table.Name == "Enrollment" + && t.Parameters is TriggerKindParameters.ReferentialIdentityMaintenance + ); + + refIdentity.Should().NotBeNull("Enrollment should have a ReferentialIdentityMaintenance trigger"); + var refIdParams = (TriggerKindParameters.ReferentialIdentityMaintenance)refIdentity!.Parameters; + + var columnNames = refIdParams.IdentityElements.Select(e => e.Column.Value).ToList(); + + // Must resolve to identity-part columns, not FK DocumentId columns + columnNames.Should().Contain("School_SchoolId"); + columnNames.Should().Contain("School_EducationOrganizationId"); + columnNames.Should().Contain("Student_StudentUniqueId"); + columnNames.Should().NotContain("School_DocumentId"); + columnNames.Should().NotContain("Student_DocumentId"); + } + + [Test] + public void It_should_pair_identity_part_columns_with_correct_json_paths() + { + var refIdentity = _triggers.Single(t => + t.Table.Name == "Enrollment" + && t.Parameters is TriggerKindParameters.ReferentialIdentityMaintenance + ); + + var refIdParams = (TriggerKindParameters.ReferentialIdentityMaintenance)refIdentity.Parameters; + + var mappings = refIdParams + .IdentityElements.Select(e => (e.Column.Value, e.IdentityJsonPath)) + .ToList(); + + mappings + .Should() + .Contain(("School_SchoolId", "$.schoolReference.schoolId")) + .And.Contain(("School_EducationOrganizationId", "$.schoolReference.educationOrganizationId")) + .And.Contain(("Student_StudentUniqueId", "$.studentReference.studentUniqueId")); + } + + [Test] + public void It_should_use_identity_part_columns_in_identity_projection_columns() + { + var refIdentity = _triggers.Single(t => + t.Table.Name == "Enrollment" + && t.Parameters is TriggerKindParameters.ReferentialIdentityMaintenance + ); + + var projectionColumnNames = refIdentity.IdentityProjectionColumns.Select(c => c.Value).ToList(); + + projectionColumnNames.Should().Contain("School_SchoolId"); + projectionColumnNames.Should().Contain("School_EducationOrganizationId"); + projectionColumnNames.Should().Contain("Student_StudentUniqueId"); + projectionColumnNames.Should().NotContain("School_DocumentId"); + projectionColumnNames.Should().NotContain("Student_DocumentId"); + } +} + /// /// Test pass that injects a synthetic unmapped reference mapping to validate fail-fast behavior. /// @@ -1234,106 +970,6 @@ internal static IRelationalModelSetPass[] BuildPassesThroughTriggerDerivation() ]; } - /// - /// Build pass list through trigger derivation with an injected unmapped reference mapping. - /// - internal static IRelationalModelSetPass[] BuildPassesThroughTriggerDerivationWithUnmappedReferenceMapping() - { - return - [ - new BaseTraversalAndDescriptorBindingPass(), - new DescriptorResourceMappingPass(), - new ExtensionTableDerivationPass(), - new ReferenceBindingPass(), - new AbstractIdentityTableAndUnionViewDerivationPass(), - new RootIdentityConstraintPass(), - new ReferenceConstraintPass(), - new ArrayUniquenessConstraintPass(), - new ApplyConstraintDialectHashingPass(), - new DeriveIndexInventoryPass(), - new UnmappedReferenceMappingFixturePass(), - new DeriveTriggerInventoryPass(), - ]; - } - - /// - /// Build the standard pass list through trigger derivation with key unification. - /// - internal static IRelationalModelSetPass[] BuildPassesThroughTriggerDerivationWithKeyUnification() - { - return - [ - new BaseTraversalAndDescriptorBindingPass(), - new DescriptorResourceMappingPass(), - new ExtensionTableDerivationPass(), - new ReferenceBindingPass(), - new KeyUnificationPass(), - new ValidateUnifiedAliasMetadataPass(), - new AbstractIdentityTableAndUnionViewDerivationPass(), - new RootIdentityConstraintPass(), - new ReferenceConstraintPass(), - new ArrayUniquenessConstraintPass(), - new ApplyConstraintDialectHashingPass(), - new DeriveIndexInventoryPass(), - new DeriveTriggerInventoryPass(), - ]; - } - - /// - /// Build pass list through trigger derivation with key unification and invalid presence-gate fixture, - /// without index derivation. - /// - internal static IRelationalModelSetPass[] BuildPassesThroughTriggerDerivationWithKeyUnificationAndInvalidPresenceGateWithoutIndexDerivation() - { - return - [ - new BaseTraversalAndDescriptorBindingPass(), - new DescriptorResourceMappingPass(), - new ExtensionTableDerivationPass(), - new ReferenceBindingPass(), - new KeyUnificationPass(), - new InvalidUnifiedAliasPresenceGateFixturePass(), - new ValidateUnifiedAliasMetadataPass(), - new AbstractIdentityTableAndUnionViewDerivationPass(), - new RootIdentityConstraintPass(), - new ReferenceConstraintPass(), - new ArrayUniquenessConstraintPass(), - new ApplyConstraintDialectHashingPass(), - new DeriveTriggerInventoryPass(), - ]; - } - - /// - /// Build reference identity project schema with interleaved identityJsonPaths. - /// - internal static JsonObject BuildReferenceIdentityProjectSchemaWithInterleavedIdentityPaths() - { - var projectSchema = ConstraintDerivationTestSchemaBuilder.BuildReferenceIdentityProjectSchema(); - - if (projectSchema["resourceSchemas"] is not JsonObject resourceSchemas) - { - throw new InvalidOperationException( - "Reference identity project schema is missing resourceSchemas." - ); - } - - if (resourceSchemas["enrollments"] is not JsonObject enrollmentSchema) - { - throw new InvalidOperationException( - "Reference identity project schema is missing enrollments resource schema." - ); - } - - enrollmentSchema["identityJsonPaths"] = new JsonArray - { - "$.schoolReference.schoolId", - "$.studentReference.studentUniqueId", - "$.schoolReference.educationOrganizationId", - }; - - return projectSchema; - } - /// /// Build project schema with nested collections, references, and an abstract resource. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderInvariantTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderInvariantTests.cs index 75be63a7c..1963dd893 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderInvariantTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderInvariantTests.cs @@ -218,18 +218,18 @@ public void Execute(RelationalModelSetBuilderContext context) new DbTriggerInfo( new DbTriggerName("TR_School"), table, - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName("TR_School"), table, - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); } @@ -416,18 +416,18 @@ public void Execute(RelationalModelSetBuilderContext context) new DbTriggerInfo( new DbTriggerName("TR_Common"), tableAlpha, - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName("TR_Common"), tableBeta, - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderOrderingTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderOrderingTests.cs index b89dd4cef..b810ef995 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderOrderingTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DerivedRelationalModelSetBuilderOrderingTests.cs @@ -99,7 +99,7 @@ public void It_should_order_triggers_by_table_then_name() { var orderedTriggers = _derivedModelSet .TriggersInCreateOrder.Select(trigger => - $"{trigger.TriggerTable.Schema.Value}.{trigger.TriggerTable.Name}:{trigger.Name.Value}" + $"{trigger.Table.Schema.Value}.{trigger.Table.Name}:{trigger.Name.Value}" ) .ToArray(); @@ -127,9 +127,21 @@ private sealed class PopulateUnorderedCollectionsPass : IRelationalModelSetPass /// public PopulateUnorderedCollectionsPass(EffectiveSchemaSet effectiveSchemaSet) { - _school = FindResourceKey(effectiveSchemaSet, "Ed-Fi", "School"); - _schoolTypeDescriptor = FindResourceKey(effectiveSchemaSet, "Ed-Fi", "SchoolTypeDescriptor"); - _section = FindResourceKey(effectiveSchemaSet, "Sample", "Section"); + _school = DerivedRelationalModelSetInvariantTestHelpers.FindResourceKey( + effectiveSchemaSet, + "Ed-Fi", + "School" + ); + _schoolTypeDescriptor = DerivedRelationalModelSetInvariantTestHelpers.FindResourceKey( + effectiveSchemaSet, + "Ed-Fi", + "SchoolTypeDescriptor" + ); + _section = DerivedRelationalModelSetInvariantTestHelpers.FindResourceKey( + effectiveSchemaSet, + "Sample", + "Section" + ); } /// @@ -207,36 +219,36 @@ public void Execute(RelationalModelSetBuilderContext context) new DbTriggerInfo( new DbTriggerName("TR_Section_B"), new DbTableName(sampleSchema, "Section"), - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName("TR_School_B"), new DbTableName(edfiSchema, "School"), - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName("TR_SchoolTypeDescriptor"), new DbTableName(edfiSchema, "SchoolTypeDescriptor"), - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName("TR_School_A"), new DbTableName(edfiSchema, "School"), - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); } @@ -307,21 +319,5 @@ string tableName ] ); } - - /// - /// Find resource key. - /// - private static ResourceKeyEntry FindResourceKey( - EffectiveSchemaSet effectiveSchemaSet, - string projectName, - string resourceName - ) - { - var resourceKey = effectiveSchemaSet.EffectiveSchema.ResourceKeysInIdOrder.Single(entry => - entry.Resource.ProjectName == projectName && entry.Resource.ResourceName == resourceName - ); - - return resourceKey; - } } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DialectIdentifierShorteningTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DialectIdentifierShorteningTests.cs index a31440c36..382f9c423 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DialectIdentifierShorteningTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DialectIdentifierShorteningTests.cs @@ -76,7 +76,7 @@ public void It_should_shorten_resource_model_identifiers() } /// - /// It should shorten unique, foreign key, all-or-none, and null-or-true constraint identifiers. + /// It should shorten unique constraint, foreign key, and all-or-none constraint identifiers. /// [Test] public void It_should_shorten_constraint_identifiers() @@ -91,10 +91,6 @@ public void It_should_shorten_constraint_identifiers() var expectedUnique = dialectRules.ShortenIdentifier(identifiers.UniqueConstraintName); var expectedForeign = dialectRules.ShortenIdentifier(identifiers.ForeignKeyConstraintName); var expectedAllNone = dialectRules.ShortenIdentifier(identifiers.AllOrNoneConstraintName); - var expectedNullOrTrueConstraint = dialectRules.ShortenIdentifier( - identifiers.NullOrTrueConstraintName - ); - var expectedNullOrTrueColumn = dialectRules.ShortenIdentifier(identifiers.NullOrTrueColumnName); var resourceModel = _scenario.Result.ConcreteResourcesInNameOrder.Single().RelationalModel; @@ -115,10 +111,6 @@ public void It_should_shorten_constraint_identifiers() allOrNone.Name.Should().Be(expectedAllNone); allOrNone.FkColumn.Value.Should().Be(expectedFk); allOrNone.DependentColumns.Single().Value.Should().Be(expectedIdentity); - - var nullOrTrue = resourceModel.Root.Constraints.OfType().Single(); - nullOrTrue.Name.Should().Be(expectedNullOrTrueConstraint); - nullOrTrue.Column.Value.Should().Be(expectedNullOrTrueColumn); } /// @@ -169,24 +161,13 @@ public void It_should_shorten_index_and_trigger_identifiers() index.Table.Name.Should().Be(expectedTable); index.KeyColumns.Single().Value.Should().Be(expectedKey); - var trigger = _scenario.Result.TriggersInCreateOrder.Single(entry => - entry.Kind == DbTriggerKind.DocumentStamping - ); + var trigger = _scenario.Result.TriggersInCreateOrder.Single(); trigger.Name.Value.Should().Be(expectedTrigger); - trigger.TriggerTable.Schema.Value.Should().Be(expectedSchema); - trigger.TriggerTable.Name.Should().Be(expectedTable); + trigger.Table.Schema.Value.Should().Be(expectedSchema); + trigger.Table.Name.Should().Be(expectedTable); trigger.KeyColumns.Single().Value.Should().Be(expectedKey); } - /// - /// It should shorten identity-propagation fallback trigger identifiers. - /// - [Test] - public void It_should_shorten_identity_propagation_fallback_trigger_identifiers() - { - IdentifierShorteningAssertions.AssertPropagationFallbackShortened(_scenario); - } - /// /// It should shorten abstract identity table identifiers. /// @@ -307,7 +288,7 @@ public void It_should_shorten_resource_model_identifiers() } /// - /// It should shorten unique, foreign key, all-or-none, and null-or-true constraint identifiers. + /// It should shorten unique constraint, foreign key, and all-or-none constraint identifiers. /// [Test] public void It_should_shorten_constraint_identifiers() @@ -322,10 +303,6 @@ public void It_should_shorten_constraint_identifiers() var expectedUnique = dialectRules.ShortenIdentifier(identifiers.UniqueConstraintName); var expectedForeign = dialectRules.ShortenIdentifier(identifiers.ForeignKeyConstraintName); var expectedAllNone = dialectRules.ShortenIdentifier(identifiers.AllOrNoneConstraintName); - var expectedNullOrTrueConstraint = dialectRules.ShortenIdentifier( - identifiers.NullOrTrueConstraintName - ); - var expectedNullOrTrueColumn = dialectRules.ShortenIdentifier(identifiers.NullOrTrueColumnName); var resourceModel = _scenario.Result.ConcreteResourcesInNameOrder.Single().RelationalModel; @@ -346,10 +323,6 @@ public void It_should_shorten_constraint_identifiers() allOrNone.Name.Should().Be(expectedAllNone); allOrNone.FkColumn.Value.Should().Be(expectedFk); allOrNone.DependentColumns.Single().Value.Should().Be(expectedIdentity); - - var nullOrTrue = resourceModel.Root.Constraints.OfType().Single(); - nullOrTrue.Name.Should().Be(expectedNullOrTrueConstraint); - nullOrTrue.Column.Value.Should().Be(expectedNullOrTrueColumn); } /// @@ -400,24 +373,13 @@ public void It_should_shorten_index_and_trigger_identifiers() index.Table.Name.Should().Be(expectedTable); index.KeyColumns.Single().Value.Should().Be(expectedKey); - var trigger = _scenario.Result.TriggersInCreateOrder.Single(entry => - entry.Kind == DbTriggerKind.DocumentStamping - ); + var trigger = _scenario.Result.TriggersInCreateOrder.Single(); trigger.Name.Value.Should().Be(expectedTrigger); - trigger.TriggerTable.Schema.Value.Should().Be(expectedSchema); - trigger.TriggerTable.Name.Should().Be(expectedTable); + trigger.Table.Schema.Value.Should().Be(expectedSchema); + trigger.Table.Name.Should().Be(expectedTable); trigger.KeyColumns.Single().Value.Should().Be(expectedKey); } - /// - /// It should shorten identity-propagation fallback trigger identifiers. - /// - [Test] - public void It_should_shorten_identity_propagation_fallback_trigger_identifiers() - { - IdentifierShorteningAssertions.AssertPropagationFallbackShortened(_scenario); - } - /// /// It should shorten abstract identity table identifiers. /// @@ -590,6 +552,200 @@ public string ShortenIdentifier(string identifier) } } +/// +/// Test fixture verifying that dialect shortening applies to column names inside trigger parameter subtypes. +/// +[TestFixture] +public class Given_Trigger_Parameter_Column_Shortening +{ + private DerivedRelationalModelSet _result = default!; + private ISqlDialectRules _dialectRules = default!; + private TriggerParameterColumnIdentifiers _identifiers = default!; + + [SetUp] + public void Setup() + { + _dialectRules = new PgsqlDialectRules(); + _identifiers = TriggerParameterColumnIdentifiers.Create(_dialectRules.MaxIdentifierLength + 12); + var effectiveSchemaSet = EffectiveSchemaSetFixtureBuilder.CreateHandAuthoredEffectiveSchemaSet(); + var builder = new DerivedRelationalModelSetBuilder([ + new TriggerParameterColumnFixturePass(_identifiers), + new ApplyDialectIdentifierShorteningPass(), + ]); + + _result = builder.Build(effectiveSchemaSet, _dialectRules.Dialect, _dialectRules); + } + + [Test] + public void It_should_shorten_abstract_identity_maintenance_target_column_mappings() + { + var trigger = _result.TriggersInCreateOrder.Single(t => + t.Parameters is TriggerKindParameters.AbstractIdentityMaintenance + ); + var parameters = (TriggerKindParameters.AbstractIdentityMaintenance)trigger.Parameters; + var mapping = parameters.TargetColumnMappings.Single(); + + mapping.SourceColumn.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.SourceColumn)); + mapping.TargetColumn.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.TargetColumn)); + } + + [Test] + public void It_should_shorten_identity_propagation_fallback_referrer_updates() + { + var trigger = _result.TriggersInCreateOrder.Single(t => + t.Parameters is TriggerKindParameters.IdentityPropagationFallback + ); + var parameters = (TriggerKindParameters.IdentityPropagationFallback)trigger.Parameters; + var referrer = parameters.ReferrerUpdates.Single(); + var mapping = referrer.ColumnMappings.Single(); + + referrer.ReferrerFkColumn.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.FkColumn)); + mapping.SourceColumn.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.SourceColumn)); + mapping.TargetColumn.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.TargetColumn)); + } + + [Test] + public void It_should_shorten_referential_identity_maintenance_identity_elements() + { + var trigger = _result.TriggersInCreateOrder.Single(t => + t.Parameters is TriggerKindParameters.ReferentialIdentityMaintenance + ); + var parameters = (TriggerKindParameters.ReferentialIdentityMaintenance)trigger.Parameters; + var element = parameters.IdentityElements.Single(); + + element.Column.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.IdentityColumn)); + } + + [Test] + public void It_should_shorten_superclass_alias_identity_elements() + { + var trigger = _result.TriggersInCreateOrder.Single(t => + t.Parameters is TriggerKindParameters.ReferentialIdentityMaintenance + ); + var parameters = (TriggerKindParameters.ReferentialIdentityMaintenance)trigger.Parameters; + var aliasElement = parameters.SuperclassAlias!.IdentityElements.Single(); + + aliasElement.Column.Value.Should().Be(_dialectRules.ShortenIdentifier(_identifiers.AliasColumn)); + } +} + +/// +/// Long identifier values for trigger parameter column shortening tests. +/// +internal sealed record TriggerParameterColumnIdentifiers( + string SourceColumn, + string TargetColumn, + string FkColumn, + string IdentityColumn, + string AliasColumn +) +{ + public static TriggerParameterColumnIdentifiers Create(int length) + { + return new TriggerParameterColumnIdentifiers( + SourceColumn: BuildLong("SourceCol", length), + TargetColumn: BuildLong("TargetCol", length), + FkColumn: BuildLong("FkCol", length), + IdentityColumn: BuildLong("IdentityCol", length), + AliasColumn: BuildLong("AliasCol", length) + ); + } + + private static string BuildLong(string label, int length) + { + return label.Length >= length ? label : label + new string('A', length - label.Length); + } +} + +/// +/// Fixture pass that seeds triggers with each non-DocumentStamping parameter subtype containing long column names. +/// +file sealed class TriggerParameterColumnFixturePass(TriggerParameterColumnIdentifiers identifiers) + : IRelationalModelSetPass +{ + public void Execute(RelationalModelSetBuilderContext context) + { + ArgumentNullException.ThrowIfNull(context); + + var schema = new DbSchemaName("edfi"); + var table = new DbTableName(schema, "School"); + var targetTable = new DbTableName(schema, "EducationOrganization"); + + context.TriggerInventory.Add( + new DbTriggerInfo( + new DbTriggerName("TR_AbstractId"), + table, + [], + [], + new TriggerKindParameters.AbstractIdentityMaintenance( + targetTable, + [ + new TriggerColumnMapping( + new DbColumnName(identifiers.SourceColumn), + new DbColumnName(identifiers.TargetColumn) + ), + ], + "School" + ) + ) + ); + + context.TriggerInventory.Add( + new DbTriggerInfo( + new DbTriggerName("TR_Propagation"), + table, + [], + [], + new TriggerKindParameters.IdentityPropagationFallback([ + new PropagationReferrerTarget( + targetTable, + new DbColumnName(identifiers.FkColumn), + [ + new TriggerColumnMapping( + new DbColumnName(identifiers.SourceColumn), + new DbColumnName(identifiers.TargetColumn) + ), + ] + ), + ]) + ) + ); + + context.TriggerInventory.Add( + new DbTriggerInfo( + new DbTriggerName("TR_RefIdentity"), + table, + [], + [], + new TriggerKindParameters.ReferentialIdentityMaintenance( + 1, + "Ed-Fi", + "School", + [ + new IdentityElementMapping( + new DbColumnName(identifiers.IdentityColumn), + "$.id", + new RelationalScalarType(ScalarKind.Int32) + ), + ], + new SuperclassAliasInfo( + 2, + "Ed-Fi", + "EducationOrganization", + [ + new IdentityElementMapping( + new DbColumnName(identifiers.AliasColumn), + "$.parentId", + new RelationalScalarType(ScalarKind.Int32) + ), + ] + ) + ) + ) + ); + } +} + /// /// Captures a single identifier-shortening test run, including the derived model and the long identifiers /// used as inputs. @@ -631,25 +787,14 @@ internal sealed record ShorteningIdentifiers( string SchemaName, string TableName, string KeyColumnName, - string CanonicalColumnName, - string AliasMemberColumnName, string FkColumnName, string IdentityColumnName, string DescriptorColumnName, string UniqueConstraintName, string ForeignKeyConstraintName, string AllOrNoneConstraintName, - string NullOrTrueConstraintName, - string NullOrTrueColumnName, string IndexName, string TriggerName, - string PropagationTriggerName, - string PropagationTriggerTableName, - string PropagationReferrerTableName, - string PropagationReferrerDocumentIdColumnName, - string PropagationReferencedDocumentIdColumnName, - string PropagationReferrerStorageColumnName, - string PropagationReferencedStorageColumnName, string AbstractTableName, string AbstractColumnName, string ViewName, @@ -670,41 +815,14 @@ public static ShorteningIdentifiers Create(string prefix, int length) SchemaName: BuildLongIdentifier(prefix, "Schema", length), TableName: BuildLongIdentifier(prefix, "Table", length), KeyColumnName: BuildLongIdentifier(prefix, "KeyColumn", length), - CanonicalColumnName: BuildLongIdentifier(prefix, "CanonicalColumn", length), - AliasMemberColumnName: BuildLongIdentifier(prefix, "AliasMemberColumn", length), FkColumnName: BuildLongIdentifier(prefix, "FkColumn", length), IdentityColumnName: BuildLongIdentifier(prefix, "IdentityColumn", length), DescriptorColumnName: BuildLongIdentifier(prefix, "DescriptorColumn", length), UniqueConstraintName: BuildLongIdentifier(prefix, "UniqueConstraint", length), ForeignKeyConstraintName: BuildLongIdentifier(prefix, "ForeignKeyConstraint", length), AllOrNoneConstraintName: BuildLongIdentifier(prefix, "AllOrNoneConstraint", length), - NullOrTrueConstraintName: BuildLongIdentifier(prefix, "NullOrTrueConstraint", length), - NullOrTrueColumnName: BuildLongIdentifier(prefix, "NullOrTrueColumn", length), IndexName: BuildLongIdentifier(prefix, "Index", length), TriggerName: BuildLongIdentifier(prefix, "Trigger", length), - PropagationTriggerName: BuildLongIdentifier(prefix, "PropagationTrigger", length), - PropagationTriggerTableName: BuildLongIdentifier(prefix, "PropagationTriggerTable", length), - PropagationReferrerTableName: BuildLongIdentifier(prefix, "PropagationReferrerTable", length), - PropagationReferrerDocumentIdColumnName: BuildLongIdentifier( - prefix, - "PropagationReferrerDocumentIdColumn", - length - ), - PropagationReferencedDocumentIdColumnName: BuildLongIdentifier( - prefix, - "PropagationReferencedDocumentIdColumn", - length - ), - PropagationReferrerStorageColumnName: BuildLongIdentifier( - prefix, - "PropagationReferrerStorageColumn", - length - ), - PropagationReferencedStorageColumnName: BuildLongIdentifier( - prefix, - "PropagationReferencedStorageColumn", - length - ), AbstractTableName: BuildLongIdentifier(prefix, "AbstractTable", length), AbstractColumnName: BuildLongIdentifier(prefix, "AbstractColumn", length), ViewName: BuildLongIdentifier(prefix, "View", length), @@ -746,18 +864,12 @@ public static void AssertShortened(ShorteningScenario scenario) var expectedTable = dialectRules.ShortenIdentifier(identifiers.TableName); var expectedPrimaryKey = dialectRules.ShortenIdentifier($"PK_{identifiers.TableName}"); var expectedKey = dialectRules.ShortenIdentifier(identifiers.KeyColumnName); - var expectedCanonical = dialectRules.ShortenIdentifier(identifiers.CanonicalColumnName); - var expectedAliasMember = dialectRules.ShortenIdentifier(identifiers.AliasMemberColumnName); var expectedFk = dialectRules.ShortenIdentifier(identifiers.FkColumnName); var expectedIdentity = dialectRules.ShortenIdentifier(identifiers.IdentityColumnName); var expectedDescriptor = dialectRules.ShortenIdentifier(identifiers.DescriptorColumnName); var expectedUnique = dialectRules.ShortenIdentifier(identifiers.UniqueConstraintName); var expectedForeign = dialectRules.ShortenIdentifier(identifiers.ForeignKeyConstraintName); var expectedAllNone = dialectRules.ShortenIdentifier(identifiers.AllOrNoneConstraintName); - var expectedNullOrTrueConstraint = dialectRules.ShortenIdentifier( - identifiers.NullOrTrueConstraintName - ); - var expectedNullOrTrueColumn = dialectRules.ShortenIdentifier(identifiers.NullOrTrueColumnName); var expectedIndex = dialectRules.ShortenIdentifier(identifiers.IndexName); var expectedTrigger = dialectRules.ShortenIdentifier(identifiers.TriggerName); var expectedAbstractTable = dialectRules.ShortenIdentifier(identifiers.AbstractTableName); @@ -786,23 +898,6 @@ public static void AssertShortened(ShorteningScenario scenario) .ColumnName.Value.Should() .Be(expectedKey); - var aliasMemberColumn = resourceModel.Root.Columns.Single(column => - column.ColumnName.Value == expectedAliasMember - ); - var aliasMemberStorage = aliasMemberColumn - .Storage.Should() - .BeOfType() - .Subject; - aliasMemberStorage.CanonicalColumn.Value.Should().Be(expectedCanonical); - aliasMemberStorage.PresenceColumn.Should().Be(new DbColumnName(expectedNullOrTrueColumn)); - - var keyUnificationClass = resourceModel.Root.KeyUnificationClasses.Should().ContainSingle().Subject; - keyUnificationClass.CanonicalColumn.Value.Should().Be(expectedCanonical); - keyUnificationClass - .MemberPathColumns.Select(column => column.Value) - .Should() - .Equal(expectedAliasMember, expectedIdentity); - var uniqueConstraint = resourceModel.Root.Constraints.OfType().Single(); uniqueConstraint.Name.Should().Be(expectedUnique); uniqueConstraint.Columns.Single().Value.Should().Be(expectedKey); @@ -821,10 +916,6 @@ public static void AssertShortened(ShorteningScenario scenario) allOrNone.FkColumn.Value.Should().Be(expectedFk); allOrNone.DependentColumns.Single().Value.Should().Be(expectedIdentity); - var nullOrTrue = resourceModel.Root.Constraints.OfType().Single(); - nullOrTrue.Name.Should().Be(expectedNullOrTrueConstraint); - nullOrTrue.Column.Value.Should().Be(expectedNullOrTrueColumn); - var binding = resourceModel.DocumentReferenceBindings.Single(); binding.Table.Schema.Value.Should().Be(expectedSchema); binding.Table.Name.Should().Be(expectedTable); @@ -836,55 +927,18 @@ public static void AssertShortened(ShorteningScenario scenario) edge.Table.Name.Should().Be(expectedTable); edge.FkColumn.Value.Should().Be(expectedDescriptor); - var keyUnificationDiagnostics = resourceModel.KeyUnificationEqualityConstraints; - var applied = keyUnificationDiagnostics.Applied.Should().ContainSingle().Subject; - applied.Table.Schema.Value.Should().Be(expectedSchema); - applied.Table.Name.Should().Be(expectedTable); - applied.EndpointAColumn.Value.Should().Be(expectedAliasMember); - applied.EndpointBColumn.Value.Should().Be(expectedIdentity); - applied.CanonicalColumn.Value.Should().Be(expectedCanonical); - - var redundant = keyUnificationDiagnostics.Redundant.Should().ContainSingle().Subject; - redundant.Binding.Table.Schema.Value.Should().Be(expectedSchema); - redundant.Binding.Table.Name.Should().Be(expectedTable); - redundant.Binding.Column.Value.Should().Be(expectedAliasMember); - - var ignored = keyUnificationDiagnostics.Ignored.Should().ContainSingle().Subject; - ignored.EndpointABinding.Table.Schema.Value.Should().Be(expectedSchema); - ignored.EndpointABinding.Table.Name.Should().Be(expectedTable); - ignored.EndpointABinding.Column.Value.Should().Be(expectedAliasMember); - ignored.EndpointBBinding.Table.Schema.Value.Should().Be(expectedSchema); - ignored.EndpointBBinding.Table.Name.Should().Be(expectedTable); - ignored.EndpointBBinding.Column.Value.Should().Be(expectedFk); - - var descriptorForeignKeyDeduplication = resourceModel - .DescriptorForeignKeyDeduplications.Should() - .ContainSingle() - .Subject; - descriptorForeignKeyDeduplication.Table.Schema.Value.Should().Be(expectedSchema); - descriptorForeignKeyDeduplication.Table.Name.Should().Be(expectedTable); - descriptorForeignKeyDeduplication.StorageColumn.Value.Should().Be(expectedCanonical); - descriptorForeignKeyDeduplication - .BindingColumns.Select(column => column.Value) - .Should() - .Equal(expectedDescriptor, expectedAliasMember); - var index = result.IndexesInCreateOrder.Single(); index.Name.Value.Should().Be(expectedIndex); index.Table.Schema.Value.Should().Be(expectedSchema); index.Table.Name.Should().Be(expectedTable); index.KeyColumns.Single().Value.Should().Be(expectedKey); - var trigger = result.TriggersInCreateOrder.Single(entry => - entry.Kind == DbTriggerKind.DocumentStamping - ); + var trigger = result.TriggersInCreateOrder.Single(); trigger.Name.Value.Should().Be(expectedTrigger); - trigger.TriggerTable.Schema.Value.Should().Be(expectedSchema); - trigger.TriggerTable.Name.Should().Be(expectedTable); + trigger.Table.Schema.Value.Should().Be(expectedSchema); + trigger.Table.Name.Should().Be(expectedTable); trigger.KeyColumns.Single().Value.Should().Be(expectedKey); - AssertPropagationFallbackShortened(scenario); - var abstractTable = result.AbstractIdentityTablesInNameOrder.Single(); abstractTable.TableModel.Table.Schema.Value.Should().Be(expectedSchema); abstractTable.TableModel.Table.Name.Should().Be(expectedAbstractTable); @@ -906,51 +960,6 @@ public static void AssertShortened(ShorteningScenario scenario) .Subject; sourceColumnProjection.ColumnName.Value.Should().Be(expectedKey); } - - /// - /// Asserts that propagation fallback payload identifiers are shortened as expected for the dialect. - /// - public static void AssertPropagationFallbackShortened(ShorteningScenario scenario) - { - var dialectRules = scenario.DialectRules; - var identifiers = scenario.Identifiers; - var trigger = scenario.Result.TriggersInCreateOrder.Single(entry => - entry.Kind == DbTriggerKind.IdentityPropagationFallback - ); - var expectedSchema = dialectRules.ShortenIdentifier(identifiers.SchemaName); - var expectedTriggerName = dialectRules.ShortenIdentifier(identifiers.PropagationTriggerName); - var expectedTriggerTable = dialectRules.ShortenIdentifier(identifiers.PropagationTriggerTableName); - var expectedReferrerTable = dialectRules.ShortenIdentifier(identifiers.PropagationReferrerTableName); - var expectedReferrerDocumentIdColumn = dialectRules.ShortenIdentifier( - identifiers.PropagationReferrerDocumentIdColumnName - ); - var expectedReferencedDocumentIdColumn = dialectRules.ShortenIdentifier( - identifiers.PropagationReferencedDocumentIdColumnName - ); - var expectedReferrerStorageColumn = dialectRules.ShortenIdentifier( - identifiers.PropagationReferrerStorageColumnName - ); - var expectedReferencedStorageColumn = dialectRules.ShortenIdentifier( - identifiers.PropagationReferencedStorageColumnName - ); - - trigger.Name.Value.Should().Be(expectedTriggerName); - trigger.TriggerTable.Schema.Value.Should().Be(expectedSchema); - trigger.TriggerTable.Name.Should().Be(expectedTriggerTable); - trigger.KeyColumns.Should().BeEmpty(); - trigger.IdentityProjectionColumns.Should().BeEmpty(); - trigger.PropagationFallback.Should().NotBeNull(); - - var action = trigger.PropagationFallback!.ReferrerActions.Single(); - action.ReferrerTable.Schema.Value.Should().Be(expectedSchema); - action.ReferrerTable.Name.Should().Be(expectedReferrerTable); - action.ReferrerDocumentIdColumn.Value.Should().Be(expectedReferrerDocumentIdColumn); - action.ReferencedDocumentIdColumn.Value.Should().Be(expectedReferencedDocumentIdColumn); - - var identityColumnPair = action.IdentityColumnPairs.Single(); - identityColumnPair.ReferrerStorageColumn.Value.Should().Be(expectedReferrerStorageColumn); - identityColumnPair.ReferencedStorageColumn.Value.Should().Be(expectedReferencedStorageColumn); - } } /// @@ -1008,14 +1017,6 @@ public void Execute(RelationalModelSetBuilderContext context) SourceJsonPath: null, TargetResource: null ), - new DbColumnModel( - new DbColumnName(_identifiers.CanonicalColumnName), - ColumnKind.Scalar, - new RelationalScalarType(ScalarKind.String, MaxLength: 20), - IsNullable: true, - SourceJsonPath: null, - TargetResource: null - ), new DbColumnModel( new DbColumnName(_identifiers.FkColumnName), ColumnKind.DocumentFk, @@ -1032,20 +1033,6 @@ public void Execute(RelationalModelSetBuilderContext context) SourceJsonPath: JsonPathExpressionCompiler.Compile("$.ref.identity"), TargetResource: null ), - new DbColumnModel( - new DbColumnName(_identifiers.AliasMemberColumnName), - ColumnKind.Scalar, - new RelationalScalarType(ScalarKind.String, MaxLength: 20), - IsNullable: true, - SourceJsonPath: JsonPathExpressionCompiler.Compile("$.aliasMember"), - TargetResource: null - ) - { - Storage = new ColumnStorage.UnifiedAlias( - new DbColumnName(_identifiers.CanonicalColumnName), - new DbColumnName(_identifiers.NullOrTrueColumnName) - ), - }, new DbColumnModel( new DbColumnName(_identifiers.DescriptorColumnName), ColumnKind.DescriptorFk, @@ -1054,14 +1041,6 @@ public void Execute(RelationalModelSetBuilderContext context) SourceJsonPath: JsonPathExpressionCompiler.Compile("$.descriptor"), TargetResource: ShorteningScenario.AbstractResource ), - new DbColumnModel( - new DbColumnName(_identifiers.NullOrTrueColumnName), - ColumnKind.Scalar, - new RelationalScalarType(ScalarKind.Boolean), - IsNullable: true, - SourceJsonPath: null, - TargetResource: null - ), ]; TableConstraint[] constraints = @@ -1083,10 +1062,6 @@ [new DbColumnName(_identifiers.KeyColumnName)], new DbColumnName(_identifiers.FkColumnName), [new DbColumnName(_identifiers.IdentityColumnName)] ), - new TableConstraint.NullOrTrue( - _identifiers.NullOrTrueConstraintName, - new DbColumnName(_identifiers.NullOrTrueColumnName) - ), ]; var table = new DbTableModel( @@ -1095,19 +1070,7 @@ [new DbColumnName(_identifiers.IdentityColumnName)] new TableKey(ConstraintNaming.BuildPrimaryKeyName(tableName), [keyColumn]), columns, constraints - ) - { - KeyUnificationClasses = - [ - new KeyUnificationClass( - new DbColumnName(_identifiers.CanonicalColumnName), - [ - new DbColumnName(_identifiers.AliasMemberColumnName), - new DbColumnName(_identifiers.IdentityColumnName), - ] - ), - ], - }; + ); var binding = new DocumentReferenceBinding( IsIdentityComponent: true, @@ -1140,58 +1103,7 @@ [new DbColumnName(_identifiers.IdentityColumnName)] [table], [binding], [descriptorEdge] - ) - { - KeyUnificationEqualityConstraints = new KeyUnificationEqualityConstraintDiagnostics( - [ - new KeyUnificationAppliedConstraint( - JsonPathExpressionCompiler.Compile("$.aliasMember"), - JsonPathExpressionCompiler.Compile("$.ref.identity"), - tableName, - new DbColumnName(_identifiers.AliasMemberColumnName), - new DbColumnName(_identifiers.IdentityColumnName), - new DbColumnName(_identifiers.CanonicalColumnName) - ), - ], - [ - new KeyUnificationRedundantConstraint( - JsonPathExpressionCompiler.Compile("$.redundantA"), - JsonPathExpressionCompiler.Compile("$.redundantB"), - new KeyUnificationEndpointBinding( - tableName, - new DbColumnName(_identifiers.AliasMemberColumnName) - ) - ), - ], - [ - new KeyUnificationIgnoredConstraint( - JsonPathExpressionCompiler.Compile("$.ignoredA"), - JsonPathExpressionCompiler.Compile("$.ignoredB"), - KeyUnificationIgnoredReason.CrossTable, - new KeyUnificationEndpointBinding( - tableName, - new DbColumnName(_identifiers.AliasMemberColumnName) - ), - new KeyUnificationEndpointBinding( - tableName, - new DbColumnName(_identifiers.FkColumnName) - ) - ), - ], - [new KeyUnificationIgnoredByReasonEntry(KeyUnificationIgnoredReason.CrossTable, 1)] - ), - DescriptorForeignKeyDeduplications = - [ - new DescriptorForeignKeyDeduplication( - tableName, - new DbColumnName(_identifiers.CanonicalColumnName), - [ - new DbColumnName(_identifiers.DescriptorColumnName), - new DbColumnName(_identifiers.AliasMemberColumnName), - ] - ), - ], - }; + ); context.ConcreteResourcesInNameOrder.Add( new ConcreteResourceModel(_resourceKey, ResourceStorageKind.RelationalTables, resourceModel) @@ -1262,35 +1174,9 @@ [new DbColumnName(_identifiers.KeyColumnName)], new DbTriggerInfo( new DbTriggerName(_identifiers.TriggerName), tableName, - DbTriggerKind.DocumentStamping, [new DbColumnName(_identifiers.KeyColumnName)], - [] - ) - ); - - var propagationTriggerTable = new DbTableName(schema, _identifiers.PropagationTriggerTableName); - var propagationReferrerTable = new DbTableName(schema, _identifiers.PropagationReferrerTableName); - - context.TriggerInventory.Add( - new DbTriggerInfo( - new DbTriggerName(_identifiers.PropagationTriggerName), - propagationTriggerTable, - DbTriggerKind.IdentityPropagationFallback, [], - [], - PropagationFallback: new DbIdentityPropagationFallbackInfo([ - new DbIdentityPropagationReferrerAction( - propagationReferrerTable, - new DbColumnName(_identifiers.PropagationReferrerDocumentIdColumnName), - new DbColumnName(_identifiers.PropagationReferencedDocumentIdColumnName), - [ - new DbIdentityPropagationColumnPair( - new DbColumnName(_identifiers.PropagationReferrerStorageColumnName), - new DbColumnName(_identifiers.PropagationReferencedStorageColumnName) - ), - ] - ), - ]) + new TriggerKindParameters.DocumentStamping() ) ); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.derived.manifest.json b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.derived.manifest.json index b5a5dbb6c..df4c87d9e 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.derived.manifest.json +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.derived.manifest.json @@ -97,37 +97,49 @@ } }, { - "name": "BeginDate", + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "BeginDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": false, - "source_path": "$.endDate", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -156,18 +168,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -318,6 +318,18 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", @@ -330,6 +342,30 @@ "kind": "Stored" } }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, { "name": "Rating", "kind": "Scalar", @@ -393,42 +429,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -678,39 +678,39 @@ } }, { - "name": "AssessmentAdministration_AdministrationIdentifier", - "kind": "Scalar", + "name": "AssessmentAdministration_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.administrationIdentifier", + "source_path": "$.assessmentAdministrationReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_AssessmentIdentifier", + "name": "AssessmentAdministration_AdministrationIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assessmentIdentifier", + "source_path": "$.assessmentAdministrationReference.administrationIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_AssigningEducationOrganizationId", + "name": "AssessmentAdministration_AssessmentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", + "source_path": "$.assessmentAdministrationReference.assessmentIdentifier", "storage": { "kind": "Stored" } @@ -729,37 +729,37 @@ } }, { - "name": "ParticipatingEducationOrganization_EducationOrganizationId", + "name": "AssessmentAdministration_AssigningEducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.participatingEducationOrganizationReference.educationOrganizationId", + "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_DocumentId", + "name": "ParticipatingEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference", + "source_path": "$.participatingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ParticipatingEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ParticipatingEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.participatingEducationOrganizationReference", + "source_path": "$.participatingEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -894,6 +894,18 @@ "kind": "Stored" } }, + { + "name": "AdministrationPointOfContactEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.administrationPointOfContacts[*].educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrationPointOfContactEducationOrganization_Ed_205063b290", "kind": "Scalar", @@ -957,18 +969,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "AdministrationPointOfContactEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.administrationPointOfContacts[*].educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -1072,14 +1072,13 @@ } }, { - "name": "AdministrationIdentifier", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.administrationIdentifier", + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } @@ -1111,37 +1110,38 @@ } }, { - "name": "AssigningEducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "AssigningEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assigningEducationOrganizationReference.educationOrganizationId", + "source_path": "$.assigningEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AssigningEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.assessmentReference", + "source_path": "$.assigningEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssigningEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "AdministrationIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assigningEducationOrganizationReference", + "source_path": "$.administrationIdentifier", "storage": { "kind": "Stored" } @@ -1282,6 +1282,18 @@ "kind": "Stored" } }, + { + "name": "AssessmentBatteryPart_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentBatteryParts[*].assessmentBatteryPartReference", + "storage": { + "kind": "Stored" + } + }, { "name": "AssessmentBatteryPart_AssessmentBatteryPartName", "kind": "Scalar", @@ -1320,18 +1332,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "AssessmentBatteryPart_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assessmentBatteryParts[*].assessmentBatteryPartReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -1566,14 +1566,13 @@ } }, { - "name": "AssessmentBatteryPartName", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 65 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartName", + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } @@ -1605,13 +1604,14 @@ } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentBatteryPartName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 65 }, "is_nullable": false, - "source_path": "$.assessmentReference", + "source_path": "$.assessmentBatteryPartName", "storage": { "kind": "Stored" } @@ -1725,27 +1725,26 @@ } }, { - "name": "ObjectiveAssessment_AssessmentIdentifier", - "kind": "Scalar", + "name": "ObjectiveAssessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", + "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference", "storage": { "kind": "Stored" } }, { - "name": "ObjectiveAssessment_IdentificationCode", + "name": "ObjectiveAssessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.identificationCode", + "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", "storage": { "kind": "Stored" } @@ -1764,13 +1763,14 @@ } }, { - "name": "ObjectiveAssessment_DocumentId", - "kind": "DocumentFk", + "name": "ObjectiveAssessment_IdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference", + "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.identificationCode", "storage": { "kind": "Stored" } @@ -1995,52 +1995,64 @@ } }, { - "name": "AssessmentItemCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.assessmentItemCategoryDescriptor", + "is_nullable": false, + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentItemURI", + "name": "Assessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.assessmentItemURI", + "is_nullable": false, + "source_path": "$.assessmentReference.assessmentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Assessment_AssessmentIdentifier", + "name": "Assessment_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assessmentReference.assessmentIdentifier", + "source_path": "$.assessmentReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Assessment_Namespace", + "name": "AssessmentItemCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentItemCategoryDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssessmentItemURI", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, - "is_nullable": false, - "source_path": "$.assessmentReference.namespace", + "is_nullable": true, + "source_path": "$.assessmentItemURI", "storage": { "kind": "Stored" } @@ -2110,18 +2122,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.assessmentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -2248,26 +2248,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -2525,18 +2525,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentReportingMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assessmentReportingMethodDescriptor", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentIdentifier_Unified", "kind": "Scalar", @@ -2550,32 +2538,6 @@ "kind": "Stored" } }, - { - "name": "MaximumScore", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 35 - }, - "is_nullable": false, - "source_path": "$.maximumScore", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MinimumScore", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 35 - }, - "is_nullable": false, - "source_path": "$.minimumScore", - "storage": { - "kind": "Stored" - } - }, { "name": "Namespace_Unified", "kind": "Scalar", @@ -2589,32 +2551,6 @@ "kind": "Stored" } }, - { - "name": "ObjectiveAssessment_IdentificationCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.objectiveAssessmentReference.identificationCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ScoreRangeId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.scoreRangeId", - "storage": { - "kind": "Stored" - } - }, { "name": "Assessment_DocumentId", "kind": "DocumentFk", @@ -2698,6 +2634,70 @@ "canonical_column": "Namespace_Unified", "presence_column": "ObjectiveAssessment_DocumentId" } + }, + { + "name": "ObjectiveAssessment_IdentificationCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.objectiveAssessmentReference.identificationCode", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssessmentReportingMethodDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentReportingMethodDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MaximumScore", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 35 + }, + "is_nullable": false, + "source_path": "$.maximumScore", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MinimumScore", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 35 + }, + "is_nullable": false, + "source_path": "$.minimumScore", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ScoreRangeId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.scoreRangeId", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -2861,26 +2861,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -3014,6 +3014,54 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MandatingEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MandatingEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "AssessmentCategoryDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -3201,30 +3249,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MandatingEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "MaxRawScore", "kind": "Scalar", @@ -3276,30 +3300,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MandatingEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -4371,13 +4371,13 @@ } }, { - "name": "SectionOrProgramChoiceProgram_ProgramTypeDescriptor__106025b7ce", - "kind": "DescriptorFk", + "name": "SectionOrProgramChoiceProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -4408,13 +4408,13 @@ } }, { - "name": "SectionOrProgramChoiceProgram_DocumentId", - "kind": "DocumentFk", + "name": "SectionOrProgramChoiceProgram_ProgramTypeDescriptor__106025b7ce", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -4679,6 +4679,18 @@ "kind": "Stored" } }, + { + "name": "SectionOrProgramChoiceSection_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sections[*].sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "SectionOrProgramChoiceSection_LocalCourseCode", "kind": "Scalar", @@ -4716,19 +4728,6 @@ "kind": "Stored" } }, - { - "name": "SectionOrProgramChoiceSection_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.sections[*].sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "SectionOrProgramChoiceSection_SessionName", "kind": "Scalar", @@ -4743,13 +4742,14 @@ } }, { - "name": "SectionOrProgramChoiceSection_DocumentId", - "kind": "DocumentFk", + "name": "SectionOrProgramChoiceSection_SectionIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.sections[*].sectionReference", + "source_path": "$.sections[*].sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } @@ -5373,6 +5373,30 @@ "kind": "Stored" } }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "AlternateDayName", "kind": "Scalar", @@ -5411,18 +5435,6 @@ "kind": "Stored" } }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "StartTime", "kind": "Scalar", @@ -5446,18 +5458,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -5555,38 +5555,38 @@ } }, { - "name": "ClassPeriod_ClassPeriodName", - "kind": "Scalar", + "name": "ClassPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", + "source_path": "$.classPeriods[*].classPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_SchoolId", + "name": "ClassPeriod_ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.schoolId", + "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_DocumentId", - "kind": "DocumentFk", + "name": "ClassPeriod_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference", + "source_path": "$.classPeriods[*].classPeriodReference.schoolId", "storage": { "kind": "Stored" } @@ -5920,6 +5920,18 @@ "kind": "Stored" } }, + { + "name": "Calendar_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.calendarReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Calendar_CalendarCode", "kind": "Scalar", @@ -5968,18 +5980,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.calendarReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -6250,38 +6250,37 @@ } }, { - "name": "CalendarTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.calendarTypeDescriptor", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "CalendarCode", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarCode", + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } @@ -6299,25 +6298,26 @@ } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "CalendarTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.calendarTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.calendarCode", "storage": { "kind": "Stored" } @@ -6619,69 +6619,6 @@ "kind": "Stored" } }, - { - "name": "AccountTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.accountTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AccountIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.accountIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AccountName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 100 - }, - "is_nullable": true, - "source_path": "$.accountName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BalanceSheetBalanceSheetDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.balanceSheetDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "FiscalYear_Unified", "kind": "Scalar", @@ -6695,118 +6632,26 @@ } }, { - "name": "FiscalYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.fiscalYear", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "FiscalYear_Unified", - "presence_column": null - } - }, - { - "name": "FunctionFunctionDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.functionDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "FundFundDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.fundDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ObjectObjectDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.objectDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "OperationalUnitOperationalUnitDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.operationalUnitDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgramDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.programDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProjectProjectDimension_Code", - "kind": "Scalar", + "name": "BalanceSheetBalanceSheetDimension_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 16 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.projectDimensionReference.code", + "source_path": "$.balanceSheetDimensionReference", "storage": { "kind": "Stored" } }, { - "name": "SourceSourceDimension_Code", + "name": "BalanceSheetBalanceSheetDimension_Code", "kind": "Scalar", "type": { "kind": "String", "max_length": 16 }, "is_nullable": true, - "source_path": "$.sourceDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BalanceSheetBalanceSheetDimension_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.balanceSheetDimensionReference", + "source_path": "$.balanceSheetDimensionReference.code", "storage": { "kind": "Stored" } @@ -6837,6 +6682,18 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "FunctionFunctionDimension_DocumentId", "kind": "DocumentFk", @@ -6849,6 +6706,19 @@ "kind": "Stored" } }, + { + "name": "FunctionFunctionDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.functionDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "FunctionFunctionDimension_FiscalYear", "kind": "Scalar", @@ -6875,6 +6745,19 @@ "kind": "Stored" } }, + { + "name": "FundFundDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.fundDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "FundFundDimension_FiscalYear", "kind": "Scalar", @@ -6901,6 +6784,19 @@ "kind": "Stored" } }, + { + "name": "ObjectObjectDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.objectDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "ObjectObjectDimension_FiscalYear", "kind": "Scalar", @@ -6927,6 +6823,19 @@ "kind": "Stored" } }, + { + "name": "OperationalUnitOperationalUnitDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.operationalUnitDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "OperationalUnitOperationalUnitDimension_FiscalYear", "kind": "Scalar", @@ -6953,6 +6862,19 @@ "kind": "Stored" } }, + { + "name": "ProgramProgramDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.programDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramProgramDimension_FiscalYear", "kind": "Scalar", @@ -6979,6 +6901,19 @@ "kind": "Stored" } }, + { + "name": "ProjectProjectDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.projectDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "ProjectProjectDimension_FiscalYear", "kind": "Scalar", @@ -7005,6 +6940,19 @@ "kind": "Stored" } }, + { + "name": "SourceSourceDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.sourceDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "SourceSourceDimension_FiscalYear", "kind": "Scalar", @@ -7018,6 +6966,58 @@ "canonical_column": "FiscalYear_Unified", "presence_column": "SourceSourceDimension_DocumentId" } + }, + { + "name": "AccountTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.accountTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AccountIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.accountIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AccountName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": true, + "source_path": "$.accountName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "FiscalYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.fiscalYear", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "FiscalYear_Unified", + "presence_column": null + } } ], "key_unification_classes": [ @@ -7680,50 +7680,50 @@ } }, { - "name": "ClassPeriodName", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.classPeriodName", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "OfficialAttendancePeriod", + "name": "School_SchoolId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.officialAttendancePeriod", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "OfficialAttendancePeriod", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.officialAttendancePeriod", "storage": { "kind": "Stored" } @@ -8011,6 +8011,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "AcademicSubjectDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -8072,30 +8096,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -8250,13 +8250,13 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -8287,13 +8287,13 @@ } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -10028,6 +10028,30 @@ "kind": "Stored" } }, + { + "name": "CommunityProvider_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.communityProviderReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CommunityProvider_CommunityProviderId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.communityProviderReference.communityProviderId", + "storage": { + "kind": "Stored" + } + }, { "name": "LicenseStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -10064,18 +10088,6 @@ "kind": "Stored" } }, - { - "name": "CommunityProvider_CommunityProviderId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.communityProviderReference.communityProviderId", - "storage": { - "kind": "Stored" - } - }, { "name": "LicenseEffectiveDate", "kind": "Scalar", @@ -10161,18 +10173,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CommunityProvider_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.communityProviderReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -10334,6 +10334,30 @@ "kind": "Stored" } }, + { + "name": "CommunityOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.communityOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CommunityOrganization_CommunityOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.communityOrganizationReference.communityOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "OperationalStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -10382,18 +10406,6 @@ "kind": "Stored" } }, - { - "name": "CommunityOrganization_CommunityOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.communityOrganizationReference.communityOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "CommunityProviderId", "kind": "Scalar", @@ -10468,18 +10480,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CommunityOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.communityOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -12114,6 +12114,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "ObjectiveGradeLevelDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -12152,18 +12176,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "Objective", "kind": "Scalar", @@ -12189,18 +12201,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -12364,13 +12364,26 @@ } }, { - "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Person_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.highestCompletedLevelOfEducationDescriptor", + "source_path": "$.personReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_PersonId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.personReference.personId", "storage": { "kind": "Stored" } @@ -12387,6 +12400,18 @@ "kind": "Stored" } }, + { + "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.highestCompletedLevelOfEducationDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "SexDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -12503,19 +12528,6 @@ "kind": "Stored" } }, - { - "name": "Person_PersonId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.personReference.personId", - "storage": { - "kind": "Stored" - } - }, { "name": "PersonalTitlePrefix", "kind": "Scalar", @@ -12554,18 +12566,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Person_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.personReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -14614,69 +14614,6 @@ "kind": "Stored" } }, - { - "name": "Course_CourseCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.courseReference.courseCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Course_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.courseReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "InstructionalTimePlanned", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.instructionalTimePlanned", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalCourseCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.localCourseCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalCourseTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.localCourseTitle", - "storage": { - "kind": "Stored" - } - }, { "name": "SchoolId_Unified", "kind": "Scalar", @@ -14690,38 +14627,38 @@ } }, { - "name": "Session_SchoolYear", - "kind": "Scalar", + "name": "Course_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sessionReference.schoolYear", + "source_path": "$.courseReference", "storage": { "kind": "Stored" } }, { - "name": "Session_SessionName", + "name": "Course_CourseCode", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.sessionReference.sessionName", + "source_path": "$.courseReference.courseCode", "storage": { "kind": "Stored" } }, { - "name": "Course_DocumentId", - "kind": "DocumentFk", + "name": "Course_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.courseReference", + "source_path": "$.courseReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -14777,6 +14714,69 @@ "canonical_column": "SchoolId_Unified", "presence_column": "Session_DocumentId" } + }, + { + "name": "Session_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.sessionReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Session_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.sessionReference.sessionName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "InstructionalTimePlanned", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.instructionalTimePlanned", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalCourseCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.localCourseCode", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalCourseTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.localCourseTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -15323,6 +15323,153 @@ "kind": "Stored" } }, + { + "name": "CourseCourse_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.courseReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CourseCourse_CourseCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.courseReference.courseCode", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CourseCourse_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.courseReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ExternalEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.externalEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ExternalEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.externalEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibleTeacherStaff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.responsibleTeacherStaffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibleTeacherStaff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.responsibleTeacherStaffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_TermDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.termDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "AttemptedCreditTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -15383,18 +15530,6 @@ "kind": "Stored" } }, - { - "name": "StudentAcademicRecord_TermDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.termDescriptor", - "storage": { - "kind": "Stored" - } - }, { "name": "WhenTakenGradeLevelDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -15474,31 +15609,6 @@ "kind": "Stored" } }, - { - "name": "CourseCourse_CourseCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.courseReference.courseCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CourseCourse_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.courseReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "CourseTitle", "kind": "Scalar", @@ -15553,18 +15663,6 @@ "kind": "Stored" } }, - { - "name": "ExternalEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.externalEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "FinalLetterGradeEarned", "kind": "Scalar", @@ -15591,104 +15689,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ResponsibleTeacherStaff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.responsibleTeacherStaffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CourseCourse_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.courseReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ExternalEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.externalEducationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ResponsibleTeacherStaff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.responsibleTeacherStaffReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -16222,13 +16222,13 @@ } }, { - "name": "CourseProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "CourseProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.coursePrograms[*].courseProgramReference.programTypeDescriptor", + "source_path": "$.coursePrograms[*].courseProgramReference", "storage": { "kind": "Stored" } @@ -16259,13 +16259,13 @@ } }, { - "name": "CourseProgram_DocumentId", - "kind": "DocumentFk", + "name": "CourseProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.coursePrograms[*].courseProgramReference", + "source_path": "$.coursePrograms[*].courseProgramReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -16736,6 +16736,18 @@ "kind": "Stored" } }, + { + "name": "Section_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sections[*].sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_LocalCourseCode", "kind": "Scalar", @@ -16773,19 +16785,6 @@ "kind": "Stored" } }, - { - "name": "Section_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.sections[*].sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Section_SessionName", "kind": "Scalar", @@ -16800,13 +16799,14 @@ } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Section_SectionIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.sections[*].sectionReference", + "source_path": "$.sections[*].sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } @@ -17126,6 +17126,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "CareerPathwayDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -17237,18 +17261,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "HighSchoolCourseRequirement", "kind": "Scalar", @@ -17352,18 +17364,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -17880,26 +17880,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -19686,6 +19686,79 @@ "kind": "Stored" } }, + { + "name": "AssignmentSchool_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assignmentSchoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssignmentSchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.assignmentSchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibilitySchool_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.responsibilitySchoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibilitySchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.responsibilitySchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "DisciplineActionLengthDifferenceReasonDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -19712,18 +19785,6 @@ "kind": "Stored" } }, - { - "name": "AssignmentSchool_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.assignmentSchoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "DisciplineActionIdentifier", "kind": "Scalar", @@ -19786,67 +19847,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ResponsibilitySchool_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.responsibilitySchoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AssignmentSchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assignmentSchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ResponsibilitySchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.responsibilitySchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -20110,26 +20110,26 @@ } }, { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.staffs[*].staffReference.staffUniqueId", + "source_path": "$.staffs[*].staffReference", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "Staff_StaffUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.staffs[*].staffReference", + "source_path": "$.staffs[*].staffReference.staffUniqueId", "storage": { "kind": "Stored" } @@ -20221,6 +20221,18 @@ "kind": "Stored" } }, + { + "name": "StudentDisciplineIncidentBehaviorAssociation_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.studentDisciplineIncidentBehaviorAssociations[*].studentDisciplineIncidentBehaviorAssociationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "StudentDisciplineIncidentBehaviorAssociation_Behavio_4bed9fbe3b", "kind": "DescriptorFk", @@ -20270,18 +20282,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "StudentDisciplineIncidentBehaviorAssociation_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.studentDisciplineIncidentBehaviorAssociations[*].studentDisciplineIncidentBehaviorAssociationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -20502,6 +20502,30 @@ "kind": "Stored" } }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "IncidentLocationDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -20627,30 +20651,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -21251,6 +21251,31 @@ "kind": "Stored" } }, + { + "name": "LearningResourceChoiceLearningResourceLearningStanda_5916be65e2", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.learningStandardReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LearningResourceChoiceLearningResourceLearningStanda_bd2bbf48c0", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.learningStandardReference.learningStandardId", + "storage": { + "kind": "Stored" + } + }, { "name": "ContentClassDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -21339,19 +21364,6 @@ "kind": "Stored" } }, - { - "name": "LearningResourceChoiceLearningResourceLearningStanda_bd2bbf48c0", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.learningStandardReference.learningStandardId", - "storage": { - "kind": "Stored" - } - }, { "name": "LearningResourceMetadataURI", "kind": "Scalar", @@ -21466,18 +21478,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "LearningResourceChoiceLearningResourceLearningStanda_5916be65e2", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.learningStandardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -21906,26 +21906,26 @@ } }, { - "name": "DerivativeSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "DerivativeSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference.contentIdentifier", + "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference", "storage": { "kind": "Stored" } }, { - "name": "DerivativeSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "DerivativeSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference", + "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -22423,13 +22423,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.beginDate", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -22447,13 +22447,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "InterventionPrescriptionInterventionPrescription_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.interventionPrescriptionReference", "storage": { "kind": "Stored" } @@ -22484,25 +22484,25 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.interventionPrescriptionReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -22637,13 +22637,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "EducationOrganizationNetwork_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.beginDate", + "is_nullable": false, + "source_path": "$.educationOrganizationNetworkReference", "storage": { "kind": "Stored" } @@ -22661,13 +22661,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "MemberEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.memberEducationOrganizationReference", "storage": { "kind": "Stored" } @@ -22685,25 +22685,25 @@ } }, { - "name": "EducationOrganizationNetwork_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationNetworkReference", + "is_nullable": true, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "MemberEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.memberEducationOrganizationReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -24439,49 +24439,49 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "PeerEducationOrganization_EducationOrganizationId", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.peerEducationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", + "name": "PeerEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.peerEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "PeerEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "PeerEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.peerEducationOrganizationReference", + "source_path": "$.peerEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -24632,6 +24632,30 @@ "kind": "Stored" } }, + { + "name": "StateEducationAgency_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StateEducationAgency_StateEducationAgencyId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", + "storage": { + "kind": "Stored" + } + }, { "name": "OperationalStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -24682,18 +24706,6 @@ "kind": "Stored" } }, - { - "name": "StateEducationAgency_StateEducationAgencyId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", - "storage": { - "kind": "Stored" - } - }, { "name": "WebSite", "kind": "Scalar", @@ -24706,18 +24718,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "StateEducationAgency_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.stateEducationAgencyReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -26426,149 +26426,149 @@ } }, { - "name": "EvaluationRubricRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluationElement_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.evaluationRubricRatingLevelDescriptor", + "is_nullable": false, + "source_path": "$.programEvaluationElementReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationPeriodDesc_cc4f929706", - "kind": "DescriptorFk", + "name": "ProgramEvaluationElement_ProgramEvaluationElementTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationPeriodDescriptor", + "source_path": "$.programEvaluationElementReference.programEvaluationElementTitle", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationTypeDescri_18bd7f7e71", - "kind": "DescriptorFk", + "name": "ProgramEvaluationElement_ProgramEducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationElementReference.programEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluationElement_ProgramEvaluationPeriodDesc_cc4f929706", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programTypeDescriptor", + "source_path": "$.programEvaluationElementReference.programEvaluationPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationCriterionDescription", + "name": "ProgramEvaluationElement_ProgramEvaluationTitle", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 50 }, "is_nullable": false, - "source_path": "$.evaluationCriterionDescription", + "source_path": "$.programEvaluationElementReference.programEvaluationTitle", "storage": { "kind": "Stored" } }, { - "name": "EvaluationRubricRating", - "kind": "Scalar", + "name": "ProgramEvaluationElement_ProgramEvaluationTypeDescri_18bd7f7e71", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.evaluationRubricRating", + "source_path": "$.programEvaluationElementReference.programEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEducationOrganizationId", + "name": "ProgramEvaluationElement_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEducationOrganizationId", + "source_path": "$.programEvaluationElementReference.programName", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationElementTitle", - "kind": "Scalar", + "name": "ProgramEvaluationElement_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationElementTitle", + "source_path": "$.programEvaluationElementReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationTitle", - "kind": "Scalar", + "name": "EvaluationRubricRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationTitle", + "is_nullable": true, + "source_path": "$.evaluationRubricRatingLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramName", + "name": "EvaluationCriterionDescription", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programName", + "source_path": "$.evaluationCriterionDescription", "storage": { "kind": "Stored" } }, { - "name": "RubricDimensionSortOrder", + "name": "EvaluationRubricRating", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.rubricDimensionSortOrder", + "is_nullable": false, + "source_path": "$.evaluationRubricRating", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_DocumentId", - "kind": "DocumentFk", + "name": "RubricDimensionSortOrder", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.programEvaluationElementReference", + "is_nullable": true, + "source_path": "$.rubricDimensionSortOrder", "storage": { "kind": "Stored" } @@ -26849,86 +26849,86 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "FeederSchool_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.feederSchoolReference", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "FeederSchool_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.feederSchoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "FeederRelationshipDescription", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.feederRelationshipDescription", + "is_nullable": false, + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "FeederSchool_SchoolId", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.feederSchoolReference.schoolId", + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "FeederSchool_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.feederSchoolReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "FeederRelationshipDescription", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.feederRelationshipDescription", "storage": { "kind": "Stored" } @@ -27605,164 +27605,156 @@ } }, { - "name": "GradebookEntryTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.gradebookEntryTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriod_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "DateAssigned", + "name": "SchoolYear_Unified", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.dateAssigned", + "is_nullable": true, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "Description", - "kind": "Scalar", + "name": "GradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.description", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "DueDate", - "kind": "Scalar", + "name": "GradingPeriod_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.dueDate", + "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "DueTime", + "name": "GradingPeriod_GradingPeriodName", "kind": "Scalar", "type": { - "kind": "Time" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.dueTime", + "source_path": "$.gradingPeriodReference.gradingPeriodName", "storage": { "kind": "Stored" } }, { - "name": "GradebookEntryIdentifier", + "name": "GradingPeriod_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.gradebookEntryIdentifier", + "is_nullable": true, + "source_path": "$.gradingPeriodReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "GradingPeriod_DocumentId" } }, { - "name": "GradingPeriod_GradingPeriodName", + "name": "GradingPeriod_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference.gradingPeriodName", + "source_path": "$.gradingPeriodReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "GradingPeriod_DocumentId" } }, { - "name": "MaxPoints", - "kind": "Scalar", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.maxPoints", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } }, { - "name": "Namespace", + "name": "Section_LocalCourseCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, - "is_nullable": false, - "source_path": "$.namespace", + "is_nullable": true, + "source_path": "$.sectionReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "Section_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": null, + "source_path": "$.sectionReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Section_DocumentId" } }, { - "name": "SchoolYear_Unified", + "name": "Section_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": null, + "source_path": "$.sectionReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Section_DocumentId" } }, { - "name": "Section_LocalCourseCode", + "name": "Section_SessionName", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.sectionReference.localCourseCode", + "source_path": "$.sectionReference.sessionName", "storage": { "kind": "Stored" } @@ -27781,122 +27773,130 @@ } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "GradebookEntryTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.gradebookEntryTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SourceSectionIdentifier", + "name": "DateAssigned", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sourceSectionIdentifier", + "source_path": "$.dateAssigned", "storage": { "kind": "Stored" } }, { - "name": "Title", + "name": "Description", "kind": "Scalar", "type": { "kind": "String", - "max_length": 100 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.title", + "is_nullable": true, + "source_path": "$.description", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriod_DocumentId", - "kind": "DocumentFk", + "name": "DueDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference", + "source_path": "$.dueDate", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriod_SchoolId", + "name": "DueTime", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Time" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference.schoolId", + "source_path": "$.dueTime", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "GradingPeriod_DocumentId" + "kind": "Stored" } }, { - "name": "GradingPeriod_SchoolYear", + "name": "GradebookEntryIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.gradingPeriodReference.schoolYear", + "is_nullable": false, + "source_path": "$.gradebookEntryIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "GradingPeriod_DocumentId" + "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "MaxPoints", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 9, + "scale": 2 }, "is_nullable": true, - "source_path": "$.sectionReference", + "source_path": "$.maxPoints", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolId", + "name": "Namespace", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.sectionReference.schoolId", + "is_nullable": false, + "source_path": "$.namespace", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" } }, { - "name": "Section_SchoolYear", + "name": "SourceSectionIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.sectionReference.schoolYear", + "is_nullable": false, + "source_path": "$.sourceSectionIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" + } + }, + { + "name": "Title", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": false, + "source_path": "$.title", + "storage": { + "kind": "Stored" } } ], @@ -28098,26 +28098,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -28284,132 +28284,6 @@ "kind": "Stored" } }, - { - "name": "GradeTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.gradeTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PerformanceBaseConversionDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.performanceBaseConversionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CurrentGradeAsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.currentGradeAsOfDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CurrentGradeIndicator", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.currentGradeIndicator", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DiagnosticStatement", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.diagnosticStatement", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradeEarnedDescription", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 64 - }, - "is_nullable": true, - "source_path": "$.gradeEarnedDescription", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriodGradingPeriod_GradingPeriodName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LetterGradeEarned", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 20 - }, - "is_nullable": true, - "source_path": "$.letterGradeEarned", - "storage": { - "kind": "Stored" - } - }, - { - "name": "NumericGradeEarned", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 - }, - "is_nullable": true, - "source_path": "$.numericGradeEarned", - "storage": { - "kind": "Stored" - } - }, { "name": "SchoolId_Unified", "kind": "Scalar", @@ -28435,77 +28309,38 @@ } }, { - "name": "StudentSectionAssociation_BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.beginDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentSectionAssociation_LocalCourseCode", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.localCourseCode", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSectionAssociation_SectionIdentifier", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.sectionIdentifier", + "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentSectionAssociation_SessionName", + "name": "GradingPeriodGradingPeriod_GradingPeriodName", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.sessionName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentSectionAssociation_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriodGradingPeriod_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference", + "source_path": "$.gradingPeriodReference.gradingPeriodName", "storage": { "kind": "Stored" } @@ -28550,6 +28385,31 @@ "kind": "Stored" } }, + { + "name": "StudentSectionAssociation_BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentSectionAssociation_LocalCourseCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.localCourseCode", + "storage": { + "kind": "Stored" + } + }, { "name": "StudentSectionAssociation_SchoolId", "kind": "Scalar", @@ -28577,6 +28437,146 @@ "canonical_column": "SchoolYear_Unified", "presence_column": "StudentSectionAssociation_DocumentId" } + }, + { + "name": "StudentSectionAssociation_SectionIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.sectionIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentSectionAssociation_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.sessionName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentSectionAssociation_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GradeTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.gradeTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PerformanceBaseConversionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.performanceBaseConversionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CurrentGradeAsOfDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.currentGradeAsOfDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CurrentGradeIndicator", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.currentGradeIndicator", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DiagnosticStatement", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.diagnosticStatement", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GradeEarnedDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 64 + }, + "is_nullable": true, + "source_path": "$.gradeEarnedDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LetterGradeEarned", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 20 + }, + "is_nullable": true, + "source_path": "$.letterGradeEarned", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NumericGradeEarned", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.numericGradeEarned", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -28810,39 +28810,51 @@ } }, { - "name": "PerformanceBaseConversionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LearningStandardGradeLearningStandard_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.learningStandardGrades[*].performanceBaseConversionDescriptor", + "is_nullable": false, + "source_path": "$.learningStandardGrades[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "DiagnosticStatement", + "name": "LearningStandardGradeLearningStandard_LearningStandardId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.learningStandardGrades[*].learningStandardReference.learningStandardId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PerformanceBaseConversionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandardGrades[*].diagnosticStatement", + "source_path": "$.learningStandardGrades[*].performanceBaseConversionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LearningStandardGradeLearningStandard_LearningStandardId", + "name": "DiagnosticStatement", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.learningStandardGrades[*].learningStandardReference.learningStandardId", + "is_nullable": true, + "source_path": "$.learningStandardGrades[*].diagnosticStatement", "storage": { "kind": "Stored" } @@ -28873,18 +28885,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "LearningStandardGradeLearningStandard_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.learningStandardGrades[*].learningStandardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -29098,6 +29098,54 @@ "kind": "Stored" } }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "GradingPeriodDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -29159,30 +29207,6 @@ "kind": "Stored" } }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "TotalInstructionalDays", "kind": "Scalar", @@ -29194,30 +29218,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -29409,37 +29409,37 @@ } }, { - "name": "GraduationPlanTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.graduationPlanTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "TotalRequiredCreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.totalRequiredCreditTypeDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "GraduationSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.graduationSchoolYearTypeReference", "storage": { "kind": "Stored" } @@ -29456,6 +29456,30 @@ "kind": "Stored" } }, + { + "name": "GraduationPlanTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.graduationPlanTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "TotalRequiredCreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.totalRequiredCreditTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "IndividualPlan", "kind": "Scalar", @@ -29495,30 +29519,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GraduationSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.graduationSchoolYearTypeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -30004,154 +30004,192 @@ } }, { - "name": "AcademicSubjectDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AcademicSubjectDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.creditsBySubjects[*].academicSubjectDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.creditsBySubjects[*].creditTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CreditConversion", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.creditsBySubjects[*].creditConversion", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Credits", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 3 + }, + "is_nullable": false, + "source_path": "$.creditsBySubjects[*].credits", + "storage": { + "kind": "Stored" + } + } + ], + "key_unification_classes": [], + "descriptor_fk_deduplications": [], + "constraints": [ + { + "kind": "Unique", + "name": "UX_GraduationPlanCreditsBySubject_AcademicSubjectDes_84b3f31eab", + "columns": [ + "GraduationPlan_DocumentId", + "AcademicSubjectDescriptor_DescriptorId" + ] + }, + { + "kind": "ForeignKey", + "name": "FK_GraduationPlanCreditsBySubject_AcademicSubjectDescriptor", + "columns": [ + "AcademicSubjectDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_GraduationPlanCreditsBySubject_CreditTypeDescriptor", + "columns": [ + "CreditTypeDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_GraduationPlanCreditsBySubject_GraduationPlan", + "columns": [ + "GraduationPlan_DocumentId" + ], + "target_table": { + "schema": "edfi", + "name": "GraduationPlan" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "Cascade", + "on_update": "NoAction" + } + ] + }, + { + "schema": "edfi", + "name": "GraduationPlanRequiredAssessment", + "scope": "$.requiredAssessments[*]", + "key_columns": [ + { + "name": "GraduationPlan_DocumentId", + "kind": "ParentKeyPart" + }, + { + "name": "Ordinal", + "kind": "Ordinal" + } + ], + "columns": [ + { + "name": "GraduationPlan_DocumentId", + "kind": "ParentKeyPart", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Ordinal", + "kind": "Ordinal", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "RequiredAssessmentAssessment_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.creditsBySubjects[*].academicSubjectDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.creditsBySubjects[*].creditTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CreditConversion", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 - }, - "is_nullable": true, - "source_path": "$.creditsBySubjects[*].creditConversion", + "source_path": "$.requiredAssessments[*].assessmentReference", "storage": { "kind": "Stored" } }, { - "name": "Credits", + "name": "RequiredAssessmentAssessment_AssessmentIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 3 - }, - "is_nullable": false, - "source_path": "$.creditsBySubjects[*].credits", - "storage": { - "kind": "Stored" - } - } - ], - "key_unification_classes": [], - "descriptor_fk_deduplications": [], - "constraints": [ - { - "kind": "Unique", - "name": "UX_GraduationPlanCreditsBySubject_AcademicSubjectDes_84b3f31eab", - "columns": [ - "GraduationPlan_DocumentId", - "AcademicSubjectDescriptor_DescriptorId" - ] - }, - { - "kind": "ForeignKey", - "name": "FK_GraduationPlanCreditsBySubject_AcademicSubjectDescriptor", - "columns": [ - "AcademicSubjectDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_GraduationPlanCreditsBySubject_CreditTypeDescriptor", - "columns": [ - "CreditTypeDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_GraduationPlanCreditsBySubject_GraduationPlan", - "columns": [ - "GraduationPlan_DocumentId" - ], - "target_table": { - "schema": "edfi", - "name": "GraduationPlan" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "Cascade", - "on_update": "NoAction" - } - ] - }, - { - "schema": "edfi", - "name": "GraduationPlanRequiredAssessment", - "scope": "$.requiredAssessments[*]", - "key_columns": [ - { - "name": "GraduationPlan_DocumentId", - "kind": "ParentKeyPart" - }, - { - "name": "Ordinal", - "kind": "Ordinal" - } - ], - "columns": [ - { - "name": "GraduationPlan_DocumentId", - "kind": "ParentKeyPart", - "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": null, + "source_path": "$.requiredAssessments[*].assessmentReference.assessmentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Ordinal", - "kind": "Ordinal", + "name": "RequiredAssessmentAssessment_Namespace", + "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": null, + "source_path": "$.requiredAssessments[*].assessmentReference.namespace", "storage": { "kind": "Stored" } @@ -30192,32 +30230,6 @@ "kind": "Stored" } }, - { - "name": "RequiredAssessmentAssessment_AssessmentIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.requiredAssessments[*].assessmentReference.assessmentIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "RequiredAssessmentAssessment_Namespace", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.requiredAssessments[*].assessmentReference.namespace", - "storage": { - "kind": "Stored" - } - }, { "name": "RequiredMaximumScore", "kind": "Scalar", @@ -30256,18 +30268,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "RequiredAssessmentAssessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.requiredAssessments[*].assessmentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -30432,38 +30432,38 @@ } }, { - "name": "CourseCourse_CourseCode", - "kind": "Scalar", + "name": "CourseCourse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.creditsByCourses[*].courses[*].courseReference.courseCode", + "source_path": "$.creditsByCourses[*].courses[*].courseReference", "storage": { "kind": "Stored" } }, { - "name": "CourseCourse_EducationOrganizationId", + "name": "CourseCourse_CourseCode", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.creditsByCourses[*].courses[*].courseReference.educationOrganizationId", + "source_path": "$.creditsByCourses[*].courses[*].courseReference.courseCode", "storage": { "kind": "Stored" } }, { - "name": "CourseCourse_DocumentId", - "kind": "DocumentFk", + "name": "CourseCourse_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.creditsByCourses[*].courses[*].courseReference", + "source_path": "$.creditsByCourses[*].courses[*].courseReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -31246,37 +31246,49 @@ } }, { - "name": "DeliveryMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.deliveryMethodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionClassDescriptor_DescriptorId", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DeliveryMethodDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.interventionClassDescriptor", + "source_path": "$.deliveryMethodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "InterventionClassDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.interventionClassDescriptor", "storage": { "kind": "Stored" } @@ -31330,18 +31342,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -31771,26 +31771,26 @@ } }, { - "name": "EducationContentSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "EducationContentSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", + "source_path": "$.educationContents[*].educationContentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationContentSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "EducationContentSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference", + "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -32228,37 +32228,37 @@ } }, { - "name": "DeliveryMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.deliveryMethodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionClassDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.interventionClassDescriptor", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "InterventionPrescriptionInterventionPrescription_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.interventionPrescriptionReference", "storage": { "kind": "Stored" } @@ -32289,50 +32289,50 @@ } }, { - "name": "InterventionStudyIdentificationCode", - "kind": "Scalar", + "name": "DeliveryMethodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.interventionStudyIdentificationCode", + "source_path": "$.deliveryMethodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Participants", - "kind": "Scalar", + "name": "InterventionClassDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.participants", + "source_path": "$.interventionClassDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "InterventionStudyIdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.interventionStudyIdentificationCode", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_DocumentId", - "kind": "DocumentFk", + "name": "Participants", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.interventionPrescriptionReference", + "source_path": "$.participants", "storage": { "kind": "Stored" } @@ -32688,26 +32688,26 @@ } }, { - "name": "EducationContentSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "EducationContentSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", + "source_path": "$.educationContents[*].educationContentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationContentSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "EducationContentSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference", + "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -33489,49 +33489,61 @@ } }, { - "name": "DeliveryMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.deliveryMethodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionClassDescriptor_DescriptorId", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DeliveryMethodDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.interventionClassDescriptor", + "source_path": "$.deliveryMethodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "InterventionClassDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.interventionClassDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } @@ -33597,18 +33609,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -34038,26 +34038,26 @@ } }, { - "name": "EducationContentSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "EducationContentSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", + "source_path": "$.educationContents[*].educationContentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationContentSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "EducationContentSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference", + "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -34150,38 +34150,38 @@ } }, { - "name": "InterventionPrescriptionInterventionPrescription_Edu_532babb247", - "kind": "Scalar", + "name": "InterventionPrescriptionInterventionPrescription_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.educationOrganizationId", + "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_Int_409fc39d28", + "name": "InterventionPrescriptionInterventionPrescription_Edu_532babb247", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.interventionPrescriptionIdentificationCode", + "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_DocumentId", - "kind": "DocumentFk", + "name": "InterventionPrescriptionInterventionPrescription_Int_409fc39d28", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference", + "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.interventionPrescriptionIdentificationCode", "storage": { "kind": "Stored" } @@ -34453,98 +34453,110 @@ } }, { - "name": "PopulationServedDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.populationServeds[*].populationServedDescriptor", - "storage": { - "kind": "Stored" - } - } - ], - "key_unification_classes": [], - "descriptor_fk_deduplications": [], - "constraints": [ - { - "kind": "Unique", - "name": "UX_InterventionPopulationServed_Intervention_Documen_bbffd68f0d", - "columns": [ - "Intervention_DocumentId", - "PopulationServedDescriptor_DescriptorId" - ] - }, - { - "kind": "ForeignKey", - "name": "FK_InterventionPopulationServed_Intervention", - "columns": [ - "Intervention_DocumentId" - ], - "target_table": { - "schema": "edfi", - "name": "Intervention" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "Cascade", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_InterventionPopulationServed_PopulationServedDescriptor", - "columns": [ - "PopulationServedDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - } - ] - }, - { - "schema": "edfi", - "name": "InterventionStaff", - "scope": "$.staffs[*]", - "key_columns": [ - { - "name": "Intervention_DocumentId", - "kind": "ParentKeyPart" - }, - { - "name": "Ordinal", - "kind": "Ordinal" - } - ], - "columns": [ - { - "name": "Intervention_DocumentId", - "kind": "ParentKeyPart", + "name": "PopulationServedDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.populationServeds[*].populationServedDescriptor", + "storage": { + "kind": "Stored" + } + } + ], + "key_unification_classes": [], + "descriptor_fk_deduplications": [], + "constraints": [ + { + "kind": "Unique", + "name": "UX_InterventionPopulationServed_Intervention_Documen_bbffd68f0d", + "columns": [ + "Intervention_DocumentId", + "PopulationServedDescriptor_DescriptorId" + ] + }, + { + "kind": "ForeignKey", + "name": "FK_InterventionPopulationServed_Intervention", + "columns": [ + "Intervention_DocumentId" + ], + "target_table": { + "schema": "edfi", + "name": "Intervention" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "Cascade", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_InterventionPopulationServed_PopulationServedDescriptor", + "columns": [ + "PopulationServedDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + } + ] + }, + { + "schema": "edfi", + "name": "InterventionStaff", + "scope": "$.staffs[*]", + "key_columns": [ + { + "name": "Intervention_DocumentId", + "kind": "ParentKeyPart" + }, + { + "name": "Ordinal", + "kind": "Ordinal" + } + ], + "columns": [ + { + "name": "Intervention_DocumentId", + "kind": "ParentKeyPart", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Ordinal", + "kind": "Ordinal", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "Ordinal", - "kind": "Ordinal", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.staffs[*].staffReference", "storage": { "kind": "Stored" } @@ -34561,18 +34573,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.staffs[*].staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -34908,101 +34908,101 @@ } }, { - "name": "LearningStandardEquivalenceStrengthDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SourceLearningStandard_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.learningStandardEquivalenceStrengthDescriptor", + "is_nullable": false, + "source_path": "$.sourceLearningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "EffectiveDate", + "name": "SourceLearningStandard_LearningStandardId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.effectiveDate", + "is_nullable": false, + "source_path": "$.sourceLearningStandardReference.learningStandardId", "storage": { "kind": "Stored" } }, { - "name": "LearningStandardEquivalenceStrengthDescription", - "kind": "Scalar", + "name": "TargetLearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.learningStandardEquivalenceStrengthDescription", + "is_nullable": false, + "source_path": "$.targetLearningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "Namespace", + "name": "TargetLearningStandard_LearningStandardId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.namespace", + "source_path": "$.targetLearningStandardReference.learningStandardId", "storage": { "kind": "Stored" } }, { - "name": "SourceLearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandardEquivalenceStrengthDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sourceLearningStandardReference.learningStandardId", + "is_nullable": true, + "source_path": "$.learningStandardEquivalenceStrengthDescriptor", "storage": { "kind": "Stored" } }, { - "name": "TargetLearningStandard_LearningStandardId", + "name": "EffectiveDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.targetLearningStandardReference.learningStandardId", + "is_nullable": true, + "source_path": "$.effectiveDate", "storage": { "kind": "Stored" } }, { - "name": "SourceLearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandardEquivalenceStrengthDescription", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.sourceLearningStandardReference", + "is_nullable": true, + "source_path": "$.learningStandardEquivalenceStrengthDescription", "storage": { "kind": "Stored" } }, { - "name": "TargetLearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.targetLearningStandardReference", + "source_path": "$.namespace", "storage": { "kind": "Stored" } @@ -35204,6 +35204,55 @@ "kind": "Stored" } }, + { + "name": "MandatingEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MandatingEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ParentLearningStandard_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.parentLearningStandardReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ParentLearningStandard_LearningStandardId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.parentLearningStandardReference.learningStandardId", + "storage": { + "kind": "Stored" + } + }, { "name": "ContentStandardPublicationStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -35379,18 +35428,6 @@ "kind": "Stored" } }, - { - "name": "MandatingEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "Namespace", "kind": "Scalar", @@ -35404,19 +35441,6 @@ "kind": "Stored" } }, - { - "name": "ParentLearningStandard_LearningStandardId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.parentLearningStandardReference.learningStandardId", - "storage": { - "kind": "Stored" - } - }, { "name": "SuccessCriteria", "kind": "Scalar", @@ -35442,30 +35466,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "MandatingEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ParentLearningStandard_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.parentLearningStandardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -36167,27 +36167,25 @@ } }, { - "name": "AccountIdentifier", + "name": "FiscalYear_Unified", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.accountIdentifier", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "AccountName", - "kind": "Scalar", + "name": "ChartOfAccountChartOfAccount_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 100 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.accountName", + "is_nullable": false, + "source_path": "$.chartOfAccountReference", "storage": { "kind": "Stored" } @@ -36218,79 +36216,81 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ChartOfAccountChartOfAccount_FiscalYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.chartOfAccountReference.fiscalYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "FiscalYear_Unified", + "presence_column": "ChartOfAccountChartOfAccount_DocumentId" } }, { - "name": "FiscalYear_Unified", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "FiscalYear", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.fiscalYear", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "FiscalYear_Unified", - "presence_column": null + "kind": "Stored" } }, { - "name": "ChartOfAccountChartOfAccount_DocumentId", - "kind": "DocumentFk", + "name": "AccountIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.chartOfAccountReference", + "source_path": "$.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "ChartOfAccountChartOfAccount_FiscalYear", + "name": "AccountName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 100 }, - "is_nullable": false, - "source_path": "$.chartOfAccountReference.fiscalYear", + "is_nullable": true, + "source_path": "$.accountName", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "FiscalYear_Unified", - "presence_column": "ChartOfAccountChartOfAccount_DocumentId" + "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "FiscalYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.fiscalYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "FiscalYear_Unified", + "presence_column": null } } ], @@ -36581,88 +36581,88 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", + "is_nullable": false, + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } }, { - "name": "Amount", + "name": "LocalAccount_AccountIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.amount", + "source_path": "$.localAccountReference.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AsOfDate", + "name": "LocalAccount_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_AccountIdentifier", + "name": "LocalAccount_FiscalYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.localAccountReference.accountIdentifier", + "source_path": "$.localAccountReference.fiscalYear", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_EducationOrganizationId", - "kind": "Scalar", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localAccountReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_FiscalYear", + "name": "Amount", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 19, + "scale": 4 }, "is_nullable": false, - "source_path": "$.localAccountReference.fiscalYear", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -36804,88 +36804,88 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", + "is_nullable": false, + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } }, { - "name": "Amount", + "name": "LocalAccount_AccountIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.amount", + "source_path": "$.localAccountReference.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AsOfDate", + "name": "LocalAccount_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_AccountIdentifier", + "name": "LocalAccount_FiscalYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.localAccountReference.accountIdentifier", + "source_path": "$.localAccountReference.fiscalYear", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_EducationOrganizationId", - "kind": "Scalar", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localAccountReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_FiscalYear", + "name": "Amount", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 19, + "scale": 4 }, "is_nullable": false, - "source_path": "$.localAccountReference.fiscalYear", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -37027,39 +37027,13 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Amount", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 - }, "is_nullable": false, - "source_path": "$.amount", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } @@ -37101,6 +37075,18 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Staff_StaffUniqueId", "kind": "Scalar", @@ -37115,25 +37101,39 @@ } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Amount", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 19, + "scale": 4 + }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -37302,160 +37302,160 @@ } }, { - "name": "CharterStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationServiceCenter_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.charterStatusDescriptor", + "source_path": "$.educationServiceCenterReference", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationServiceCenter_EducationServiceCenterId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.localEducationAgencyCategoryDescriptor", + "is_nullable": true, + "source_path": "$.educationServiceCenterReference.educationServiceCenterId", "storage": { "kind": "Stored" } }, { - "name": "OperationalStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ParentLocalEducationAgency_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.operationalStatusDescriptor", + "source_path": "$.parentLocalEducationAgencyReference", "storage": { "kind": "Stored" } }, { - "name": "EducationServiceCenter_EducationServiceCenterId", + "name": "ParentLocalEducationAgency_LocalEducationAgencyId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": "$.educationServiceCenterReference.educationServiceCenterId", + "source_path": "$.parentLocalEducationAgencyReference.localEducationAgencyId", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyId", - "kind": "Scalar", + "name": "StateEducationAgency_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localEducationAgencyId", + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference", "storage": { "kind": "Stored" } }, { - "name": "NameOfInstitution", + "name": "StateEducationAgency_StateEducationAgencyId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 75 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.nameOfInstitution", + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", "storage": { "kind": "Stored" } }, { - "name": "ParentLocalEducationAgency_LocalEducationAgencyId", - "kind": "Scalar", + "name": "CharterStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.parentLocalEducationAgencyReference.localEducationAgencyId", + "source_path": "$.charterStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ShortNameOfInstitution", - "kind": "Scalar", + "name": "LocalEducationAgencyCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 75 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.shortNameOfInstitution", + "is_nullable": false, + "source_path": "$.localEducationAgencyCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StateEducationAgency_StateEducationAgencyId", - "kind": "Scalar", + "name": "OperationalStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", + "source_path": "$.operationalStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "WebSite", + "name": "LocalEducationAgencyId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.webSite", + "is_nullable": false, + "source_path": "$.localEducationAgencyId", "storage": { "kind": "Stored" } }, { - "name": "EducationServiceCenter_DocumentId", - "kind": "DocumentFk", + "name": "NameOfInstitution", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 75 }, - "is_nullable": true, - "source_path": "$.educationServiceCenterReference", + "is_nullable": false, + "source_path": "$.nameOfInstitution", "storage": { "kind": "Stored" } }, { - "name": "ParentLocalEducationAgency_DocumentId", - "kind": "DocumentFk", + "name": "ShortNameOfInstitution", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 75 }, "is_nullable": true, - "source_path": "$.parentLocalEducationAgencyReference", + "source_path": "$.shortNameOfInstitution", "storage": { "kind": "Stored" } }, { - "name": "StateEducationAgency_DocumentId", - "kind": "DocumentFk", + "name": "WebSite", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.stateEducationAgencyReference", + "source_path": "$.webSite", "storage": { "kind": "Stored" } @@ -37663,49 +37663,49 @@ } }, { - "name": "GunFreeSchoolsActReportingStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalEducationAgencyAccountabilitySchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.accountabilities[*].gunFreeSchoolsActReportingStatusDescriptor", + "is_nullable": false, + "source_path": "$.accountabilities[*].schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoiceImplementStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalEducationAgencyAccountabilitySchoolYear_SchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.accountabilities[*].schoolChoiceImplementStatusDescriptor", + "is_nullable": false, + "source_path": "$.accountabilities[*].schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyAccountabilitySchoolYear_SchoolYear", - "kind": "Scalar", + "name": "GunFreeSchoolsActReportingStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.accountabilities[*].schoolYearTypeReference.schoolYear", + "is_nullable": true, + "source_path": "$.accountabilities[*].gunFreeSchoolsActReportingStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyAccountabilitySchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "SchoolChoiceImplementStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.accountabilities[*].schoolYearTypeReference", + "is_nullable": true, + "source_path": "$.accountabilities[*].schoolChoiceImplementStatusDescriptor", "storage": { "kind": "Stored" } @@ -39511,88 +39511,88 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", + "is_nullable": false, + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } }, { - "name": "Amount", + "name": "LocalAccount_AccountIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.amount", + "source_path": "$.localAccountReference.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AsOfDate", + "name": "LocalAccount_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_AccountIdentifier", + "name": "LocalAccount_FiscalYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.localAccountReference.accountIdentifier", + "source_path": "$.localAccountReference.fiscalYear", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_EducationOrganizationId", - "kind": "Scalar", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localAccountReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_FiscalYear", + "name": "Amount", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 19, + "scale": 4 }, "is_nullable": false, - "source_path": "$.localAccountReference.fiscalYear", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -39734,39 +39734,13 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Amount", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 - }, - "is_nullable": false, - "source_path": "$.amount", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } @@ -39808,6 +39782,18 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Staff_StaffUniqueId", "kind": "Scalar", @@ -39822,25 +39808,39 @@ } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Amount", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 19, + "scale": 4 + }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -40029,62 +40029,62 @@ } }, { - "name": "ClassroomIdentificationCode", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.classroomIdentificationCode", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "MaximumNumberOfSeats", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.maximumNumberOfSeats", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "OptimalNumberOfSeats", + "name": "ClassroomIdentificationCode", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.optimalNumberOfSeats", + "is_nullable": false, + "source_path": "$.classroomIdentificationCode", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "MaximumNumberOfSeats", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "is_nullable": true, + "source_path": "$.maximumNumberOfSeats", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "OptimalNumberOfSeats", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.optimalNumberOfSeats", "storage": { "kind": "Stored" } @@ -40631,23 +40631,24 @@ } }, { - "name": "AcademicSubjectDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AssessmentIdentifier_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.academicSubjectDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "AssessmentIdentifier_Unified", + "name": "Namespace_Unified", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, "source_path": null, @@ -40656,180 +40657,179 @@ } }, { - "name": "Description", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.description", + "is_nullable": false, + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } }, { - "name": "IdentificationCode", + "name": "Assessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.identificationCode", + "source_path": "$.assessmentReference.assessmentIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "Assessment_DocumentId" } }, { - "name": "MaxRawScore", + "name": "Assessment_Namespace", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 15, - "scale": 5 + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.maxRawScore", + "is_nullable": false, + "source_path": "$.assessmentReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "Assessment_DocumentId" } }, { - "name": "Namespace_Unified", - "kind": "Scalar", + "name": "ParentObjectiveAssessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.parentObjectiveAssessmentReference", "storage": { "kind": "Stored" } }, { - "name": "Nomenclature", + "name": "ParentObjectiveAssessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 100 + "max_length": 60 }, "is_nullable": true, - "source_path": "$.nomenclature", + "source_path": "$.parentObjectiveAssessmentReference.assessmentIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "ParentObjectiveAssessment_DocumentId" } }, { - "name": "ParentObjectiveAssessment_IdentificationCode", + "name": "ParentObjectiveAssessment_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference.identificationCode", + "source_path": "$.parentObjectiveAssessmentReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "ParentObjectiveAssessment_DocumentId" } }, { - "name": "PercentOfAssessment", + "name": "ParentObjectiveAssessment_IdentificationCode", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.percentOfAssessment", + "source_path": "$.parentObjectiveAssessmentReference.identificationCode", "storage": { "kind": "Stored" } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AcademicSubjectDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.assessmentReference", + "is_nullable": true, + "source_path": "$.academicSubjectDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Assessment_AssessmentIdentifier", + "name": "Description", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.assessmentReference.assessmentIdentifier", + "is_nullable": true, + "source_path": "$.description", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", - "presence_column": "Assessment_DocumentId" + "kind": "Stored" } }, { - "name": "Assessment_Namespace", + "name": "IdentificationCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.assessmentReference.namespace", + "source_path": "$.identificationCode", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "Assessment_DocumentId" + "kind": "Stored" } }, { - "name": "ParentObjectiveAssessment_DocumentId", - "kind": "DocumentFk", + "name": "MaxRawScore", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 15, + "scale": 5 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference", + "source_path": "$.maxRawScore", "storage": { "kind": "Stored" } }, { - "name": "ParentObjectiveAssessment_AssessmentIdentifier", + "name": "Nomenclature", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 100 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference.assessmentIdentifier", + "source_path": "$.nomenclature", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", - "presence_column": "ParentObjectiveAssessment_DocumentId" + "kind": "Stored" } }, { - "name": "ParentObjectiveAssessment_Namespace", + "name": "PercentOfAssessment", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Decimal", + "precision": 5, + "scale": 4 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference.namespace", + "source_path": "$.percentOfAssessment", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "ParentObjectiveAssessment_DocumentId" + "kind": "Stored" } } ], @@ -41004,27 +41004,26 @@ } }, { - "name": "AssessmentItemAssessmentItem_AssessmentIdentifier", - "kind": "Scalar", + "name": "AssessmentItemAssessmentItem_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.assessmentItems[*].assessmentItemReference.assessmentIdentifier", + "source_path": "$.assessmentItems[*].assessmentItemReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentItemAssessmentItem_IdentificationCode", + "name": "AssessmentItemAssessmentItem_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.assessmentItems[*].assessmentItemReference.identificationCode", + "source_path": "$.assessmentItems[*].assessmentItemReference.assessmentIdentifier", "storage": { "kind": "Stored" } @@ -41043,13 +41042,14 @@ } }, { - "name": "AssessmentItemAssessmentItem_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentItemAssessmentItem_IdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.assessmentItems[*].assessmentItemReference", + "source_path": "$.assessmentItems[*].assessmentItemReference.identificationCode", "storage": { "kind": "Stored" } @@ -41148,26 +41148,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -41751,6 +41751,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "EmploymentStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -41823,18 +41847,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "PositionTitle", "kind": "Scalar", @@ -41860,18 +41872,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -42562,6 +42562,30 @@ "kind": "Stored" } }, + { + "name": "ParentEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.parentEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ParentEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.parentEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "AcademicSubjectDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -42611,18 +42635,6 @@ "kind": "Stored" } }, - { - "name": "ParentEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.parentEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "ShortNameOfInstitution", "kind": "Scalar", @@ -42648,18 +42660,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ParentEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.parentEducationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -44527,37 +44527,37 @@ } }, { - "name": "PostSecondaryEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "PostSecondaryInstitution_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.postSecondaryEventCategoryDescriptor", + "is_nullable": true, + "source_path": "$.postSecondaryInstitutionReference", "storage": { "kind": "Stored" } }, { - "name": "EventDate", + "name": "PostSecondaryInstitution_PostSecondaryInstitutionId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.eventDate", + "is_nullable": true, + "source_path": "$.postSecondaryInstitutionReference.postSecondaryInstitutionId", "storage": { "kind": "Stored" } }, { - "name": "PostSecondaryInstitution_PostSecondaryInstitutionId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.postSecondaryInstitutionReference.postSecondaryInstitutionId", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -44576,25 +44576,25 @@ } }, { - "name": "PostSecondaryInstitution_DocumentId", - "kind": "DocumentFk", + "name": "PostSecondaryEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.postSecondaryInstitutionReference", + "is_nullable": false, + "source_path": "$.postSecondaryEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EventDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } @@ -46904,10 +46904,10 @@ } }, { - "name": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEducationOrganizationId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, "source_path": null, @@ -46916,7 +46916,7 @@ } }, { - "name": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "name": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" @@ -46928,10 +46928,11 @@ } }, { - "name": "ProgramTypeDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluationTitle_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, "source_path": null, @@ -46940,50 +46941,35 @@ } }, { - "name": "ElementMaxNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.elementMaxNumericRating", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ElementMinNumericRating", - "kind": "Scalar", + "name": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.elementMinNumericRating", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ElementSortOrder", + "name": "ProgramName_Unified", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.elementSortOrder", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ProgramEducationOrganizationId_Unified", - "kind": "Scalar", + "name": "ProgramTypeDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, "source_path": null, @@ -46992,27 +46978,13 @@ } }, { - "name": "ProgramEvaluationElementDescription", - "kind": "Scalar", + "name": "ProgramEvaluationObjective_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationElementDescription", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationElementTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationElementTitle", + "source_path": "$.programEvaluationObjectiveReference", "storage": { "kind": "Stored" } @@ -47031,41 +47003,17 @@ } }, { - "name": "ProgramEvaluationTitle_Unified", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramName_Unified", + "name": "ProgramEvaluationObjective_ProgramEducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationObjective_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference", + "source_path": "$.programEvaluationObjectiveReference.programEducationOrganizationId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "ProgramEducationOrganizationId_Unified", + "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { @@ -47083,74 +47031,60 @@ } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationTypeDesc_513b5067cb", - "kind": "DescriptorFk", + "name": "ProgramEvaluationObjective_ProgramEvaluationTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationTitle", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTitle_Unified", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluationObjective_ProgramEvaluationTypeDesc_513b5067cb", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programTypeDescriptor", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", - "presence_column": "ProgramEvaluationObjective_DocumentId" - } - }, - { - "name": "ProgramEvaluationObjective_ProgramEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEducationOrganizationId", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEducationOrganizationId_Unified", + "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationTitle", + "name": "ProgramEvaluationObjective_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationTitle", + "source_path": "$.programEvaluationObjectiveReference.programName", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTitle_Unified", + "canonical_column": "ProgramName_Unified", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramName", - "kind": "Scalar", + "name": "ProgramEvaluationObjective_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programName", + "source_path": "$.programEvaluationObjectiveReference.programTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramName_Unified", + "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, @@ -47181,30 +47115,31 @@ } }, { - "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationReference.programEvaluationTitle", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTitle_Unified", "presence_column": "ProgramEvaluation_DocumentId" } }, { - "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programTypeDescriptor", + "source_path": "$.programEvaluationReference.programEvaluationTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluation_DocumentId" } }, @@ -47223,34 +47158,99 @@ } }, { - "name": "ProgramEvaluation_ProgramEvaluationTitle", + "name": "ProgramEvaluation_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", + "source_path": "$.programEvaluationReference.programName", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTitle_Unified", + "canonical_column": "ProgramName_Unified", "presence_column": "ProgramEvaluation_DocumentId" } }, { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", + "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", + "source_path": "$.programEvaluationReference.programTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramName_Unified", + "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluation_DocumentId" } + }, + { + "name": "ElementMaxNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.elementMaxNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ElementMinNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.elementMinNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ElementSortOrder", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.elementSortOrder", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationElementDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.programEvaluationElementDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationElementTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationElementTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -47825,6 +47825,18 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", "kind": "DescriptorFk", @@ -47837,6 +47849,19 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEvaluationTitle", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -47849,6 +47874,31 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEducationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluation_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programName", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -47926,56 +47976,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ProgramEvaluation_ProgramEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramEvaluationTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -48373,91 +48373,13 @@ } }, { - "name": "ProgramEvaluationPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationPeriodDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EvaluationMaxNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.evaluationMaxNumericRating", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EvaluationMinNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.evaluationMinNumericRating", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationDescription", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.programEvaluationDescription", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationTitle", + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -48488,13 +48410,91 @@ } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference", + "source_path": "$.programReference.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationPeriodDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EvaluationMaxNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.evaluationMaxNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EvaluationMinNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.evaluationMinNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.programEvaluationDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationTitle", "storage": { "kind": "Stored" } @@ -48887,13 +48887,13 @@ } }, { - "name": "ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -48910,6 +48910,18 @@ "kind": "Stored" } }, + { + "name": "ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramId", "kind": "Scalar", @@ -48935,18 +48947,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -49168,26 +49168,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -49934,13 +49934,13 @@ } }, { - "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -49958,78 +49958,74 @@ } }, { - "name": "GradingPeriodGradingPeriod_GradingPeriodName", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodName", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_SchoolId", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.schoolId", + "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_SchoolYear", + "name": "GradingPeriodGradingPeriod_GradingPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.schoolYear", + "source_path": "$.gradingPeriodReference.gradingPeriodName", "storage": { "kind": "Stored" } }, { - "name": "NumberOfDaysAbsent", + "name": "GradingPeriodGradingPeriod_SchoolId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 18, - "scale": 4 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.numberOfDaysAbsent", + "is_nullable": false, + "source_path": "$.gradingPeriodReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "NumberOfDaysInAttendance", + "name": "GradingPeriodGradingPeriod_SchoolYear", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 18, - "scale": 4 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.numberOfDaysInAttendance", + "is_nullable": false, + "source_path": "$.gradingPeriodReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "NumberOfDaysTardy", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.numberOfDaysTardy", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -50048,37 +50044,41 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "NumberOfDaysAbsent", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 18, + "scale": 4 }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.numberOfDaysAbsent", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_DocumentId", - "kind": "DocumentFk", + "name": "NumberOfDaysInAttendance", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 18, + "scale": 4 }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference", + "is_nullable": true, + "source_path": "$.numberOfDaysInAttendance", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "NumberOfDaysTardy", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.numberOfDaysTardy", "storage": { "kind": "Stored" } @@ -50407,37 +50407,37 @@ } }, { - "name": "Grade_GradeTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Grade_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.grades[*].gradeReference.gradeTypeDescriptor", + "source_path": "$.grades[*].gradeReference", "storage": { "kind": "Stored" } }, { - "name": "Grade_GradingPeriodDescriptor_DescriptorId", + "name": "Grade_GradeTypeDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.grades[*].gradeReference.gradingPeriodDescriptor", + "source_path": "$.grades[*].gradeReference.gradeTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Grade_BeginDate", - "kind": "Scalar", + "name": "Grade_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.grades[*].gradeReference.beginDate", + "source_path": "$.grades[*].gradeReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } @@ -50479,6 +50479,18 @@ "kind": "Stored" } }, + { + "name": "Grade_BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.grades[*].gradeReference.beginDate", + "storage": { + "kind": "Stored" + } + }, { "name": "Grade_LocalCourseCode", "kind": "Scalar", @@ -50492,6 +50504,18 @@ "kind": "Stored" } }, + { + "name": "Grade_StudentSectionAssociationReferenceSchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.grades[*].gradeReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "Grade_SchoolYear", "kind": "Scalar", @@ -50530,18 +50554,6 @@ "kind": "Stored" } }, - { - "name": "Grade_StudentSectionAssociationReferenceSchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.grades[*].gradeReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "Grade_StudentUniqueId", "kind": "Scalar", @@ -50554,18 +50566,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Grade_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.grades[*].gradeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -50720,25 +50720,25 @@ } }, { - "name": "StudentCompetencyObjective_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentCompetencyObjective_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.gradingPeriodDescriptor", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_ObjectiveGradeLevelDescri_16507c4e9d", + "name": "StudentCompetencyObjective_GradingPeriodDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveGradeLevelDescriptor", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } @@ -50781,51 +50781,51 @@ } }, { - "name": "StudentCompetencyObjective_Objective", + "name": "StudentCompetencyObjective_ObjectiveEducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objective", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_ObjectiveEducationOrganizationId", + "name": "StudentCompetencyObjective_Objective", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveEducationOrganizationId", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objective", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_StudentUniqueId", - "kind": "Scalar", + "name": "StudentCompetencyObjective_ObjectiveGradeLevelDescri_16507c4e9d", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.studentUniqueId", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_DocumentId", - "kind": "DocumentFk", + "name": "StudentCompetencyObjective_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -51368,13 +51368,25 @@ } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } @@ -51393,38 +51405,53 @@ } }, { - "name": "EventDate", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.eventDate", + "is_nullable": true, + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "DisciplineIncident_DocumentId" } }, { - "name": "RestraintEventIdentifier", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.restraintEventIdentifier", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -51443,65 +51470,38 @@ } }, { - "name": "DisciplineIncident_DocumentId", - "kind": "DocumentFk", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.educationalEnvironmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", + "name": "EventDate", "kind": "Scalar", "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.disciplineIncidentReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "DisciplineIncident_DocumentId" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "RestraintEventIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "kind": "String", + "max_length": 36 }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.restraintEventIdentifier", "storage": { "kind": "Stored" } @@ -51682,13 +51682,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -51719,13 +51719,13 @@ } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -52251,6 +52251,54 @@ "kind": "Stored" } }, + { + "name": "CharterApprovalSchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.charterApprovalSchoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CharterApprovalSchoolYear_CharterApprovalSchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.charterApprovalSchoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalEducationAgency_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.localEducationAgencyReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalEducationAgency_LocalEducationAgencyId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.localEducationAgencyReference.localEducationAgencyId", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrativeFundingControlDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -52347,30 +52395,6 @@ "kind": "Stored" } }, - { - "name": "CharterApprovalSchoolYear_CharterApprovalSchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.charterApprovalSchoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalEducationAgency_LocalEducationAgencyId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.localEducationAgencyReference.localEducationAgencyId", - "storage": { - "kind": "Stored" - } - }, { "name": "NameOfInstitution", "kind": "Scalar", @@ -52421,30 +52445,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CharterApprovalSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.charterApprovalSchoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalEducationAgency_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.localEducationAgencyReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -54442,206 +54442,206 @@ } }, { - "name": "CalendarDate_CalendarCode", + "name": "SchoolId_Unified", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.calendarCode", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "CalendarDate_Date", + "name": "SchoolYear_Unified", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.date", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "CalendarDate_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.calendarDateReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "CalendarDate_CalendarCode", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": null, + "source_path": "$.calendarDateReference.calendarCode", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_Unified", + "name": "CalendarDate_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.calendarDateReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "CalendarDate_DocumentId" } }, { - "name": "Section_LocalCourseCode", + "name": "CalendarDate_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.sectionReference.localCourseCode", + "source_path": "$.calendarDateReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "CalendarDate_DocumentId" } }, { - "name": "Section_SectionIdentifier", + "name": "CalendarDate_Date", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sectionReference.sectionIdentifier", + "source_path": "$.calendarDateReference.date", "storage": { "kind": "Stored" } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } }, { - "name": "Staff_StaffUniqueId", + "name": "Section_LocalCourseCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CalendarDate_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "max_length": 60 }, "is_nullable": false, - "source_path": "$.calendarDateReference", + "source_path": "$.sectionReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "CalendarDate_SchoolId", + "name": "Section_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.schoolId", + "source_path": "$.sectionReference.schoolId", "storage": { "kind": "UnifiedAlias", "canonical_column": "SchoolId_Unified", - "presence_column": "CalendarDate_DocumentId" + "presence_column": "Section_DocumentId" } }, { - "name": "CalendarDate_SchoolYear", + "name": "Section_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.schoolYear", + "source_path": "$.sectionReference.schoolYear", "storage": { "kind": "UnifiedAlias", "canonical_column": "SchoolYear_Unified", - "presence_column": "CalendarDate_DocumentId" + "presence_column": "Section_DocumentId" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Section_SessionName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.sectionReference", + "source_path": "$.sectionReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolId", + "name": "Section_SectionIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.sectionReference.schoolId", + "source_path": "$.sectionReference.sectionIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" } }, { - "name": "Section_SchoolYear", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.schoolYear", + "is_nullable": true, + "source_path": "$.staffReference", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "Staff_StaffUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.staffReference", + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.eventDate", "storage": { "kind": "Stored" } @@ -54898,101 +54898,25 @@ } }, { - "name": "AvailableCreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.availableCreditTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "InstructionLanguageDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.instructionLanguageDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MediumOfInstructionDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.mediumOfInstructionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PopulationServedDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.populationServedDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SectionTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.sectionTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AvailableCreditConversion", + "name": "SchoolId_Unified", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.availableCreditConversion", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "AvailableCredits", - "kind": "Scalar", + "name": "CourseOffering_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 3 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.availableCredits", + "is_nullable": false, + "source_path": "$.courseOfferingReference", "storage": { "kind": "Stored" } @@ -55022,31 +54946,6 @@ "kind": "Stored" } }, - { - "name": "CourseOffering_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.courseOfferingReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CourseOffering_SessionName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.courseOfferingReference.sessionName", - "storage": { - "kind": "Stored" - } - }, { "name": "CourseOffering_SessionReferenceSchoolId", "kind": "Scalar", @@ -55060,100 +54959,51 @@ } }, { - "name": "LocationLocation_ClassroomIdentificationCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.locationReference.classroomIdentificationCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "OfficialAttendancePeriod", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.officialAttendancePeriod", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolId_Unified", + "name": "CourseOffering_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, "is_nullable": false, - "source_path": "$.sectionIdentifier", + "source_path": "$.courseOfferingReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "SectionName", + "name": "CourseOffering_SessionName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 100 - }, - "is_nullable": true, - "source_path": "$.sectionName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SequenceOfCourse", - "kind": "Scalar", - "type": { - "kind": "Int32" + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.sequenceOfCourse", + "is_nullable": false, + "source_path": "$.courseOfferingReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "CourseOffering_DocumentId", + "name": "LocationLocation_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.courseOfferingReference", + "is_nullable": true, + "source_path": "$.locationReference", "storage": { "kind": "Stored" } }, { - "name": "LocationLocation_DocumentId", - "kind": "DocumentFk", + "name": "LocationLocation_ClassroomIdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.locationReference", + "source_path": "$.locationReference.classroomIdentificationCode", "storage": { "kind": "Stored" } @@ -55197,6 +55047,156 @@ "canonical_column": "SchoolId_Unified", "presence_column": "LocationSchool_DocumentId" } + }, + { + "name": "AvailableCreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.availableCreditTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "InstructionLanguageDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.instructionLanguageDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MediumOfInstructionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.mediumOfInstructionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PopulationServedDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.populationServedDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sectionTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AvailableCreditConversion", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.availableCreditConversion", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AvailableCredits", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.availableCredits", + "storage": { + "kind": "Stored" + } + }, + { + "name": "OfficialAttendancePeriod", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.officialAttendancePeriod", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.sectionIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": true, + "source_path": "$.sectionName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SequenceOfCourse", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.sequenceOfCourse", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -55574,38 +55574,38 @@ } }, { - "name": "ClassPeriod_ClassPeriodName", - "kind": "Scalar", + "name": "ClassPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", + "source_path": "$.classPeriods[*].classPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_SchoolId", + "name": "ClassPeriod_ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.schoolId", + "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_DocumentId", - "kind": "DocumentFk", + "name": "ClassPeriod_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference", + "source_path": "$.classPeriods[*].classPeriodReference.schoolId", "storage": { "kind": "Stored" } @@ -55895,13 +55895,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -55932,13 +55932,13 @@ } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -56283,110 +56283,110 @@ } }, { - "name": "TermDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.termDescriptor", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.endDate", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", - "kind": "Scalar", + "name": "TermDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.termDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SessionName", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sessionName", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "TotalInstructionalDays", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.totalInstructionalDays", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "SessionName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.sessionName", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "TotalInstructionalDays", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.totalInstructionalDays", "storage": { "kind": "Stored" } @@ -56540,38 +56540,38 @@ } }, { - "name": "AcademicWeek_SchoolId", - "kind": "Scalar", + "name": "AcademicWeek_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.academicWeeks[*].academicWeekReference.schoolId", + "source_path": "$.academicWeeks[*].academicWeekReference", "storage": { "kind": "Stored" } }, { - "name": "AcademicWeek_WeekIdentifier", + "name": "AcademicWeek_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 80 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.academicWeeks[*].academicWeekReference.weekIdentifier", + "source_path": "$.academicWeeks[*].academicWeekReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "AcademicWeek_DocumentId", - "kind": "DocumentFk", + "name": "AcademicWeek_WeekIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 80 }, "is_nullable": true, - "source_path": "$.academicWeeks[*].academicWeekReference", + "source_path": "$.academicWeeks[*].academicWeekReference.weekIdentifier", "storage": { "kind": "Stored" } @@ -56666,6 +56666,18 @@ "kind": "Stored" } }, + { + "name": "GradingPeriod_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.gradingPeriods[*].gradingPeriodReference", + "storage": { + "kind": "Stored" + } + }, { "name": "GradingPeriod_GradingPeriodDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -56714,18 +56726,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "GradingPeriod_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.gradingPeriods[*].gradingPeriodReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -57264,77 +57264,77 @@ } }, { - "name": "AbsenceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.absenceEventCategoryDescriptor", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "AbsenceEventReason", + "name": "Staff_StaffUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 40 + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.absenceEventReason", + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "AbsenceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.absenceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "HoursAbsent", + "name": "AbsenceEventReason", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 18, - "scale": 2 + "kind": "String", + "max_length": 40 }, "is_nullable": true, - "source_path": "$.hoursAbsent", + "source_path": "$.absenceEventReason", "storage": { "kind": "Stored" } }, { - "name": "Staff_StaffUniqueId", + "name": "EventDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "HoursAbsent", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 18, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.hoursAbsent", "storage": { "kind": "Stored" } @@ -57491,13 +57491,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "Cohort_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.cohortReference", "storage": { "kind": "Stored" } @@ -57528,13 +57528,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.staffReference", "storage": { "kind": "Stored" } @@ -57553,37 +57553,37 @@ } }, { - "name": "StudentRecordAccess", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.studentRecordAccess", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Cohort_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.cohortReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "StudentRecordAccess", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.studentRecordAccess", "storage": { "kind": "Stored" } @@ -57719,63 +57719,63 @@ } }, { - "name": "DisciplineIncident_IncidentIdentifier", - "kind": "Scalar", + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.incidentIdentifier", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", + "name": "DisciplineIncident_IncidentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 36 }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.schoolId", + "source_path": "$.disciplineIncidentReference.incidentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Staff_StaffUniqueId", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_DocumentId", + "name": "Staff_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "Staff_StaffUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } @@ -58021,49 +58021,26 @@ } }, { - "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StaffUniqueId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.credentialReference.stateOfIssueStateAbbreviationDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_48a7f76b56", - "kind": "DescriptorFk", + "name": "Credential_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.employmentStatusDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffClassificationDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffClassificationDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.credentialReference", "storage": { "kind": "Stored" } @@ -58082,137 +58059,85 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_0cbe1eb337", - "kind": "Scalar", + "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.hireDate", + "source_path": "$.credentialReference.stateOfIssueStateAbbreviationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_af1202f2de", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "FullTimeEquivalency", - "kind": "Scalar", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_7a3d86aa2b", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.fullTimeEquivalency", + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "OrderOfAssignment", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_af1202f2de", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": "$.orderOfAssignment", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PositionTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 100 - }, - "is_nullable": true, - "source_path": "$.positionTitle", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffUniqueId_Unified", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": null, + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "Credential_DocumentId", - "kind": "DocumentFk", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_48a7f76b56", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.credentialReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.employmentStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_7a3d86aa2b", - "kind": "DocumentFk", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_0cbe1eb337", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference", + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.hireDate", "storage": { "kind": "Stored" } @@ -58258,6 +58183,81 @@ "canonical_column": "StaffUniqueId_Unified", "presence_column": "Staff_DocumentId" } + }, + { + "name": "StaffClassificationDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffClassificationDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.endDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "FullTimeEquivalency", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 5, + "scale": 4 + }, + "is_nullable": true, + "source_path": "$.fullTimeEquivalency", + "storage": { + "kind": "Stored" + } + }, + { + "name": "OrderOfAssignment", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.orderOfAssignment", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PositionTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": true, + "source_path": "$.positionTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -58559,6 +58559,55 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "AddressAddressTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -58762,18 +58811,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "ElectronicMailAddress", "kind": "Scalar", @@ -58786,43 +58823,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -59321,6 +59321,31 @@ "kind": "Stored" } }, + { + "name": "Credential_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.credentialReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Credential_CredentialIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.credentialReference.credentialIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -59333,6 +59358,55 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "EmploymentStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -59383,19 +59457,6 @@ "kind": "Stored" } }, - { - "name": "Credential_CredentialIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.credentialReference.credentialIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Department", "kind": "Scalar", @@ -59409,18 +59470,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "EndDate", "kind": "Scalar", @@ -59484,55 +59533,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Credential_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.credentialReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -59859,6 +59859,31 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "StaffLeaveEventCategoryDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -59908,19 +59933,6 @@ "kind": "Stored" } }, - { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "SubstituteAssigned", "kind": "Scalar", @@ -59932,18 +59944,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -60077,62 +60077,62 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programName", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } @@ -60151,37 +60151,37 @@ } }, { - "name": "StudentRecordAccess", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.studentRecordAccess", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "StudentRecordAccess", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.studentRecordAccess", "storage": { "kind": "Stored" } @@ -60349,31 +60349,6 @@ "kind": "Stored" } }, - { - "name": "ProgramAssignmentDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programAssignmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Calendar_CalendarCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.calendarReference.calendarCode", - "storage": { - "kind": "Stored" - } - }, { "name": "SchoolId_Unified", "kind": "Scalar", @@ -60399,26 +60374,26 @@ } }, { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", + "name": "Calendar_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "is_nullable": true, + "source_path": "$.calendarReference", "storage": { "kind": "Stored" } }, { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", + "name": "Calendar_CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.calendarReference", + "source_path": "$.calendarReference.calendarCode", "storage": { "kind": "Stored" } @@ -60514,6 +60489,31 @@ "storage": { "kind": "Stored" } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramAssignmentDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programAssignmentDescriptor", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -60989,63 +60989,13 @@ } }, { - "name": "ClassroomPositionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.classroomPositionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.beginDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EndDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.endDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "HighlyQualifiedTeacher", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.highlyQualifiedTeacher", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PercentageContribution", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 - }, - "is_nullable": true, - "source_path": "$.percentageContribution", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } @@ -61087,6 +61037,19 @@ "kind": "Stored" } }, + { + "name": "Section_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.sectionReference.sessionName", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_SectionIdentifier", "kind": "Scalar", @@ -61101,14 +61064,13 @@ } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } @@ -61127,37 +61089,75 @@ } }, { - "name": "TeacherStudentDataLinkExclusion", + "name": "ClassroomPositionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.classroomPositionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.endDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "HighlyQualifiedTeacher", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.teacherStudentDataLinkExclusion", + "source_path": "$.highlyQualifiedTeacher", "storage": { "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "PercentageContribution", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 5, + "scale": 4 }, - "is_nullable": false, - "source_path": "$.sectionReference", + "is_nullable": true, + "source_path": "$.percentageContribution", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "TeacherStudentDataLinkExclusion", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.teacherStudentDataLinkExclusion", "storage": { "kind": "Stored" } @@ -61332,37 +61332,62 @@ } }, { - "name": "CitizenshipStatusDescriptor_DescriptorId", + "name": "Person_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.personReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_PersonId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.personReference.personId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_SourceSystemDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.citizenshipStatusDescriptor", + "source_path": "$.personReference.sourceSystemDescriptor", "storage": { "kind": "Stored" } }, { - "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", + "name": "CitizenshipStatusDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.highestCompletedLevelOfEducationDescriptor", + "source_path": "$.citizenshipStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Person_SourceSystemDescriptor_DescriptorId", + "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.personReference.sourceSystemDescriptor", + "source_path": "$.highestCompletedLevelOfEducationDescriptor", "storage": { "kind": "Stored" } @@ -61506,19 +61531,6 @@ "kind": "Stored" } }, - { - "name": "Person_PersonId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.personReference.personId", - "storage": { - "kind": "Stored" - } - }, { "name": "PersonalTitlePrefix", "kind": "Scalar", @@ -61598,18 +61610,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Person_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.personReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -62177,13 +62177,13 @@ } }, { - "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Credential_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.credentials[*].credentialReference.stateOfIssueStateAbbreviationDescriptor", + "source_path": "$.credentials[*].credentialReference", "storage": { "kind": "Stored" } @@ -62202,13 +62202,13 @@ } }, { - "name": "Credential_DocumentId", - "kind": "DocumentFk", + "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.credentials[*].credentialReference", + "source_path": "$.credentials[*].credentialReference.stateOfIssueStateAbbreviationDescriptor", "storage": { "kind": "Stored" } @@ -64951,13 +64951,13 @@ } }, { - "name": "CteGraduationRateInclusion", - "kind": "Scalar", + "name": "StateEducationAgencyAccountabilitySchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.accountabilities[*].cteGraduationRateInclusion", + "is_nullable": false, + "source_path": "$.accountabilities[*].schoolYearTypeReference", "storage": { "kind": "Stored" } @@ -64975,13 +64975,13 @@ } }, { - "name": "StateEducationAgencyAccountabilitySchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "CteGraduationRateInclusion", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.accountabilities[*].schoolYearTypeReference", + "is_nullable": true, + "source_path": "$.accountabilities[*].cteGraduationRateInclusion", "storage": { "kind": "Stored" } @@ -66584,6 +66584,79 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "CumulativeAttemptedCreditTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -66748,18 +66821,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "ProjectedGraduationDate", "kind": "Scalar", @@ -66772,18 +66833,6 @@ "kind": "Stored" } }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, { "name": "SessionAttemptedCreditConversion", "kind": "Scalar", @@ -66839,55 +66888,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -68107,13 +68107,13 @@ } }, { - "name": "ReportCard_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ReportCard_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.reportCards[*].reportCardReference.gradingPeriodDescriptor", + "source_path": "$.reportCards[*].reportCardReference", "storage": { "kind": "Stored" } @@ -68130,6 +68130,18 @@ "kind": "Stored" } }, + { + "name": "ReportCard_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.reportCards[*].reportCardReference.gradingPeriodDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ReportCard_GradingPeriodName", "kind": "Scalar", @@ -68179,18 +68191,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ReportCard_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.reportCards[*].reportCardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -68540,13 +68540,13 @@ } }, { - "name": "EducationOrganizationAssociationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationAssociationTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -68563,6 +68563,18 @@ "kind": "Stored" } }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, { "name": "SchoolYear_SchoolYear", "kind": "Scalar", @@ -68575,6 +68587,18 @@ "kind": "Stored" } }, + { + "name": "StudentAssessment_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentAssessmentReference", + "storage": { + "kind": "Stored" + } + }, { "name": "StudentAssessment_AssessmentIdentifier", "kind": "Scalar", @@ -68628,37 +68652,13 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAssessment_DocumentId", - "kind": "DocumentFk", + "name": "EducationOrganizationAssociationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentAssessmentReference", + "source_path": "$.educationOrganizationAssociationTypeDescriptor", "storage": { "kind": "Stored" } @@ -68855,19 +68855,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentBatteryPart_AssessmentBatteryPartName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 65 - }, - "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference.assessmentBatteryPartName", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentIdentifier_Unified", "kind": "Scalar", @@ -68895,137 +68882,150 @@ } }, { - "name": "StudentAssessmentRegistration_AdministrationIdentifier", - "kind": "Scalar", + "name": "AssessmentBatteryPart_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.administrationIdentifier", + "source_path": "$.assessmentBatteryPartReference", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentRegistration_AssigningEducationOrganizationId", + "name": "AssessmentBatteryPart_AssessmentBatteryPartName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 65 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.assigningEducationOrganizationId", + "source_path": "$.assessmentBatteryPartReference.assessmentBatteryPartName", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentRegistration_EducationOrganizationId", + "name": "AssessmentBatteryPart_AssessmentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.educationOrganizationId", + "source_path": "$.assessmentBatteryPartReference.assessmentIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "AssessmentBatteryPart_DocumentId" } }, { - "name": "StudentAssessmentRegistration_StudentUniqueId", + "name": "AssessmentBatteryPart_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.studentUniqueId", + "source_path": "$.assessmentBatteryPartReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "AssessmentBatteryPart_DocumentId" } }, { - "name": "AssessmentBatteryPart_DocumentId", + "name": "StudentAssessmentRegistration_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference", + "source_path": "$.studentAssessmentRegistrationReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentBatteryPart_AssessmentIdentifier", + "name": "StudentAssessmentRegistration_AdministrationIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference.assessmentIdentifier", + "source_path": "$.studentAssessmentRegistrationReference.administrationIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", - "presence_column": "AssessmentBatteryPart_DocumentId" + "kind": "Stored" } }, { - "name": "AssessmentBatteryPart_Namespace", + "name": "StudentAssessmentRegistration_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference.namespace", + "source_path": "$.studentAssessmentRegistrationReference.assessmentIdentifier", "storage": { "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "AssessmentBatteryPart_DocumentId" + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "StudentAssessmentRegistration_DocumentId" } }, { - "name": "StudentAssessmentRegistration_DocumentId", - "kind": "DocumentFk", + "name": "StudentAssessmentRegistration_AssigningEducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference", + "source_path": "$.studentAssessmentRegistrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentRegistration_AssessmentIdentifier", + "name": "StudentAssessmentRegistration_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.assessmentIdentifier", + "source_path": "$.studentAssessmentRegistrationReference.namespace", "storage": { "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", + "canonical_column": "Namespace_Unified", "presence_column": "StudentAssessmentRegistration_DocumentId" } }, { - "name": "StudentAssessmentRegistration_Namespace", + "name": "StudentAssessmentRegistration_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.studentAssessmentRegistrationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAssessmentRegistration_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.namespace", + "source_path": "$.studentAssessmentRegistrationReference.studentUniqueId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "StudentAssessmentRegistration_DocumentId" + "kind": "Stored" } } ], @@ -69325,25 +69325,26 @@ } }, { - "name": "AssessmentGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentUniqueId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.assessmentGradeLevelDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "PlatformTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AssessmentAdministration_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.platformTypeDescriptor", + "is_nullable": false, + "source_path": "$.assessmentAdministrationReference", "storage": { "kind": "Stored" } @@ -69374,18 +69375,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentAdministration_AssigningEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentAdministration_Namespace", "kind": "Scalar", @@ -69400,201 +69389,212 @@ } }, { - "name": "ReportingEducationOrganization_EducationOrganizationId", + "name": "AssessmentAdministration_AssigningEducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reportingEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_42c01c7c2c", - "kind": "Scalar", + "name": "ReportingEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", + "source_path": "$.reportingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_44578471b1", + "name": "ReportingEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", + "source_path": "$.reportingEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_EducationOrganizationId", - "kind": "Scalar", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_8a1ccd30ea", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_EntryDate", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_42c01c7c2c", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.entryDate", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_SchoolId", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_44578471b1", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.schoolId", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "StudentUniqueId_Unified", - "kind": "Scalar", + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.studentEducationOrganizationAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "TestingEducationOrganization_EducationOrganizationId", + "name": "StudentEducationOrganizationAssociation_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.testingEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_DocumentId", - "kind": "DocumentFk", + "name": "StudentEducationOrganizationAssociation_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference", + "source_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "StudentUniqueId_Unified", + "presence_column": "StudentEducationOrganizationAssociation_DocumentId" } }, { - "name": "ReportingEducationOrganization_DocumentId", + "name": "StudentSchoolAssociation_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.reportingEducationOrganizationReference", + "is_nullable": false, + "source_path": "$.studentSchoolAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_8a1ccd30ea", - "kind": "DocumentFk", + "name": "StudentSchoolAssociation_EntryDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference", + "is_nullable": false, + "source_path": "$.studentSchoolAssociationReference.entryDate", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "DocumentFk", + "name": "StudentSchoolAssociation_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference", + "source_path": "$.studentSchoolAssociationReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_StudentUniqueId", + "name": "StudentSchoolAssociation_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId", + "source_path": "$.studentSchoolAssociationReference.studentUniqueId", "storage": { "kind": "UnifiedAlias", "canonical_column": "StudentUniqueId_Unified", - "presence_column": "StudentEducationOrganizationAssociation_DocumentId" + "presence_column": "StudentSchoolAssociation_DocumentId" } }, { - "name": "StudentSchoolAssociation_DocumentId", + "name": "TestingEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference", + "is_nullable": true, + "source_path": "$.testingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_StudentUniqueId", + "name": "TestingEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.testingEducationOrganizationReference.educationOrganizationId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "StudentUniqueId_Unified", - "presence_column": "StudentSchoolAssociation_DocumentId" + "kind": "Stored" } }, { - "name": "TestingEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.testingEducationOrganizationReference", + "source_path": "$.assessmentGradeLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PlatformTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.platformTypeDescriptor", "storage": { "kind": "Stored" } @@ -70147,6 +70147,117 @@ "kind": "Stored" } }, + { + "name": "Assessment_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.assessmentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Assessment_AssessmentIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.assessmentReference.assessmentIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Assessment_Namespace", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.assessmentReference.namespace", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReportedSchool_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.reportedSchoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReportedSchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.reportedSchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrationEnvironmentDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -70279,32 +70390,6 @@ "kind": "Stored" } }, - { - "name": "Assessment_AssessmentIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.assessmentReference.assessmentIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Assessment_Namespace", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.assessmentReference.namespace", - "storage": { - "kind": "Stored" - } - }, { "name": "EventDescription", "kind": "Scalar", @@ -70355,30 +70440,6 @@ "kind": "Stored" } }, - { - "name": "ReportedSchool_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.reportedSchoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, { "name": "SerialNumber", "kind": "Scalar", @@ -70404,67 +70465,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.assessmentReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ReportedSchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.reportedSchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -70880,141 +70880,141 @@ } }, { - "name": "AssessmentItemResultDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentAssessmentItemAssessmentItem_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.items[*].assessmentItemResultDescriptor", + "source_path": "$.items[*].assessmentItemReference", "storage": { "kind": "Stored" } }, { - "name": "ResponseIndicatorDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentAssessmentItemAssessmentItem_AssessmentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.items[*].responseIndicatorDescriptor", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemReference.assessmentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AssessmentResponse", + "name": "StudentAssessmentItemAssessmentItem_Namespace", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, - "is_nullable": true, - "source_path": "$.items[*].assessmentResponse", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "DescriptiveFeedback", + "name": "StudentAssessmentItemAssessmentItem_IdentificationCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.items[*].descriptiveFeedback", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemReference.identificationCode", "storage": { "kind": "Stored" } }, { - "name": "ItemNumber", - "kind": "Scalar", + "name": "AssessmentItemResultDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.items[*].itemNumber", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemResultDescriptor", "storage": { "kind": "Stored" } }, { - "name": "RawScoreResult", - "kind": "Scalar", + "name": "ResponseIndicatorDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 15, - "scale": 5 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.items[*].rawScoreResult", + "source_path": "$.items[*].responseIndicatorDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_AssessmentIdentifier", + "name": "AssessmentResponse", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference.assessmentIdentifier", + "is_nullable": true, + "source_path": "$.items[*].assessmentResponse", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_IdentificationCode", + "name": "DescriptiveFeedback", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference.identificationCode", + "is_nullable": true, + "source_path": "$.items[*].descriptiveFeedback", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_Namespace", + "name": "ItemNumber", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference.namespace", + "is_nullable": true, + "source_path": "$.items[*].itemNumber", "storage": { "kind": "Stored" } }, { - "name": "TimeAssessed", + "name": "RawScoreResult", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 30 + "kind": "Decimal", + "precision": 15, + "scale": 5 }, "is_nullable": true, - "source_path": "$.items[*].timeAssessed", + "source_path": "$.items[*].rawScoreResult", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_DocumentId", - "kind": "DocumentFk", + "name": "TimeAssessed", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 30 }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference", + "is_nullable": true, + "source_path": "$.items[*].timeAssessed", "storage": { "kind": "Stored" } @@ -71429,6 +71429,57 @@ "kind": "Stored" } }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_Assess_2cf36d20d7", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_Namespace", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.namespace", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_Identi_8450435919", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.identificationCode", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrationDate", "kind": "Scalar", @@ -71464,57 +71515,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_Assess_2cf36d20d7", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_Identi_8450435919", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.identificationCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_Namespace", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.namespace", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -72265,183 +72265,183 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "TechnicalSkillsAssessmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.technicalSkillsAssessmentDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "NonTraditionalGenderStatus", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.nonTraditionalGenderStatus", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "PrivateCTEProgram", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.privateCTEProgram", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "TechnicalSkillsAssessmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.technicalSkillsAssessmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "NonTraditionalGenderStatus", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.nonTraditionalGenderStatus", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "PrivateCTEProgram", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.privateCTEProgram", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -73022,13 +73022,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "Cohort_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.cohortReference", "storage": { "kind": "Stored" } @@ -73059,13 +73059,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -73084,25 +73084,25 @@ } }, { - "name": "Cohort_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.cohortReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -73232,6 +73232,18 @@ "kind": "Stored" } }, + { + "name": "Section_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sections[*].sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_LocalCourseCode", "kind": "Scalar", @@ -73269,19 +73281,6 @@ "kind": "Stored" } }, - { - "name": "Section_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.sections[*].sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Section_SessionName", "kind": "Scalar", @@ -73296,13 +73295,14 @@ } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Section_SectionIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.sections[*].sectionReference", + "source_path": "$.sections[*].sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } @@ -73412,13 +73412,13 @@ } }, { - "name": "CompetencyLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GradingPeriodGradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.competencyLevelDescriptor", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } @@ -73435,31 +73435,6 @@ "kind": "Stored" } }, - { - "name": "ObjectiveCompetencyObjective_ObjectiveGradeLevelDesc_5b5c253e2e", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.objectiveCompetencyObjectiveReference.objectiveGradeLevelDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DiagnosticStatement", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.diagnosticStatement", - "storage": { - "kind": "Stored" - } - }, { "name": "GradingPeriodGradingPeriod_GradingPeriodName", "kind": "Scalar", @@ -73497,6 +73472,18 @@ "kind": "Stored" } }, + { + "name": "ObjectiveCompetencyObjective_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.objectiveCompetencyObjectiveReference", + "storage": { + "kind": "Stored" + } + }, { "name": "ObjectiveCompetencyObjective_EducationOrganizationId", "kind": "Scalar", @@ -73523,50 +73510,63 @@ } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "ObjectiveCompetencyObjective_ObjectiveGradeLevelDesc_5b5c253e2e", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.objectiveCompetencyObjectiveReference.objectiveGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_DocumentId", + "name": "Student_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ObjectiveCompetencyObjective_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.objectiveCompetencyObjectiveReference", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "CompetencyLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.competencyLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DiagnosticStatement", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.diagnosticStatement", "storage": { "kind": "Stored" } @@ -73798,25 +73798,25 @@ } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_7c5bfc584c", - "kind": "DescriptorFk", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_9ca396b829", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programTypeDescriptor", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_20ceb9d821", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_e4556d7896", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programEducationOrganizationId", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.beginDate", "storage": { "kind": "Stored" } @@ -73834,51 +73834,51 @@ } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_72e6052582", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_20ceb9d821", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programName", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_d759bcc32e", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_72e6052582", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 60 }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.studentUniqueId", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programName", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_e4556d7896", - "kind": "Scalar", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_7c5bfc584c", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.beginDate", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_9ca396b829", - "kind": "DocumentFk", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_d759bcc32e", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -74002,101 +74002,101 @@ } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_1128ef7fe6", - "kind": "Scalar", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_393aa361a0", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.studentUniqueId", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_650d92a922", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_87433eab93", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sectionIdentifier", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.beginDate", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_82873650ab", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_8caa9ebb36", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sessionName", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_87433eab93", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_f52295ff38", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.beginDate", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_8caa9ebb36", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_c56563e4b7", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.localCourseCode", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_c56563e4b7", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_650d92a922", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolYear", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sectionIdentifier", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_f52295ff38", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_82873650ab", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolId", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_393aa361a0", - "kind": "DocumentFk", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_1128ef7fe6", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -74306,136 +74306,136 @@ } }, { - "name": "RelationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Contact_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.relationDescriptor", + "is_nullable": false, + "source_path": "$.contactReference", "storage": { "kind": "Stored" } }, { - "name": "ContactPriority", + "name": "Contact_ContactUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.contactPriority", + "is_nullable": false, + "source_path": "$.contactReference.contactUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ContactRestrictions", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 250 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.contactRestrictions", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "Contact_ContactUniqueId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.contactReference.contactUniqueId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "EmergencyContactStatus", - "kind": "Scalar", + "name": "RelationDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.emergencyContactStatus", + "source_path": "$.relationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LegalGuardian", + "name": "ContactPriority", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.legalGuardian", + "source_path": "$.contactPriority", "storage": { "kind": "Stored" } }, { - "name": "LivesWith", + "name": "ContactRestrictions", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 250 }, "is_nullable": true, - "source_path": "$.livesWith", + "source_path": "$.contactRestrictions", "storage": { "kind": "Stored" } }, { - "name": "PrimaryContactStatus", + "name": "EmergencyContactStatus", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.primaryContactStatus", + "source_path": "$.emergencyContactStatus", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "LegalGuardian", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.legalGuardian", "storage": { "kind": "Stored" } }, { - "name": "Contact_DocumentId", - "kind": "DocumentFk", + "name": "LivesWith", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.contactReference", + "is_nullable": true, + "source_path": "$.livesWith", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "PrimaryContactStatus", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.primaryContactStatus", "storage": { "kind": "Stored" } @@ -74597,51 +74597,50 @@ } }, { - "name": "BehaviorDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.behaviorDescriptor", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } }, { - "name": "BehaviorDetailedDescription", + "name": "DisciplineIncident_IncidentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 36 }, - "is_nullable": true, - "source_path": "$.behaviorDetailedDescription", + "is_nullable": false, + "source_path": "$.disciplineIncidentReference.incidentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_IncidentIdentifier", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.incidentIdentifier", + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.schoolId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -74660,25 +74659,26 @@ } }, { - "name": "DisciplineIncident_DocumentId", - "kind": "DocumentFk", + "name": "BehaviorDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.behaviorDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "BehaviorDetailedDescription", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.behaviorDetailedDescription", "storage": { "kind": "Stored" } @@ -75075,63 +75075,63 @@ } }, { - "name": "DisciplineIncident_IncidentIdentifier", - "kind": "Scalar", + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.incidentIdentifier", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", + "name": "DisciplineIncident_IncidentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 36 }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.schoolId", + "source_path": "$.disciplineIncidentReference.incidentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_DocumentId", + "name": "Student_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -75377,50 +75377,50 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", + "name": "Student_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -75671,6 +75671,55 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "BarrierToInternetAccessInResidenceDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -75779,18 +75828,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "GenderIdentity", "kind": "Scalar", @@ -75853,43 +75890,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -76465,98 +76465,122 @@ } }, { - "name": "AncestryEthnicOriginDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.ancestryEthnicOrigins[*].ancestryEthnicOriginDescriptor", - "storage": { - "kind": "Stored" - } - } - ], - "key_unification_classes": [], - "descriptor_fk_deduplications": [], - "constraints": [ - { - "kind": "Unique", - "name": "UX_StudentEducationOrganizationAssociationAncestryEt_82c4aa29b4", - "columns": [ - "StudentEducationOrganizationAssociation_DocumentId", - "AncestryEthnicOriginDescriptor_DescriptorId" - ] - }, - { - "kind": "ForeignKey", - "name": "FK_StudentEducationOrganizationAssociationAncestryEt_1ffe76a84c", - "columns": [ - "StudentEducationOrganizationAssociation_DocumentId" - ], - "target_table": { - "schema": "edfi", - "name": "StudentEducationOrganizationAssociation" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "Cascade", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_StudentEducationOrganizationAssociationAncestryEt_ceea8fef1b", - "columns": [ - "AncestryEthnicOriginDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - } - ] - }, - { - "schema": "edfi", - "name": "StudentEducationOrganizationAssociationCohortYear", - "scope": "$.cohortYears[*]", - "key_columns": [ - { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "ParentKeyPart" - }, - { - "name": "Ordinal", - "kind": "Ordinal" - } - ], - "columns": [ - { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "ParentKeyPart", + "name": "AncestryEthnicOriginDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.ancestryEthnicOrigins[*].ancestryEthnicOriginDescriptor", + "storage": { + "kind": "Stored" + } + } + ], + "key_unification_classes": [], + "descriptor_fk_deduplications": [], + "constraints": [ + { + "kind": "Unique", + "name": "UX_StudentEducationOrganizationAssociationAncestryEt_82c4aa29b4", + "columns": [ + "StudentEducationOrganizationAssociation_DocumentId", + "AncestryEthnicOriginDescriptor_DescriptorId" + ] + }, + { + "kind": "ForeignKey", + "name": "FK_StudentEducationOrganizationAssociationAncestryEt_1ffe76a84c", + "columns": [ + "StudentEducationOrganizationAssociation_DocumentId" + ], + "target_table": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssociation" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "Cascade", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_StudentEducationOrganizationAssociationAncestryEt_ceea8fef1b", + "columns": [ + "AncestryEthnicOriginDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + } + ] + }, + { + "schema": "edfi", + "name": "StudentEducationOrganizationAssociationCohortYear", + "scope": "$.cohortYears[*]", + "key_columns": [ + { + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "ParentKeyPart" + }, + { + "name": "Ordinal", + "kind": "Ordinal" + } + ], + "columns": [ + { + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "ParentKeyPart", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Ordinal", + "kind": "Ordinal", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "CohortYearSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.cohortYears[*].schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "Ordinal", - "kind": "Ordinal", + "name": "CohortYearSchoolYear_SchoolYear", + "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.cohortYears[*].schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } @@ -76584,30 +76608,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CohortYearSchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.cohortYears[*].schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CohortYearSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.cohortYears[*].schoolYearTypeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -76888,74 +76888,74 @@ } }, { - "name": "DisplacedStudentStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DisplacedStudentCrisisEvent_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.displacedStudents[*].displacedStudentStatusDescriptor", + "source_path": "$.displacedStudents[*].crisisEventReference", "storage": { "kind": "Stored" } }, { - "name": "CrisisHomelessnessIndicator", + "name": "DisplacedStudentCrisisEvent_CrisisEventName", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 100 }, - "is_nullable": true, - "source_path": "$.displacedStudents[*].crisisHomelessnessIndicator", + "is_nullable": false, + "source_path": "$.displacedStudents[*].crisisEventReference.crisisEventName", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentCrisisEvent_CrisisEventName", - "kind": "Scalar", + "name": "DisplacedStudentStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 100 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.displacedStudents[*].crisisEventReference.crisisEventName", + "source_path": "$.displacedStudents[*].displacedStudentStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentEndDate", + "name": "CrisisHomelessnessIndicator", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.displacedStudents[*].displacedStudentEndDate", + "source_path": "$.displacedStudents[*].crisisHomelessnessIndicator", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentStartDate", + "name": "DisplacedStudentEndDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": true, - "source_path": "$.displacedStudents[*].displacedStudentStartDate", + "source_path": "$.displacedStudents[*].displacedStudentEndDate", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentCrisisEvent_DocumentId", - "kind": "DocumentFk", + "name": "DisplacedStudentStartDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.displacedStudents[*].crisisEventReference", + "is_nullable": true, + "source_path": "$.displacedStudents[*].displacedStudentStartDate", "storage": { "kind": "Stored" } @@ -79178,25 +79178,13 @@ } }, { - "name": "ResponsibilityDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.responsibilityDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -79214,13 +79202,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -79239,25 +79227,37 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ResponsibilityDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.responsibilityDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -79421,62 +79421,13 @@ } }, { - "name": "AssignmentLateStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assignmentLateStatusDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CompetencyLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.competencyLevelDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SubmissionStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GradebookEntry_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.submissionStatusDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DateFulfilled", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.dateFulfilled", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DiagnosticStatement", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.diagnosticStatement", + "is_nullable": false, + "source_path": "$.gradebookEntryReference", "storage": { "kind": "Stored" } @@ -79508,91 +79459,140 @@ } }, { - "name": "LetterGradeEarned", + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 20 + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssignmentLateStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.letterGradeEarned", + "source_path": "$.assignmentLateStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "NumericGradeEarned", + "name": "CompetencyLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.competencyLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SubmissionStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.submissionStatusDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DateFulfilled", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "Date" }, "is_nullable": true, - "source_path": "$.numericGradeEarned", + "source_path": "$.dateFulfilled", "storage": { "kind": "Stored" } }, { - "name": "PointsEarned", + "name": "DiagnosticStatement", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "String", + "max_length": 1024 }, "is_nullable": true, - "source_path": "$.pointsEarned", + "source_path": "$.diagnosticStatement", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "LetterGradeEarned", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 20 }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.letterGradeEarned", "storage": { "kind": "Stored" } }, { - "name": "TimeFulfilled", + "name": "NumericGradeEarned", "kind": "Scalar", "type": { - "kind": "Time" + "kind": "Decimal", + "precision": 9, + "scale": 2 }, "is_nullable": true, - "source_path": "$.timeFulfilled", + "source_path": "$.numericGradeEarned", "storage": { "kind": "Stored" } }, { - "name": "GradebookEntry_DocumentId", - "kind": "DocumentFk", + "name": "PointsEarned", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 9, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.gradebookEntryReference", + "is_nullable": true, + "source_path": "$.pointsEarned", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TimeFulfilled", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Time" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.timeFulfilled", "storage": { "kind": "Stored" } @@ -79815,25 +79815,13 @@ } }, { - "name": "NonMedicalImmunizationExemptionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.nonMedicalImmunizationExemptionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -79851,13 +79839,13 @@ } }, { - "name": "NonMedicalImmunizationExemptionDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.nonMedicalImmunizationExemptionDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -79876,25 +79864,37 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "NonMedicalImmunizationExemptionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.nonMedicalImmunizationExemptionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.asOfDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NonMedicalImmunizationExemptionDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.nonMedicalImmunizationExemptionDate", "storage": { "kind": "Stored" } @@ -80473,13 +80473,62 @@ } }, { - "name": "HomelessPrimaryNighttimeResidenceDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.homelessPrimaryNighttimeResidenceDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } @@ -80496,6 +80545,43 @@ "kind": "Stored" } }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "HomelessPrimaryNighttimeResidenceDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.homelessPrimaryNighttimeResidenceDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ReasonExitedDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -80532,18 +80618,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "EndDate", "kind": "Scalar", @@ -80568,31 +80642,6 @@ "kind": "Stored" } }, - { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programReference.programName", - "storage": { - "kind": "Stored" - } - }, { "name": "ServedOutsideOfRegularSession", "kind": "Scalar", @@ -80604,55 +80653,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -81217,51 +81217,50 @@ } }, { - "name": "CohortCohort_CohortIdentifier", - "kind": "Scalar", + "name": "CohortCohort_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.cohortReference.cohortIdentifier", + "source_path": "$.cohortReference", "storage": { "kind": "Stored" } }, { - "name": "CohortCohort_EducationOrganizationId", + "name": "CohortCohort_CohortIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 36 }, "is_nullable": true, - "source_path": "$.cohortReference.educationOrganizationId", + "source_path": "$.cohortReference.cohortIdentifier", "storage": { "kind": "Stored" } }, { - "name": "DiagnosticStatement", + "name": "CohortCohort_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.diagnosticStatement", + "source_path": "$.cohortReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "Dosage", - "kind": "Scalar", + "name": "Intervention_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.dosage", + "is_nullable": false, + "source_path": "$.interventionReference", "storage": { "kind": "Stored" } @@ -81292,50 +81291,51 @@ } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "CohortCohort_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.cohortReference", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Intervention_DocumentId", - "kind": "DocumentFk", + "name": "DiagnosticStatement", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.interventionReference", + "is_nullable": true, + "source_path": "$.diagnosticStatement", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "Dosage", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.dosage", "storage": { "kind": "Stored" } @@ -81747,138 +81747,138 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Intervention_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", + "source_path": "$.interventionReference", "storage": { "kind": "Stored" } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Intervention_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", + "is_nullable": false, + "source_path": "$.interventionReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AttendanceEventReason", + "name": "Intervention_InterventionIdentificationCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", + "is_nullable": false, + "source_path": "$.interventionReference.interventionIdentificationCode", "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EventDuration", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.eventDuration", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "InterventionDuration", - "kind": "Scalar", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.interventionDuration", + "is_nullable": false, + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Intervention_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.interventionReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Intervention_InterventionIdentificationCode", + "name": "AttendanceEventReason", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.interventionReference.interventionIdentificationCode", + "is_nullable": true, + "source_path": "$.attendanceEventReason", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EventDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "Intervention_DocumentId", - "kind": "DocumentFk", + "name": "EventDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 3, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.interventionReference", + "is_nullable": true, + "source_path": "$.eventDuration", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "InterventionDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.interventionDuration", "storage": { "kind": "Stored" } @@ -82074,171 +82074,171 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "Dosage", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.dosage", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EnglishLearnerParticipation", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.englishLearnerParticipation", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "Dosage", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.dosage", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EnglishLearnerParticipation", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.englishLearnerParticipation", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -82431,73 +82431,73 @@ } }, { - "name": "MonitoredDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EnglishLanguageProficiencyAssessmentSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].monitoredDescriptor", + "is_nullable": false, + "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "ParticipationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EnglishLanguageProficiencyAssessmentSchoolYear_SchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].participationDescriptor", + "is_nullable": false, + "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "ProficiencyDescriptor_DescriptorId", + "name": "MonitoredDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].proficiencyDescriptor", + "source_path": "$.englishLanguageProficiencyAssessments[*].monitoredDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgressDescriptor_DescriptorId", + "name": "ParticipationDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].progressDescriptor", + "source_path": "$.englishLanguageProficiencyAssessments[*].participationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EnglishLanguageProficiencyAssessmentSchoolYear_SchoolYear", - "kind": "Scalar", + "name": "ProficiencyDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference.schoolYear", + "is_nullable": true, + "source_path": "$.englishLanguageProficiencyAssessments[*].proficiencyDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EnglishLanguageProficiencyAssessmentSchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "ProgressDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference", + "is_nullable": true, + "source_path": "$.englishLanguageProficiencyAssessments[*].progressDescriptor", "storage": { "kind": "Stored" } @@ -83040,13 +83040,62 @@ } }, { - "name": "ContinuationOfServicesReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.continuationOfServicesReasonDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } @@ -83063,6 +83112,43 @@ "kind": "Stored" } }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ContinuationOfServicesReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.continuationOfServicesReasonDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ReasonExitedDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -83087,18 +83173,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "EligibilityExpirationDate", "kind": "Scalar", @@ -83147,31 +83221,6 @@ "kind": "Stored" } }, - { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programReference.programName", - "storage": { - "kind": "Stored" - } - }, { "name": "QualifyingArrivalDate", "kind": "Scalar", @@ -83208,19 +83257,6 @@ "kind": "Stored" } }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "UsInitialEntry", "kind": "Scalar", @@ -83256,42 +83292,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -83836,183 +83836,183 @@ } }, { - "name": "ElaProgressLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.elaProgressLevelDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "MathematicsProgressLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.mathematicsProgressLevelDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "NeglectedOrDelinquentProgramDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.neglectedOrDelinquentProgramDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "ElaProgressLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.elaProgressLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "MathematicsProgressLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.mathematicsProgressLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "NeglectedOrDelinquentProgramDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.neglectedOrDelinquentProgramDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -84618,37 +84618,13 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -84666,13 +84642,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -84703,13 +84679,25 @@ } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -84728,37 +84716,49 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.programReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.endDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -85277,174 +85277,174 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "AttendanceEventReason", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EventDuration", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.eventDuration", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramAttendanceDuration", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.programAttendanceDuration", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "AttendanceEventReason", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.attendanceEventReason", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EventDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EventDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 3, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.eventDuration", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ProgramAttendanceDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.programAttendanceDuration", "storage": { "kind": "Stored" } @@ -85698,6 +85698,42 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluation_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", "kind": "DescriptorFk", @@ -85710,6 +85746,19 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEvaluationTitle", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -85722,6 +85771,31 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEducationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluation_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programName", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -85735,25 +85809,63 @@ } }, { - "name": "SummaryEvaluationRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StaffEvaluatorStaff_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.summaryEvaluationRatingLevelDescriptor", + "source_path": "$.staffEvaluatorStaffReference", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "StaffEvaluatorStaff_StaffUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.staffEvaluatorStaffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SummaryEvaluationRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.summaryEvaluationRatingLevelDescriptor", "storage": { "kind": "Stored" } @@ -85782,70 +85894,6 @@ "kind": "Stored" } }, - { - "name": "ProgramEvaluation_ProgramEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramEvaluationTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffEvaluatorStaff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.staffEvaluatorStaffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "SummaryEvaluationComment", "kind": "Scalar", @@ -85872,54 +85920,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffEvaluatorStaff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.staffEvaluatorStaffReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -86257,126 +86257,126 @@ } }, { - "name": "EvaluationElementRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentEvaluationElementProgramEvaluationElement_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.studentEvaluationElements[*].evaluationElementRatingLevelDescriptor", + "is_nullable": false, + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_38d123670f", - "kind": "DescriptorFk", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_56aa4525fb", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationPeriodDescriptor", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationElementTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_b27b83c178", - "kind": "DescriptorFk", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_467059facd", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTypeDescriptor", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_ef497c5466", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_38d123670f", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programTypeDescriptor", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationElementNumericRating", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_57fb6d52f8", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 + "kind": "String", + "max_length": 50 }, - "is_nullable": true, - "source_path": "$.studentEvaluationElements[*].evaluationElementNumericRating", + "is_nullable": false, + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_467059facd", - "kind": "Scalar", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_b27b83c178", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEducationOrganizationId", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_56aa4525fb", + "name": "StudentEvaluationElementProgramEvaluationElement_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationElementTitle", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programName", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_57fb6d52f8", - "kind": "Scalar", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_ef497c5466", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTitle", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_ProgramName", - "kind": "Scalar", + "name": "EvaluationElementRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programName", + "is_nullable": true, + "source_path": "$.studentEvaluationElements[*].evaluationElementRatingLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_DocumentId", - "kind": "DocumentFk", + "name": "EvaluationElementNumericRating", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 6, + "scale": 3 }, - "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference", + "is_nullable": true, + "source_path": "$.studentEvaluationElements[*].evaluationElementNumericRating", "storage": { "kind": "Stored" } @@ -86559,37 +86559,38 @@ } }, { - "name": "EvaluationObjectiveRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveRatingLevelDescriptor", + "is_nullable": false, + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_344bbaad76", - "kind": "DescriptorFk", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_74b56ed982", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programTypeDescriptor", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationObjectiveTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_5c8a926f84", - "kind": "DescriptorFk", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_dd70a2e950", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTypeDescriptor", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEducationOrganizationId", "storage": { "kind": "Stored" } @@ -86607,78 +86608,77 @@ } }, { - "name": "EvaluationObjectiveNumericRating", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_4b2b771726", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 + "kind": "String", + "max_length": 50 }, - "is_nullable": true, - "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveNumericRating", + "is_nullable": false, + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_4b2b771726", - "kind": "Scalar", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_5c8a926f84", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTitle", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_74b56ed982", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_e1d44bbcf0", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationObjectiveTitle", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programName", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_dd70a2e950", - "kind": "Scalar", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_344bbaad76", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEducationOrganizationId", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_e1d44bbcf0", - "kind": "Scalar", + "name": "EvaluationObjectiveRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programName", + "is_nullable": true, + "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveRatingLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_DocumentId", - "kind": "DocumentFk", + "name": "EvaluationObjectiveNumericRating", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 6, + "scale": 3 }, - "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference", + "is_nullable": true, + "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveNumericRating", "storage": { "kind": "Stored" } @@ -87254,61 +87254,126 @@ } }, { - "name": "EnrollmentTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_Unified", + "kind": "Scalar", + "type": { + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.enrollmentTypeDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EntryGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.entryGradeLevelDescriptor", + "is_nullable": true, + "source_path": "$.calendarReference", "storage": { "kind": "Stored" } }, { - "name": "EntryGradeLevelReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.entryGradeLevelReasonDescriptor", + "source_path": "$.calendarReference.calendarCode", "storage": { "kind": "Stored" } }, { - "name": "EntryTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.calendarReference.schoolId", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Calendar_DocumentId" + } + }, + { + "name": "Calendar_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.calendarReference.schoolYear", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Calendar_DocumentId" + } + }, + { + "name": "ClassOfSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.entryTypeDescriptor", + "source_path": "$.classOfSchoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "ExitWithdrawTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ClassOfSchoolYear_ClassOfSchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.classOfSchoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GraduationPlan_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.exitWithdrawTypeDescriptor", + "source_path": "$.graduationPlanReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GraduationPlan_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.graduationPlanReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -87326,148 +87391,260 @@ } }, { - "name": "NextYearGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GraduationPlan_GraduationSchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.nextYearGradeLevelDescriptor", + "source_path": "$.graduationPlanReference.graduationSchoolYear", "storage": { "kind": "Stored" } }, { - "name": "ResidencyStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "NextYearSchool_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.residencyStatusDescriptor", + "source_path": "$.nextYearSchoolReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoiceBasisDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "NextYearSchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.nextYearSchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.schoolChoiceBasisDescriptor", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "Calendar_CalendarCode", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.calendarReference.calendarCode", + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "SchoolYear_DocumentId" + } + }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "ClassOfSchoolYear_ClassOfSchoolYear", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.classOfSchoolYearTypeReference.schoolYear", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EmployedWhileEnrolled", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EnrollmentTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.employedWhileEnrolled", + "source_path": "$.enrollmentTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EntryDate", - "kind": "Scalar", + "name": "EntryGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.entryDate", + "source_path": "$.entryGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ExitWithdrawDate", - "kind": "Scalar", + "name": "EntryGradeLevelReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.exitWithdrawDate", + "source_path": "$.entryGradeLevelReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "FullTimeEquivalency", - "kind": "Scalar", + "name": "EntryTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.fullTimeEquivalency", + "source_path": "$.entryTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "GraduationPlan_EducationOrganizationId", + "name": "ExitWithdrawTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.exitWithdrawTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NextYearGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.nextYearGradeLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResidencyStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.residencyStatusDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolChoiceBasisDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.schoolChoiceBasisDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EmployedWhileEnrolled", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.graduationPlanReference.educationOrganizationId", + "source_path": "$.employedWhileEnrolled", "storage": { "kind": "Stored" } }, { - "name": "GraduationPlan_GraduationSchoolYear", + "name": "EntryDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.entryDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ExitWithdrawDate", + "kind": "Scalar", + "type": { + "kind": "Date" }, "is_nullable": true, - "source_path": "$.graduationPlanReference.graduationSchoolYear", + "source_path": "$.exitWithdrawDate", "storage": { "kind": "Stored" } }, { - "name": "NextYearSchool_SchoolId", + "name": "FullTimeEquivalency", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 5, + "scale": 4 }, "is_nullable": true, - "source_path": "$.nextYearSchoolReference.schoolId", + "source_path": "$.fullTimeEquivalency", "storage": { "kind": "Stored" } @@ -87520,43 +87697,6 @@ "kind": "Stored" } }, - { - "name": "SchoolId_Unified", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_Unified", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "TermCompletionIndicator", "kind": "Scalar", @@ -87568,146 +87708,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.calendarReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Calendar_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.calendarReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Calendar_DocumentId" - } - }, - { - "name": "Calendar_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.calendarReference.schoolYear", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Calendar_DocumentId" - } - }, - { - "name": "ClassOfSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.classOfSchoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GraduationPlan_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.graduationPlanReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "NextYearSchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.nextYearSchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "SchoolYear_DocumentId" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [ @@ -88143,13 +88143,13 @@ } }, { - "name": "AlternativeGraduationPlan_GraduationPlanTypeDescript_0b71806181", - "kind": "DescriptorFk", + "name": "AlternativeGraduationPlan_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationPlanTypeDescriptor", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference", "storage": { "kind": "Stored" } @@ -88167,25 +88167,25 @@ } }, { - "name": "AlternativeGraduationPlan_GraduationSchoolYear", - "kind": "Scalar", + "name": "AlternativeGraduationPlan_GraduationPlanTypeDescript_0b71806181", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationSchoolYear", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationPlanTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "AlternativeGraduationPlan_DocumentId", - "kind": "DocumentFk", + "name": "AlternativeGraduationPlan_GraduationSchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationSchoolYear", "storage": { "kind": "Stored" } @@ -88569,114 +88569,67 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ArrivalTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.arrivalTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AttendanceEventReason", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DepartureTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.departureTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EventDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "EventDuration", + "name": "School_SchoolId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.eventDuration", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" } }, { - "name": "SchoolAttendanceDuration", - "kind": "Scalar", + "name": "Session_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.schoolAttendanceDuration", + "is_nullable": false, + "source_path": "$.sessionReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "Session_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.sessionReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Session_DocumentId" } }, { @@ -88704,6 +88657,18 @@ "kind": "Stored" } }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Student_StudentUniqueId", "kind": "Scalar", @@ -88718,65 +88683,100 @@ } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ArrivalTime", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Time" }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "is_nullable": true, + "source_path": "$.arrivalTime", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" + "kind": "Stored" } }, { - "name": "Session_DocumentId", - "kind": "DocumentFk", + "name": "AttendanceEventReason", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.sessionReference", + "is_nullable": true, + "source_path": "$.attendanceEventReason", "storage": { "kind": "Stored" } }, { - "name": "Session_SchoolId", + "name": "DepartureTime", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Time" }, - "is_nullable": false, - "source_path": "$.sessionReference.schoolId", + "is_nullable": true, + "source_path": "$.departureTime", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Session_DocumentId" + "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EventDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.eventDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDuration", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 3, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.eventDuration", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolAttendanceDuration", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.schoolAttendanceDuration", "storage": { "kind": "Stored" } @@ -89022,159 +89022,159 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "DirectCertification", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.directCertification", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.programName", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "DirectCertification", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.directCertification", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -89693,207 +89693,207 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "Section504DisabilityDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.section504DisabilityDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "AccommodationPlan", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.accommodationPlan", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section504Eligibility", - "kind": "Scalar", + "name": "Section504DisabilityDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.section504Eligibility", + "is_nullable": true, + "source_path": "$.section504DisabilityDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section504EligibilityDecisionDate", + "name": "AccommodationPlan", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.section504EligibilityDecisionDate", + "source_path": "$.accommodationPlan", "storage": { "kind": "Stored" } }, { - "name": "Section504MeetingDate", + "name": "BeginDate", "kind": "Scalar", "type": { "kind": "Date" }, - "is_nullable": true, - "source_path": "$.section504MeetingDate", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "Section504Eligibility", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Boolean" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.section504Eligibility", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "Section504EligibilityDecisionDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.section504EligibilityDecisionDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "Section504MeetingDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.section504MeetingDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -90295,245 +90295,245 @@ } }, { - "name": "AttemptStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DualCreditEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.attemptStatusDescriptor", + "source_path": "$.dualCreditEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "DualCreditInstitutionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DualCreditEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.dualCreditInstitutionDescriptor", + "source_path": "$.dualCreditEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "DualCreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.dualCreditTypeDescriptor", + "is_nullable": false, + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } }, { - "name": "RepeatIdentifierDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_LocalCourseCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.repeatIdentifierDescriptor", + "is_nullable": false, + "source_path": "$.sectionReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "Section_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.sectionReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DualCreditEducationOrganization_EducationOrganizationId", + "name": "Section_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.dualCreditEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.sectionReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "DualCreditIndicator", + "name": "Section_SessionName", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.dualCreditIndicator", + "is_nullable": false, + "source_path": "$.sectionReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "DualHighSchoolCreditIndicator", + "name": "Section_SectionIdentifier", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.dualHighSchoolCreditIndicator", + "is_nullable": false, + "source_path": "$.sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "HomeroomIndicator", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.homeroomIndicator", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Section_LocalCourseCode", - "kind": "Scalar", + "name": "AttemptStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.localCourseCode", + "is_nullable": true, + "source_path": "$.attemptStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolId", - "kind": "Scalar", + "name": "DualCreditInstitutionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.schoolId", + "is_nullable": true, + "source_path": "$.dualCreditInstitutionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolYear", - "kind": "Scalar", + "name": "DualCreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.schoolYear", + "is_nullable": true, + "source_path": "$.dualCreditTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SectionIdentifier", - "kind": "Scalar", + "name": "RepeatIdentifierDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.sectionIdentifier", + "is_nullable": true, + "source_path": "$.repeatIdentifierDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SessionName", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "DualCreditIndicator", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.dualCreditIndicator", "storage": { "kind": "Stored" } }, { - "name": "TeacherStudentDataLinkExclusion", + "name": "DualHighSchoolCreditIndicator", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.teacherStudentDataLinkExclusion", + "source_path": "$.dualHighSchoolCreditIndicator", "storage": { "kind": "Stored" } }, { - "name": "DualCreditEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.dualCreditEducationOrganizationReference", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "HomeroomIndicator", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.sectionReference", + "is_nullable": true, + "source_path": "$.homeroomIndicator", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TeacherStudentDataLinkExclusion", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.teacherStudentDataLinkExclusion", "storage": { "kind": "Stored" } @@ -90777,13 +90777,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -90814,13 +90814,13 @@ } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -91006,100 +91006,13 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ArrivalTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.arrivalTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AttendanceEventReason", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DepartureTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.departureTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EventDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.eventDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EventDuration", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 - }, - "is_nullable": true, - "source_path": "$.eventDuration", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SectionAttendanceDuration", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.sectionAttendanceDuration", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } @@ -91141,6 +91054,19 @@ "kind": "Stored" } }, + { + "name": "Section_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.sectionReference.sessionName", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_SectionIdentifier", "kind": "Scalar", @@ -91155,14 +91081,13 @@ } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -91181,25 +91106,100 @@ } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference", + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ArrivalTime", + "kind": "Scalar", + "type": { + "kind": "Time" + }, + "is_nullable": true, + "source_path": "$.arrivalTime", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AttendanceEventReason", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.attendanceEventReason", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DepartureTime", + "kind": "Scalar", + "type": { + "kind": "Time" + }, + "is_nullable": true, + "source_path": "$.departureTime", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.eventDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDuration", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 3, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.eventDuration", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionAttendanceDuration", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.sectionAttendanceDuration", "storage": { "kind": "Stored" } @@ -91372,38 +91372,38 @@ } }, { - "name": "ClassPeriod_ClassPeriodName", - "kind": "Scalar", + "name": "ClassPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", + "source_path": "$.classPeriods[*].classPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_SchoolId", + "name": "ClassPeriod_ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.schoolId", + "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_DocumentId", - "kind": "DocumentFk", + "name": "ClassPeriod_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference", + "source_path": "$.classPeriods[*].classPeriodReference.schoolId", "storage": { "kind": "Stored" } @@ -91553,61 +91553,13 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SpecialEducationExitReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.specialEducationExitReasonDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SpecialEducationSettingDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.specialEducationSettingDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -91625,97 +91577,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.endDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IdeaEligibility", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.ideaEligibility", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IepBeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.iepBeginDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IepEndDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.iepEndDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IepReviewDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.iepReviewDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LastEvaluationDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.lastEvaluationDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MedicallyFragile", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.medicallyFragile", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MultiplyDisabled", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.multiplyDisabled", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -91746,84 +91614,188 @@ } }, { - "name": "ReductionInHoursPerWeekComparedToPeers", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 2 + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.reductionInHoursPerWeekComparedToPeers", + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolHoursPerWeek", + "name": "SpecialEducationExitReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.specialEducationExitReasonDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SpecialEducationSettingDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.specialEducationSettingDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 2 + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" }, "is_nullable": true, - "source_path": "$.schoolHoursPerWeek", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "IdeaEligibility", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.ideaEligibility", "storage": { "kind": "Stored" } }, { - "name": "ShortenedSchoolDayIndicator", + "name": "IepBeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.shortenedSchoolDayIndicator", + "source_path": "$.iepBeginDate", "storage": { "kind": "Stored" } }, { - "name": "SpecialEducationExitDate", + "name": "IepEndDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": true, - "source_path": "$.specialEducationExitDate", + "source_path": "$.iepEndDate", "storage": { "kind": "Stored" } }, { - "name": "SpecialEducationExitExplained", + "name": "IepReviewDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Date" }, "is_nullable": true, - "source_path": "$.specialEducationExitExplained", + "source_path": "$.iepReviewDate", "storage": { "kind": "Stored" } }, { - "name": "SpecialEducationHoursPerWeek", + "name": "LastEvaluationDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.lastEvaluationDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MedicallyFragile", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.medicallyFragile", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MultiplyDisabled", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.multiplyDisabled", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReductionInHoursPerWeekComparedToPeers", "kind": "Scalar", "type": { "kind": "Decimal", @@ -91831,56 +91803,84 @@ "scale": 2 }, "is_nullable": true, - "source_path": "$.specialEducationHoursPerWeek", + "source_path": "$.reductionInHoursPerWeekComparedToPeers", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "SchoolHoursPerWeek", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Decimal", + "precision": 5, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.schoolHoursPerWeek", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "ShortenedSchoolDayIndicator", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.shortenedSchoolDayIndicator", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "SpecialEducationExitDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.specialEducationExitDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SpecialEducationExitExplained", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.specialEducationExitExplained", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SpecialEducationHoursPerWeek", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 5, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.specialEducationHoursPerWeek", "storage": { "kind": "Stored" } @@ -92390,13 +92390,13 @@ } }, { - "name": "PrimaryProvider", - "kind": "Scalar", + "name": "ServiceProviderStaff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.serviceProviders[*].primaryProvider", + "is_nullable": false, + "source_path": "$.serviceProviders[*].staffReference", "storage": { "kind": "Stored" } @@ -92415,13 +92415,13 @@ } }, { - "name": "ServiceProviderStaff_DocumentId", - "kind": "DocumentFk", + "name": "PrimaryProvider", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.serviceProviders[*].staffReference", + "is_nullable": true, + "source_path": "$.serviceProviders[*].primaryProvider", "storage": { "kind": "Stored" } @@ -92787,13 +92787,13 @@ } }, { - "name": "PrimaryProvider", - "kind": "Scalar", + "name": "SpecialEducationProgramServiceServiceProviderStaff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.specialEducationProgramServices[*].providers[*].primaryProvider", + "is_nullable": false, + "source_path": "$.specialEducationProgramServices[*].providers[*].staffReference", "storage": { "kind": "Stored" } @@ -92812,13 +92812,13 @@ } }, { - "name": "SpecialEducationProgramServiceServiceProviderStaff_DocumentId", - "kind": "DocumentFk", + "name": "PrimaryProvider", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.specialEducationProgramServices[*].providers[*].staffReference", + "is_nullable": true, + "source_path": "$.specialEducationProgramServices[*].providers[*].primaryProvider", "storage": { "kind": "Stored" } @@ -93045,292 +93045,292 @@ } }, { - "name": "EligibilityDelayReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.eligibilityDelayReasonDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "EligibilityEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.eligibilityEvaluationTypeDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EvaluationDelayReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.evaluationDelayReasonDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "IdeaPartDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.ideaPartDescriptor", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "ConsentToEvaluationDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.consentToEvaluationDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ConsentToEvaluationReceivedDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.consentToEvaluationReceivedDate", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "EligibilityConferenceDate", - "kind": "Scalar", + "name": "EligibilityDelayReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.eligibilityConferenceDate", + "source_path": "$.eligibilityDelayReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EligibilityDeterminationDate", - "kind": "Scalar", + "name": "EligibilityEvaluationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.eligibilityDeterminationDate", + "source_path": "$.eligibilityEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EligibilityEvaluationDate", - "kind": "Scalar", + "name": "EvaluationDelayReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.eligibilityEvaluationDate", + "source_path": "$.evaluationDelayReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationCompleteIndicator", - "kind": "Scalar", + "name": "IdeaPartDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.evaluationCompleteIndicator", + "is_nullable": false, + "source_path": "$.ideaPartDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationDelayDays", + "name": "ConsentToEvaluationDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.evaluationDelayDays", + "source_path": "$.consentToEvaluationDate", "storage": { "kind": "Stored" } }, { - "name": "EvaluationLateReason", + "name": "ConsentToEvaluationReceivedDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.evaluationLateReason", + "is_nullable": false, + "source_path": "$.consentToEvaluationReceivedDate", "storage": { "kind": "Stored" } }, { - "name": "IdeaIndicator", + "name": "EligibilityConferenceDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.ideaIndicator", + "source_path": "$.eligibilityConferenceDate", "storage": { "kind": "Stored" } }, { - "name": "OriginalECIServicesDate", + "name": "EligibilityDeterminationDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": true, - "source_path": "$.originalECIServicesDate", + "source_path": "$.eligibilityDeterminationDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", + "name": "EligibilityEvaluationDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.eligibilityEvaluationDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", + "name": "EvaluationCompleteIndicator", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.evaluationCompleteIndicator", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EvaluationDelayDays", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.evaluationDelayDays", "storage": { "kind": "Stored" } }, { - "name": "TransitionConferenceDate", + "name": "EvaluationLateReason", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.transitionConferenceDate", + "source_path": "$.evaluationLateReason", "storage": { "kind": "Stored" } }, { - "name": "TransitionNotificationDate", + "name": "IdeaIndicator", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.transitionNotificationDate", + "source_path": "$.ideaIndicator", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "OriginalECIServicesDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.originalECIServicesDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "TransitionConferenceDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.transitionConferenceDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TransitionNotificationDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.transitionNotificationDate", "storage": { "kind": "Stored" } @@ -93642,159 +93642,159 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "TitleIPartAParticipantDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.titleIPartAParticipantDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.programName", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "TitleIPartAParticipantDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.titleIPartAParticipantDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -94342,126 +94342,126 @@ } }, { - "name": "StudentBusDetailsBusRouteDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.studentBusDetails.busRouteDescriptor", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "TransportationPublicExpenseEligibilityTypeDescriptor_16bbab4652", - "kind": "DescriptorFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.transportationPublicExpenseEligibilityTypeDescriptor", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "TransportationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "TransportationEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.transportationTypeDescriptor", + "is_nullable": false, + "source_path": "$.transportationEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "SpecialAccomodationRequirements", + "name": "TransportationEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.specialAccomodationRequirements", + "is_nullable": false, + "source_path": "$.transportationEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentBusDetailsBusNumber", - "kind": "Scalar", + "name": "StudentBusDetailsBusRouteDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentBusDetails.busNumber", + "source_path": "$.studentBusDetails.busRouteDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentBusDetailsMileage", - "kind": "Scalar", + "name": "TransportationPublicExpenseEligibilityTypeDescriptor_16bbab4652", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 2 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentBusDetails.mileage", + "source_path": "$.transportationPublicExpenseEligibilityTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "TransportationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.transportationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "TransportationEducationOrganization_EducationOrganizationId", + "name": "SpecialAccomodationRequirements", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.transportationEducationOrganizationReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.specialAccomodationRequirements", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "StudentBusDetailsBusNumber", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 36 }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.studentBusDetails.busNumber", "storage": { "kind": "Stored" } }, { - "name": "TransportationEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "StudentBusDetailsMileage", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 5, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.transportationEducationOrganizationReference", + "is_nullable": true, + "source_path": "$.studentBusDetails.mileage", "storage": { "kind": "Stored" } @@ -94901,61 +94901,86 @@ } }, { - "name": "BirthCountryDescriptor_DescriptorId", + "name": "Person_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.personReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_PersonId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.personReference.personId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_SourceSystemDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.birthCountryDescriptor", + "source_path": "$.personReference.sourceSystemDescriptor", "storage": { "kind": "Stored" } }, { - "name": "BirthSexDescriptor_DescriptorId", + "name": "BirthCountryDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.birthSexDescriptor", + "source_path": "$.birthCountryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "BirthStateAbbreviationDescriptor_DescriptorId", + "name": "BirthSexDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.birthStateAbbreviationDescriptor", + "source_path": "$.birthSexDescriptor", "storage": { "kind": "Stored" } }, { - "name": "CitizenshipStatusDescriptor_DescriptorId", + "name": "BirthStateAbbreviationDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.citizenshipStatusDescriptor", + "source_path": "$.birthStateAbbreviationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Person_SourceSystemDescriptor_DescriptorId", + "name": "CitizenshipStatusDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.personReference.sourceSystemDescriptor", + "source_path": "$.citizenshipStatusDescriptor", "storage": { "kind": "Stored" } @@ -95087,19 +95112,6 @@ "kind": "Stored" } }, - { - "name": "Person_PersonId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.personReference.personId", - "storage": { - "kind": "Stored" - } - }, { "name": "PersonalTitlePrefix", "kind": "Scalar", @@ -95151,18 +95163,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Person_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.personReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -96253,6 +96253,18 @@ "kind": "Stored" } }, + { + "name": "Course_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.courseReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Course_CourseCode", "kind": "Scalar", @@ -96279,51 +96291,39 @@ } }, { - "name": "Survey_Namespace", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", + "name": "Survey_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Course_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "max_length": 255 }, "is_nullable": false, - "source_path": "$.courseReference", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "Survey_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } @@ -96481,13 +96481,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -96518,51 +96518,51 @@ } }, { - "name": "Survey_Namespace", - "kind": "Scalar", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Survey_Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.programReference", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "Survey_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } @@ -96732,19 +96732,6 @@ "kind": "Stored" } }, - { - "name": "Comment", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.comment", - "storage": { - "kind": "Stored" - } - }, { "name": "Namespace_Unified", "kind": "Scalar", @@ -96758,18 +96745,6 @@ "kind": "Stored" } }, - { - "name": "NoResponse", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.noResponse", - "storage": { - "kind": "Stored" - } - }, { "name": "SurveyIdentifier_Unified", "kind": "Scalar", @@ -96784,39 +96759,26 @@ } }, { - "name": "SurveyQuestion_QuestionCode", - "kind": "Scalar", + "name": "SurveyQuestion_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyQuestionReference.questionCode", + "source_path": "$.surveyQuestionReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyResponseIdentifier", + "name": "SurveyQuestion_QuestionCode", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveyQuestion_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.surveyQuestionReference", + "source_path": "$.surveyQuestionReference.questionCode", "storage": { "kind": "Stored" } @@ -96892,6 +96854,44 @@ "canonical_column": "SurveyIdentifier_Unified", "presence_column": "SurveyResponse_DocumentId" } + }, + { + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Comment", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.comment", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NoResponse", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.noResponse", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -97319,23 +97319,24 @@ } }, { - "name": "QuestionFormDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Namespace_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.questionFormDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "Namespace_Unified", + "name": "SurveyIdentifier_Unified", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, "source_path": null, @@ -97344,42 +97345,45 @@ } }, { - "name": "QuestionCode", - "kind": "Scalar", + "name": "SurveySection_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.questionCode", + "is_nullable": true, + "source_path": "$.surveySectionReference", "storage": { "kind": "Stored" } }, { - "name": "QuestionText", + "name": "SurveySection_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.questionText", + "is_nullable": true, + "source_path": "$.surveySectionReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "SurveySection_DocumentId" } }, { - "name": "SurveyIdentifier_Unified", + "name": "SurveySection_SurveyIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.surveySectionReference.surveyIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SurveyIdentifier_Unified", + "presence_column": "SurveySection_DocumentId" } }, { @@ -97396,87 +97400,83 @@ } }, { - "name": "SurveySection_DocumentId", + "name": "Survey_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.surveySectionReference", + "is_nullable": false, + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "SurveySection_Namespace", + "name": "Survey_Namespace", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, - "is_nullable": true, - "source_path": "$.surveySectionReference.namespace", + "is_nullable": false, + "source_path": "$.surveyReference.namespace", "storage": { "kind": "UnifiedAlias", "canonical_column": "Namespace_Unified", - "presence_column": "SurveySection_DocumentId" + "presence_column": "Survey_DocumentId" } }, { - "name": "SurveySection_SurveyIdentifier", + "name": "Survey_SurveyIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, - "is_nullable": true, - "source_path": "$.surveySectionReference.surveyIdentifier", + "is_nullable": false, + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "UnifiedAlias", "canonical_column": "SurveyIdentifier_Unified", - "presence_column": "SurveySection_DocumentId" + "presence_column": "Survey_DocumentId" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "QuestionFormDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.questionFormDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Survey_Namespace", + "name": "QuestionCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.questionCode", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "Survey_DocumentId" + "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", + "name": "QuestionText", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "source_path": "$.questionText", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SurveyIdentifier_Unified", - "presence_column": "Survey_DocumentId" + "kind": "Stored" } } ], @@ -97905,76 +97905,76 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_Namespace", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.surveyResponseReference.namespace", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyIdentifier", - "kind": "Scalar", + "name": "SurveyResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyIdentifier", + "source_path": "$.surveyResponseReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyResponseIdentifier", + "name": "SurveyResponse_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "source_path": "$.surveyResponseReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.surveyResponseReference.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseReference", + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", "storage": { "kind": "Stored" } @@ -98112,77 +98112,77 @@ } }, { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_Namespace", + "name": "Staff_StaffUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.namespace", + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyIdentifier", - "kind": "Scalar", + "name": "SurveyResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyIdentifier", + "source_path": "$.surveyResponseReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyResponseIdentifier", + "name": "SurveyResponse_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "source_path": "$.surveyResponseReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.surveyResponseReference.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseReference", + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", "storage": { "kind": "Stored" } @@ -98320,190 +98320,190 @@ } }, { - "name": "ElectronicMailAddress", - "kind": "Scalar", + "name": "SurveyResponderChoiceContact_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 128 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.electronicMailAddress", + "is_nullable": false, + "source_path": "$.contactReference", "storage": { "kind": "Stored" } }, { - "name": "FullName", + "name": "SurveyResponderChoiceContact_ContactUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 80 + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.fullName", + "is_nullable": false, + "source_path": "$.contactReference.contactUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Location", - "kind": "Scalar", + "name": "SurveyResponderChoiceStaff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 75 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.location", + "is_nullable": false, + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "ResponseDate", + "name": "SurveyResponderChoiceStaff_StaffUniqueId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.responseDate", + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ResponseTime", - "kind": "Scalar", + "name": "SurveyResponderChoiceStudent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.responseTime", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceContact_ContactUniqueId", + "name": "SurveyResponderChoiceStudent_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.contactReference.contactUniqueId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStaff_StaffUniqueId", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStudent_StudentUniqueId", + "name": "Survey_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponseIdentifier", + "name": "Survey_SurveyIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseIdentifier", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Survey_Namespace", + "name": "ElectronicMailAddress", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 128 }, - "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "is_nullable": true, + "source_path": "$.electronicMailAddress", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", + "name": "FullName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 80 }, - "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "is_nullable": true, + "source_path": "$.fullName", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceContact_DocumentId", - "kind": "DocumentFk", + "name": "Location", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 75 }, - "is_nullable": false, - "source_path": "$.contactReference", + "is_nullable": true, + "source_path": "$.location", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStaff_DocumentId", - "kind": "DocumentFk", + "name": "ResponseDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.responseDate", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStudent_DocumentId", - "kind": "DocumentFk", + "name": "ResponseTime", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.responseTime", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponseIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyResponseIdentifier", "storage": { "kind": "Stored" } @@ -98810,6 +98810,18 @@ "kind": "Stored" } }, + { + "name": "Section_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_LocalCourseCode", "kind": "Scalar", @@ -98847,19 +98859,6 @@ "kind": "Stored" } }, - { - "name": "Section_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Section_SessionName", "kind": "Scalar", @@ -98874,51 +98873,52 @@ } }, { - "name": "Survey_Namespace", + "name": "Section_SectionIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Survey_Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.sectionReference", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "Survey_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } @@ -99064,6 +99064,18 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", @@ -99077,14 +99089,13 @@ } }, { - "name": "SurveySectionResponse_SurveyResponseIdentifier", - "kind": "Scalar", + "name": "SurveySectionResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "source_path": "$.surveySectionResponseReference", "storage": { "kind": "Stored" } @@ -99115,6 +99126,19 @@ "kind": "Stored" } }, + { + "name": "SurveySectionResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "SurveySectionResponse_SurveySectionReferenceNamespace", "kind": "Scalar", @@ -99153,30 +99177,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveySectionResponse_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.surveySectionResponseReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -99319,6 +99319,18 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Staff_StaffUniqueId", "kind": "Scalar", @@ -99333,14 +99345,13 @@ } }, { - "name": "SurveySectionResponse_SurveyResponseIdentifier", - "kind": "Scalar", + "name": "SurveySectionResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "source_path": "$.surveySectionResponseReference", "storage": { "kind": "Stored" } @@ -99371,6 +99382,19 @@ "kind": "Stored" } }, + { + "name": "SurveySectionResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "SurveySectionResponse_SurveySectionReferenceNamespace", "kind": "Scalar", @@ -99409,30 +99433,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveySectionResponse_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.surveySectionResponseReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -99588,20 +99588,6 @@ "kind": "Stored" } }, - { - "name": "SectionRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 9, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.sectionRating", - "storage": { - "kind": "Stored" - } - }, { "name": "SurveyIdentifier_Unified", "kind": "Scalar", @@ -99615,32 +99601,6 @@ "kind": "Stored" } }, - { - "name": "SurveyResponse_SurveyResponseIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveySection_SurveySectionTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.surveySectionReference.surveySectionTitle", - "storage": { - "kind": "Stored" - } - }, { "name": "SurveyResponse_DocumentId", "kind": "DocumentFk", @@ -99683,6 +99643,19 @@ "presence_column": "SurveyResponse_DocumentId" } }, + { + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "SurveySection_DocumentId", "kind": "DocumentFk", @@ -99724,6 +99697,33 @@ "canonical_column": "SurveyIdentifier_Unified", "presence_column": "SurveySection_DocumentId" } + }, + { + "name": "SurveySection_SurveySectionTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.surveySectionReference.surveySectionTitle", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.sectionRating", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -99915,14 +99915,13 @@ } }, { - "name": "SurveySectionTitle", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveySectionTitle", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } @@ -99954,13 +99953,14 @@ } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "SurveySectionTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveySectionTitle", "storage": { "kind": "Stored" } @@ -100079,13 +100079,25 @@ } }, { - "name": "SurveyCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_Unified", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.surveyCategoryDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -100103,38 +100115,39 @@ } }, { - "name": "Namespace", - "kind": "Scalar", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.namespace", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "NumberAdministered", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.numberAdministered", + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "SchoolYear_DocumentId" } }, { - "name": "SchoolYear_Unified", - "kind": "Scalar", + "name": "Session_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.sessionReference", "storage": { "kind": "Stored" } @@ -100152,106 +100165,93 @@ } }, { - "name": "Session_SessionName", + "name": "Session_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.sessionReference.sessionName", + "source_path": "$.sessionReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Session_DocumentId" } }, { - "name": "SurveyIdentifier", + "name": "Session_SessionName", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, - "is_nullable": false, - "source_path": "$.surveyIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveyTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.surveyTitle", + "is_nullable": true, + "source_path": "$.sessionReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "SurveyCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationOrganizationReference", + "source_path": "$.surveyCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.namespace", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", + "name": "NumberAdministered", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", + "is_nullable": true, + "source_path": "$.numberAdministered", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "SchoolYear_DocumentId" + "kind": "Stored" } }, { - "name": "Session_DocumentId", - "kind": "DocumentFk", + "name": "SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.sessionReference", + "is_nullable": false, + "source_path": "$.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Session_SchoolYear", + "name": "SurveyTitle", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.sessionReference.schoolYear", + "is_nullable": false, + "source_path": "$.surveyTitle", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Session_DocumentId" + "kind": "Stored" } } ], diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.manifest.json b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.manifest.json index b5a5dbb6c..df4c87d9e 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.manifest.json +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/ds-5.2/expected/authoritative-relational-model.manifest.json @@ -97,37 +97,49 @@ } }, { - "name": "BeginDate", + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "BeginDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": false, - "source_path": "$.endDate", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -156,18 +168,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -318,6 +318,18 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", @@ -330,6 +342,30 @@ "kind": "Stored" } }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, { "name": "Rating", "kind": "Scalar", @@ -393,42 +429,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -678,39 +678,39 @@ } }, { - "name": "AssessmentAdministration_AdministrationIdentifier", - "kind": "Scalar", + "name": "AssessmentAdministration_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.administrationIdentifier", + "source_path": "$.assessmentAdministrationReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_AssessmentIdentifier", + "name": "AssessmentAdministration_AdministrationIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assessmentIdentifier", + "source_path": "$.assessmentAdministrationReference.administrationIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_AssigningEducationOrganizationId", + "name": "AssessmentAdministration_AssessmentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", + "source_path": "$.assessmentAdministrationReference.assessmentIdentifier", "storage": { "kind": "Stored" } @@ -729,37 +729,37 @@ } }, { - "name": "ParticipatingEducationOrganization_EducationOrganizationId", + "name": "AssessmentAdministration_AssigningEducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.participatingEducationOrganizationReference.educationOrganizationId", + "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_DocumentId", + "name": "ParticipatingEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference", + "source_path": "$.participatingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ParticipatingEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ParticipatingEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.participatingEducationOrganizationReference", + "source_path": "$.participatingEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -894,6 +894,18 @@ "kind": "Stored" } }, + { + "name": "AdministrationPointOfContactEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.administrationPointOfContacts[*].educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrationPointOfContactEducationOrganization_Ed_205063b290", "kind": "Scalar", @@ -957,18 +969,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "AdministrationPointOfContactEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.administrationPointOfContacts[*].educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -1072,14 +1072,13 @@ } }, { - "name": "AdministrationIdentifier", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.administrationIdentifier", + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } @@ -1111,37 +1110,38 @@ } }, { - "name": "AssigningEducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "AssigningEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assigningEducationOrganizationReference.educationOrganizationId", + "source_path": "$.assigningEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AssigningEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.assessmentReference", + "source_path": "$.assigningEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssigningEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "AdministrationIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assigningEducationOrganizationReference", + "source_path": "$.administrationIdentifier", "storage": { "kind": "Stored" } @@ -1282,6 +1282,18 @@ "kind": "Stored" } }, + { + "name": "AssessmentBatteryPart_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentBatteryParts[*].assessmentBatteryPartReference", + "storage": { + "kind": "Stored" + } + }, { "name": "AssessmentBatteryPart_AssessmentBatteryPartName", "kind": "Scalar", @@ -1320,18 +1332,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "AssessmentBatteryPart_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assessmentBatteryParts[*].assessmentBatteryPartReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -1566,14 +1566,13 @@ } }, { - "name": "AssessmentBatteryPartName", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 65 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartName", + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } @@ -1605,13 +1604,14 @@ } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentBatteryPartName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 65 }, "is_nullable": false, - "source_path": "$.assessmentReference", + "source_path": "$.assessmentBatteryPartName", "storage": { "kind": "Stored" } @@ -1725,27 +1725,26 @@ } }, { - "name": "ObjectiveAssessment_AssessmentIdentifier", - "kind": "Scalar", + "name": "ObjectiveAssessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", + "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference", "storage": { "kind": "Stored" } }, { - "name": "ObjectiveAssessment_IdentificationCode", + "name": "ObjectiveAssessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.identificationCode", + "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", "storage": { "kind": "Stored" } @@ -1764,13 +1763,14 @@ } }, { - "name": "ObjectiveAssessment_DocumentId", - "kind": "DocumentFk", + "name": "ObjectiveAssessment_IdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference", + "source_path": "$.objectiveAssessments[*].objectiveAssessmentReference.identificationCode", "storage": { "kind": "Stored" } @@ -1995,52 +1995,64 @@ } }, { - "name": "AssessmentItemCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.assessmentItemCategoryDescriptor", + "is_nullable": false, + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentItemURI", + "name": "Assessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.assessmentItemURI", + "is_nullable": false, + "source_path": "$.assessmentReference.assessmentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Assessment_AssessmentIdentifier", + "name": "Assessment_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assessmentReference.assessmentIdentifier", + "source_path": "$.assessmentReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Assessment_Namespace", + "name": "AssessmentItemCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentItemCategoryDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssessmentItemURI", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, - "is_nullable": false, - "source_path": "$.assessmentReference.namespace", + "is_nullable": true, + "source_path": "$.assessmentItemURI", "storage": { "kind": "Stored" } @@ -2110,18 +2122,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.assessmentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -2248,26 +2248,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -2525,18 +2525,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentReportingMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assessmentReportingMethodDescriptor", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentIdentifier_Unified", "kind": "Scalar", @@ -2550,32 +2538,6 @@ "kind": "Stored" } }, - { - "name": "MaximumScore", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 35 - }, - "is_nullable": false, - "source_path": "$.maximumScore", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MinimumScore", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 35 - }, - "is_nullable": false, - "source_path": "$.minimumScore", - "storage": { - "kind": "Stored" - } - }, { "name": "Namespace_Unified", "kind": "Scalar", @@ -2589,32 +2551,6 @@ "kind": "Stored" } }, - { - "name": "ObjectiveAssessment_IdentificationCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.objectiveAssessmentReference.identificationCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ScoreRangeId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.scoreRangeId", - "storage": { - "kind": "Stored" - } - }, { "name": "Assessment_DocumentId", "kind": "DocumentFk", @@ -2698,6 +2634,70 @@ "canonical_column": "Namespace_Unified", "presence_column": "ObjectiveAssessment_DocumentId" } + }, + { + "name": "ObjectiveAssessment_IdentificationCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.objectiveAssessmentReference.identificationCode", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssessmentReportingMethodDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentReportingMethodDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MaximumScore", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 35 + }, + "is_nullable": false, + "source_path": "$.maximumScore", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MinimumScore", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 35 + }, + "is_nullable": false, + "source_path": "$.minimumScore", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ScoreRangeId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.scoreRangeId", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -2861,26 +2861,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -3014,6 +3014,54 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MandatingEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MandatingEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "AssessmentCategoryDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -3201,30 +3249,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MandatingEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "MaxRawScore", "kind": "Scalar", @@ -3276,30 +3300,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MandatingEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -4371,13 +4371,13 @@ } }, { - "name": "SectionOrProgramChoiceProgram_ProgramTypeDescriptor__106025b7ce", - "kind": "DescriptorFk", + "name": "SectionOrProgramChoiceProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -4408,13 +4408,13 @@ } }, { - "name": "SectionOrProgramChoiceProgram_DocumentId", - "kind": "DocumentFk", + "name": "SectionOrProgramChoiceProgram_ProgramTypeDescriptor__106025b7ce", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -4679,6 +4679,18 @@ "kind": "Stored" } }, + { + "name": "SectionOrProgramChoiceSection_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sections[*].sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "SectionOrProgramChoiceSection_LocalCourseCode", "kind": "Scalar", @@ -4716,19 +4728,6 @@ "kind": "Stored" } }, - { - "name": "SectionOrProgramChoiceSection_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.sections[*].sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "SectionOrProgramChoiceSection_SessionName", "kind": "Scalar", @@ -4743,13 +4742,14 @@ } }, { - "name": "SectionOrProgramChoiceSection_DocumentId", - "kind": "DocumentFk", + "name": "SectionOrProgramChoiceSection_SectionIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.sections[*].sectionReference", + "source_path": "$.sections[*].sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } @@ -5373,6 +5373,30 @@ "kind": "Stored" } }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "AlternateDayName", "kind": "Scalar", @@ -5411,18 +5435,6 @@ "kind": "Stored" } }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "StartTime", "kind": "Scalar", @@ -5446,18 +5458,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -5555,38 +5555,38 @@ } }, { - "name": "ClassPeriod_ClassPeriodName", - "kind": "Scalar", + "name": "ClassPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", + "source_path": "$.classPeriods[*].classPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_SchoolId", + "name": "ClassPeriod_ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.schoolId", + "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_DocumentId", - "kind": "DocumentFk", + "name": "ClassPeriod_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference", + "source_path": "$.classPeriods[*].classPeriodReference.schoolId", "storage": { "kind": "Stored" } @@ -5920,6 +5920,18 @@ "kind": "Stored" } }, + { + "name": "Calendar_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.calendarReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Calendar_CalendarCode", "kind": "Scalar", @@ -5968,18 +5980,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.calendarReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -6250,38 +6250,37 @@ } }, { - "name": "CalendarTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.calendarTypeDescriptor", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "CalendarCode", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarCode", + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } @@ -6299,25 +6298,26 @@ } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "CalendarTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.calendarTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.calendarCode", "storage": { "kind": "Stored" } @@ -6619,69 +6619,6 @@ "kind": "Stored" } }, - { - "name": "AccountTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.accountTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AccountIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.accountIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AccountName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 100 - }, - "is_nullable": true, - "source_path": "$.accountName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BalanceSheetBalanceSheetDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.balanceSheetDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "FiscalYear_Unified", "kind": "Scalar", @@ -6695,118 +6632,26 @@ } }, { - "name": "FiscalYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.fiscalYear", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "FiscalYear_Unified", - "presence_column": null - } - }, - { - "name": "FunctionFunctionDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.functionDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "FundFundDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.fundDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ObjectObjectDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.objectDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "OperationalUnitOperationalUnitDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.operationalUnitDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgramDimension_Code", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 16 - }, - "is_nullable": true, - "source_path": "$.programDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProjectProjectDimension_Code", - "kind": "Scalar", + "name": "BalanceSheetBalanceSheetDimension_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 16 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.projectDimensionReference.code", + "source_path": "$.balanceSheetDimensionReference", "storage": { "kind": "Stored" } }, { - "name": "SourceSourceDimension_Code", + "name": "BalanceSheetBalanceSheetDimension_Code", "kind": "Scalar", "type": { "kind": "String", "max_length": 16 }, "is_nullable": true, - "source_path": "$.sourceDimensionReference.code", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BalanceSheetBalanceSheetDimension_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.balanceSheetDimensionReference", + "source_path": "$.balanceSheetDimensionReference.code", "storage": { "kind": "Stored" } @@ -6837,6 +6682,18 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "FunctionFunctionDimension_DocumentId", "kind": "DocumentFk", @@ -6849,6 +6706,19 @@ "kind": "Stored" } }, + { + "name": "FunctionFunctionDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.functionDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "FunctionFunctionDimension_FiscalYear", "kind": "Scalar", @@ -6875,6 +6745,19 @@ "kind": "Stored" } }, + { + "name": "FundFundDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.fundDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "FundFundDimension_FiscalYear", "kind": "Scalar", @@ -6901,6 +6784,19 @@ "kind": "Stored" } }, + { + "name": "ObjectObjectDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.objectDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "ObjectObjectDimension_FiscalYear", "kind": "Scalar", @@ -6927,6 +6823,19 @@ "kind": "Stored" } }, + { + "name": "OperationalUnitOperationalUnitDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.operationalUnitDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "OperationalUnitOperationalUnitDimension_FiscalYear", "kind": "Scalar", @@ -6953,6 +6862,19 @@ "kind": "Stored" } }, + { + "name": "ProgramProgramDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.programDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramProgramDimension_FiscalYear", "kind": "Scalar", @@ -6979,6 +6901,19 @@ "kind": "Stored" } }, + { + "name": "ProjectProjectDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.projectDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "ProjectProjectDimension_FiscalYear", "kind": "Scalar", @@ -7005,6 +6940,19 @@ "kind": "Stored" } }, + { + "name": "SourceSourceDimension_Code", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 16 + }, + "is_nullable": true, + "source_path": "$.sourceDimensionReference.code", + "storage": { + "kind": "Stored" + } + }, { "name": "SourceSourceDimension_FiscalYear", "kind": "Scalar", @@ -7018,6 +6966,58 @@ "canonical_column": "FiscalYear_Unified", "presence_column": "SourceSourceDimension_DocumentId" } + }, + { + "name": "AccountTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.accountTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AccountIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.accountIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AccountName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": true, + "source_path": "$.accountName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "FiscalYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.fiscalYear", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "FiscalYear_Unified", + "presence_column": null + } } ], "key_unification_classes": [ @@ -7680,50 +7680,50 @@ } }, { - "name": "ClassPeriodName", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.classPeriodName", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "OfficialAttendancePeriod", + "name": "School_SchoolId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.officialAttendancePeriod", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "OfficialAttendancePeriod", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.officialAttendancePeriod", "storage": { "kind": "Stored" } @@ -8011,6 +8011,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "AcademicSubjectDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -8072,30 +8096,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -8250,13 +8250,13 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -8287,13 +8287,13 @@ } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -10028,6 +10028,30 @@ "kind": "Stored" } }, + { + "name": "CommunityProvider_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.communityProviderReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CommunityProvider_CommunityProviderId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.communityProviderReference.communityProviderId", + "storage": { + "kind": "Stored" + } + }, { "name": "LicenseStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -10064,18 +10088,6 @@ "kind": "Stored" } }, - { - "name": "CommunityProvider_CommunityProviderId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.communityProviderReference.communityProviderId", - "storage": { - "kind": "Stored" - } - }, { "name": "LicenseEffectiveDate", "kind": "Scalar", @@ -10161,18 +10173,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CommunityProvider_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.communityProviderReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -10334,6 +10334,30 @@ "kind": "Stored" } }, + { + "name": "CommunityOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.communityOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CommunityOrganization_CommunityOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.communityOrganizationReference.communityOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "OperationalStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -10382,18 +10406,6 @@ "kind": "Stored" } }, - { - "name": "CommunityOrganization_CommunityOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.communityOrganizationReference.communityOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "CommunityProviderId", "kind": "Scalar", @@ -10468,18 +10480,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CommunityOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.communityOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -12114,6 +12114,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "ObjectiveGradeLevelDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -12152,18 +12176,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "Objective", "kind": "Scalar", @@ -12189,18 +12201,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -12364,13 +12364,26 @@ } }, { - "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Person_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.highestCompletedLevelOfEducationDescriptor", + "source_path": "$.personReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_PersonId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.personReference.personId", "storage": { "kind": "Stored" } @@ -12387,6 +12400,18 @@ "kind": "Stored" } }, + { + "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.highestCompletedLevelOfEducationDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "SexDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -12503,19 +12528,6 @@ "kind": "Stored" } }, - { - "name": "Person_PersonId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.personReference.personId", - "storage": { - "kind": "Stored" - } - }, { "name": "PersonalTitlePrefix", "kind": "Scalar", @@ -12554,18 +12566,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Person_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.personReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -14614,69 +14614,6 @@ "kind": "Stored" } }, - { - "name": "Course_CourseCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.courseReference.courseCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Course_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.courseReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "InstructionalTimePlanned", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.instructionalTimePlanned", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalCourseCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.localCourseCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalCourseTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.localCourseTitle", - "storage": { - "kind": "Stored" - } - }, { "name": "SchoolId_Unified", "kind": "Scalar", @@ -14690,38 +14627,38 @@ } }, { - "name": "Session_SchoolYear", - "kind": "Scalar", + "name": "Course_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sessionReference.schoolYear", + "source_path": "$.courseReference", "storage": { "kind": "Stored" } }, { - "name": "Session_SessionName", + "name": "Course_CourseCode", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.sessionReference.sessionName", + "source_path": "$.courseReference.courseCode", "storage": { "kind": "Stored" } }, { - "name": "Course_DocumentId", - "kind": "DocumentFk", + "name": "Course_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.courseReference", + "source_path": "$.courseReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -14777,6 +14714,69 @@ "canonical_column": "SchoolId_Unified", "presence_column": "Session_DocumentId" } + }, + { + "name": "Session_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.sessionReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Session_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.sessionReference.sessionName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "InstructionalTimePlanned", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.instructionalTimePlanned", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalCourseCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.localCourseCode", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalCourseTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.localCourseTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -15323,6 +15323,153 @@ "kind": "Stored" } }, + { + "name": "CourseCourse_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.courseReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CourseCourse_CourseCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.courseReference.courseCode", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CourseCourse_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.courseReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ExternalEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.externalEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ExternalEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.externalEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibleTeacherStaff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.responsibleTeacherStaffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibleTeacherStaff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.responsibleTeacherStaffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAcademicRecord_TermDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentAcademicRecordReference.termDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "AttemptedCreditTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -15383,18 +15530,6 @@ "kind": "Stored" } }, - { - "name": "StudentAcademicRecord_TermDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.termDescriptor", - "storage": { - "kind": "Stored" - } - }, { "name": "WhenTakenGradeLevelDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -15474,31 +15609,6 @@ "kind": "Stored" } }, - { - "name": "CourseCourse_CourseCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.courseReference.courseCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CourseCourse_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.courseReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "CourseTitle", "kind": "Scalar", @@ -15553,18 +15663,6 @@ "kind": "Stored" } }, - { - "name": "ExternalEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.externalEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "FinalLetterGradeEarned", "kind": "Scalar", @@ -15591,104 +15689,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ResponsibleTeacherStaff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.responsibleTeacherStaffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CourseCourse_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.courseReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ExternalEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.externalEducationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ResponsibleTeacherStaff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.responsibleTeacherStaffReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAcademicRecord_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentAcademicRecordReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -16222,13 +16222,13 @@ } }, { - "name": "CourseProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "CourseProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.coursePrograms[*].courseProgramReference.programTypeDescriptor", + "source_path": "$.coursePrograms[*].courseProgramReference", "storage": { "kind": "Stored" } @@ -16259,13 +16259,13 @@ } }, { - "name": "CourseProgram_DocumentId", - "kind": "DocumentFk", + "name": "CourseProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.coursePrograms[*].courseProgramReference", + "source_path": "$.coursePrograms[*].courseProgramReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -16736,6 +16736,18 @@ "kind": "Stored" } }, + { + "name": "Section_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sections[*].sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_LocalCourseCode", "kind": "Scalar", @@ -16773,19 +16785,6 @@ "kind": "Stored" } }, - { - "name": "Section_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.sections[*].sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Section_SessionName", "kind": "Scalar", @@ -16800,13 +16799,14 @@ } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Section_SectionIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.sections[*].sectionReference", + "source_path": "$.sections[*].sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } @@ -17126,6 +17126,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "CareerPathwayDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -17237,18 +17261,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "HighSchoolCourseRequirement", "kind": "Scalar", @@ -17352,18 +17364,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -17880,26 +17880,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -19686,6 +19686,79 @@ "kind": "Stored" } }, + { + "name": "AssignmentSchool_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assignmentSchoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssignmentSchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.assignmentSchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibilitySchool_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.responsibilitySchoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResponsibilitySchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.responsibilitySchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "DisciplineActionLengthDifferenceReasonDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -19712,18 +19785,6 @@ "kind": "Stored" } }, - { - "name": "AssignmentSchool_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.assignmentSchoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "DisciplineActionIdentifier", "kind": "Scalar", @@ -19786,67 +19847,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ResponsibilitySchool_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.responsibilitySchoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AssignmentSchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assignmentSchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ResponsibilitySchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.responsibilitySchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -20110,26 +20110,26 @@ } }, { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.staffs[*].staffReference.staffUniqueId", + "source_path": "$.staffs[*].staffReference", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "Staff_StaffUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.staffs[*].staffReference", + "source_path": "$.staffs[*].staffReference.staffUniqueId", "storage": { "kind": "Stored" } @@ -20221,6 +20221,18 @@ "kind": "Stored" } }, + { + "name": "StudentDisciplineIncidentBehaviorAssociation_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.studentDisciplineIncidentBehaviorAssociations[*].studentDisciplineIncidentBehaviorAssociationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "StudentDisciplineIncidentBehaviorAssociation_Behavio_4bed9fbe3b", "kind": "DescriptorFk", @@ -20270,18 +20282,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "StudentDisciplineIncidentBehaviorAssociation_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.studentDisciplineIncidentBehaviorAssociations[*].studentDisciplineIncidentBehaviorAssociationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -20502,6 +20502,30 @@ "kind": "Stored" } }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "IncidentLocationDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -20627,30 +20651,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -21251,6 +21251,31 @@ "kind": "Stored" } }, + { + "name": "LearningResourceChoiceLearningResourceLearningStanda_5916be65e2", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.learningStandardReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LearningResourceChoiceLearningResourceLearningStanda_bd2bbf48c0", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.learningStandardReference.learningStandardId", + "storage": { + "kind": "Stored" + } + }, { "name": "ContentClassDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -21339,19 +21364,6 @@ "kind": "Stored" } }, - { - "name": "LearningResourceChoiceLearningResourceLearningStanda_bd2bbf48c0", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.learningStandardReference.learningStandardId", - "storage": { - "kind": "Stored" - } - }, { "name": "LearningResourceMetadataURI", "kind": "Scalar", @@ -21466,18 +21478,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "LearningResourceChoiceLearningResourceLearningStanda_5916be65e2", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.learningStandardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -21906,26 +21906,26 @@ } }, { - "name": "DerivativeSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "DerivativeSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference.contentIdentifier", + "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference", "storage": { "kind": "Stored" } }, { - "name": "DerivativeSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "DerivativeSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference", + "source_path": "$.derivativeSourceEducationContents[*].derivativeSourceEducationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -22423,13 +22423,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.beginDate", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -22447,13 +22447,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "InterventionPrescriptionInterventionPrescription_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.interventionPrescriptionReference", "storage": { "kind": "Stored" } @@ -22484,25 +22484,25 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.interventionPrescriptionReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -22637,13 +22637,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "EducationOrganizationNetwork_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.beginDate", + "is_nullable": false, + "source_path": "$.educationOrganizationNetworkReference", "storage": { "kind": "Stored" } @@ -22661,13 +22661,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "MemberEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.memberEducationOrganizationReference", "storage": { "kind": "Stored" } @@ -22685,25 +22685,25 @@ } }, { - "name": "EducationOrganizationNetwork_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationNetworkReference", + "is_nullable": true, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "MemberEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.memberEducationOrganizationReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -24439,49 +24439,49 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "PeerEducationOrganization_EducationOrganizationId", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.peerEducationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", + "name": "PeerEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.peerEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "PeerEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "PeerEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.peerEducationOrganizationReference", + "source_path": "$.peerEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -24632,6 +24632,30 @@ "kind": "Stored" } }, + { + "name": "StateEducationAgency_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StateEducationAgency_StateEducationAgencyId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", + "storage": { + "kind": "Stored" + } + }, { "name": "OperationalStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -24682,18 +24706,6 @@ "kind": "Stored" } }, - { - "name": "StateEducationAgency_StateEducationAgencyId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", - "storage": { - "kind": "Stored" - } - }, { "name": "WebSite", "kind": "Scalar", @@ -24706,18 +24718,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "StateEducationAgency_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.stateEducationAgencyReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -26426,149 +26426,149 @@ } }, { - "name": "EvaluationRubricRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluationElement_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.evaluationRubricRatingLevelDescriptor", + "is_nullable": false, + "source_path": "$.programEvaluationElementReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationPeriodDesc_cc4f929706", - "kind": "DescriptorFk", + "name": "ProgramEvaluationElement_ProgramEvaluationElementTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationPeriodDescriptor", + "source_path": "$.programEvaluationElementReference.programEvaluationElementTitle", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationTypeDescri_18bd7f7e71", - "kind": "DescriptorFk", + "name": "ProgramEvaluationElement_ProgramEducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationElementReference.programEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluationElement_ProgramEvaluationPeriodDesc_cc4f929706", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programTypeDescriptor", + "source_path": "$.programEvaluationElementReference.programEvaluationPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationCriterionDescription", + "name": "ProgramEvaluationElement_ProgramEvaluationTitle", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 50 }, "is_nullable": false, - "source_path": "$.evaluationCriterionDescription", + "source_path": "$.programEvaluationElementReference.programEvaluationTitle", "storage": { "kind": "Stored" } }, { - "name": "EvaluationRubricRating", - "kind": "Scalar", + "name": "ProgramEvaluationElement_ProgramEvaluationTypeDescri_18bd7f7e71", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.evaluationRubricRating", + "source_path": "$.programEvaluationElementReference.programEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEducationOrganizationId", + "name": "ProgramEvaluationElement_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEducationOrganizationId", + "source_path": "$.programEvaluationElementReference.programName", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationElementTitle", - "kind": "Scalar", + "name": "ProgramEvaluationElement_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationElementTitle", + "source_path": "$.programEvaluationElementReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramEvaluationTitle", - "kind": "Scalar", + "name": "EvaluationRubricRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programEvaluationTitle", + "is_nullable": true, + "source_path": "$.evaluationRubricRatingLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_ProgramName", + "name": "EvaluationCriterionDescription", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, "is_nullable": false, - "source_path": "$.programEvaluationElementReference.programName", + "source_path": "$.evaluationCriterionDescription", "storage": { "kind": "Stored" } }, { - "name": "RubricDimensionSortOrder", + "name": "EvaluationRubricRating", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.rubricDimensionSortOrder", + "is_nullable": false, + "source_path": "$.evaluationRubricRating", "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElement_DocumentId", - "kind": "DocumentFk", + "name": "RubricDimensionSortOrder", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.programEvaluationElementReference", + "is_nullable": true, + "source_path": "$.rubricDimensionSortOrder", "storage": { "kind": "Stored" } @@ -26849,86 +26849,86 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "FeederSchool_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.feederSchoolReference", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "FeederSchool_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.feederSchoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "FeederRelationshipDescription", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.feederRelationshipDescription", + "is_nullable": false, + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "FeederSchool_SchoolId", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.feederSchoolReference.schoolId", + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "FeederSchool_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.feederSchoolReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "FeederRelationshipDescription", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.feederRelationshipDescription", "storage": { "kind": "Stored" } @@ -27605,164 +27605,156 @@ } }, { - "name": "GradebookEntryTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.gradebookEntryTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriod_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "DateAssigned", + "name": "SchoolYear_Unified", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.dateAssigned", + "is_nullable": true, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "Description", - "kind": "Scalar", + "name": "GradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.description", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "DueDate", - "kind": "Scalar", + "name": "GradingPeriod_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.dueDate", + "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "DueTime", + "name": "GradingPeriod_GradingPeriodName", "kind": "Scalar", "type": { - "kind": "Time" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.dueTime", + "source_path": "$.gradingPeriodReference.gradingPeriodName", "storage": { "kind": "Stored" } }, { - "name": "GradebookEntryIdentifier", + "name": "GradingPeriod_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.gradebookEntryIdentifier", + "is_nullable": true, + "source_path": "$.gradingPeriodReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "GradingPeriod_DocumentId" } }, { - "name": "GradingPeriod_GradingPeriodName", + "name": "GradingPeriod_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference.gradingPeriodName", + "source_path": "$.gradingPeriodReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "GradingPeriod_DocumentId" } }, { - "name": "MaxPoints", - "kind": "Scalar", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.maxPoints", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } }, { - "name": "Namespace", + "name": "Section_LocalCourseCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, - "is_nullable": false, - "source_path": "$.namespace", + "is_nullable": true, + "source_path": "$.sectionReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "Section_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": null, + "source_path": "$.sectionReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Section_DocumentId" } }, { - "name": "SchoolYear_Unified", + "name": "Section_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": null, + "source_path": "$.sectionReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Section_DocumentId" } }, { - "name": "Section_LocalCourseCode", + "name": "Section_SessionName", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.sectionReference.localCourseCode", + "source_path": "$.sectionReference.sessionName", "storage": { "kind": "Stored" } @@ -27781,122 +27773,130 @@ } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "GradebookEntryTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.gradebookEntryTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SourceSectionIdentifier", + "name": "DateAssigned", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sourceSectionIdentifier", + "source_path": "$.dateAssigned", "storage": { "kind": "Stored" } }, { - "name": "Title", + "name": "Description", "kind": "Scalar", "type": { "kind": "String", - "max_length": 100 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.title", + "is_nullable": true, + "source_path": "$.description", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriod_DocumentId", - "kind": "DocumentFk", + "name": "DueDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference", + "source_path": "$.dueDate", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriod_SchoolId", + "name": "DueTime", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Time" }, "is_nullable": true, - "source_path": "$.gradingPeriodReference.schoolId", + "source_path": "$.dueTime", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "GradingPeriod_DocumentId" + "kind": "Stored" } }, { - "name": "GradingPeriod_SchoolYear", + "name": "GradebookEntryIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.gradingPeriodReference.schoolYear", + "is_nullable": false, + "source_path": "$.gradebookEntryIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "GradingPeriod_DocumentId" + "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "MaxPoints", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 9, + "scale": 2 }, "is_nullable": true, - "source_path": "$.sectionReference", + "source_path": "$.maxPoints", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolId", + "name": "Namespace", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.sectionReference.schoolId", + "is_nullable": false, + "source_path": "$.namespace", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" } }, { - "name": "Section_SchoolYear", + "name": "SourceSectionIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.sectionReference.schoolYear", + "is_nullable": false, + "source_path": "$.sourceSectionIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" + } + }, + { + "name": "Title", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": false, + "source_path": "$.title", + "storage": { + "kind": "Stored" } } ], @@ -28098,26 +28098,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -28284,132 +28284,6 @@ "kind": "Stored" } }, - { - "name": "GradeTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.gradeTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PerformanceBaseConversionDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.performanceBaseConversionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CurrentGradeAsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.currentGradeAsOfDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CurrentGradeIndicator", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.currentGradeIndicator", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DiagnosticStatement", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.diagnosticStatement", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradeEarnedDescription", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 64 - }, - "is_nullable": true, - "source_path": "$.gradeEarnedDescription", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriodGradingPeriod_GradingPeriodName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LetterGradeEarned", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 20 - }, - "is_nullable": true, - "source_path": "$.letterGradeEarned", - "storage": { - "kind": "Stored" - } - }, - { - "name": "NumericGradeEarned", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 - }, - "is_nullable": true, - "source_path": "$.numericGradeEarned", - "storage": { - "kind": "Stored" - } - }, { "name": "SchoolId_Unified", "kind": "Scalar", @@ -28435,77 +28309,38 @@ } }, { - "name": "StudentSectionAssociation_BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.beginDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentSectionAssociation_LocalCourseCode", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.localCourseCode", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSectionAssociation_SectionIdentifier", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.sectionIdentifier", + "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentSectionAssociation_SessionName", + "name": "GradingPeriodGradingPeriod_GradingPeriodName", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.sessionName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentSectionAssociation_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentSectionAssociationReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GradingPeriodGradingPeriod_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference", + "source_path": "$.gradingPeriodReference.gradingPeriodName", "storage": { "kind": "Stored" } @@ -28550,6 +28385,31 @@ "kind": "Stored" } }, + { + "name": "StudentSectionAssociation_BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentSectionAssociation_LocalCourseCode", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.localCourseCode", + "storage": { + "kind": "Stored" + } + }, { "name": "StudentSectionAssociation_SchoolId", "kind": "Scalar", @@ -28577,6 +28437,146 @@ "canonical_column": "SchoolYear_Unified", "presence_column": "StudentSectionAssociation_DocumentId" } + }, + { + "name": "StudentSectionAssociation_SectionIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.sectionIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentSectionAssociation_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.sessionName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentSectionAssociation_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentSectionAssociationReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GradeTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.gradeTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PerformanceBaseConversionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.performanceBaseConversionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CurrentGradeAsOfDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.currentGradeAsOfDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CurrentGradeIndicator", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.currentGradeIndicator", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DiagnosticStatement", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.diagnosticStatement", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GradeEarnedDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 64 + }, + "is_nullable": true, + "source_path": "$.gradeEarnedDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LetterGradeEarned", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 20 + }, + "is_nullable": true, + "source_path": "$.letterGradeEarned", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NumericGradeEarned", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.numericGradeEarned", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -28810,39 +28810,51 @@ } }, { - "name": "PerformanceBaseConversionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LearningStandardGradeLearningStandard_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.learningStandardGrades[*].performanceBaseConversionDescriptor", + "is_nullable": false, + "source_path": "$.learningStandardGrades[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "DiagnosticStatement", + "name": "LearningStandardGradeLearningStandard_LearningStandardId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.learningStandardGrades[*].learningStandardReference.learningStandardId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PerformanceBaseConversionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandardGrades[*].diagnosticStatement", + "source_path": "$.learningStandardGrades[*].performanceBaseConversionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LearningStandardGradeLearningStandard_LearningStandardId", + "name": "DiagnosticStatement", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.learningStandardGrades[*].learningStandardReference.learningStandardId", + "is_nullable": true, + "source_path": "$.learningStandardGrades[*].diagnosticStatement", "storage": { "kind": "Stored" } @@ -28873,18 +28885,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "LearningStandardGradeLearningStandard_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.learningStandardGrades[*].learningStandardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -29098,6 +29098,54 @@ "kind": "Stored" } }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "School_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "GradingPeriodDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -29159,30 +29207,6 @@ "kind": "Stored" } }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "TotalInstructionalDays", "kind": "Scalar", @@ -29194,30 +29218,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -29409,37 +29409,37 @@ } }, { - "name": "GraduationPlanTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.graduationPlanTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "TotalRequiredCreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.totalRequiredCreditTypeDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "GraduationSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.graduationSchoolYearTypeReference", "storage": { "kind": "Stored" } @@ -29456,6 +29456,30 @@ "kind": "Stored" } }, + { + "name": "GraduationPlanTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.graduationPlanTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "TotalRequiredCreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.totalRequiredCreditTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "IndividualPlan", "kind": "Scalar", @@ -29495,30 +29519,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GraduationSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.graduationSchoolYearTypeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -30004,154 +30004,192 @@ } }, { - "name": "AcademicSubjectDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AcademicSubjectDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.creditsBySubjects[*].academicSubjectDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.creditsBySubjects[*].creditTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CreditConversion", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.creditsBySubjects[*].creditConversion", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Credits", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 3 + }, + "is_nullable": false, + "source_path": "$.creditsBySubjects[*].credits", + "storage": { + "kind": "Stored" + } + } + ], + "key_unification_classes": [], + "descriptor_fk_deduplications": [], + "constraints": [ + { + "kind": "Unique", + "name": "UX_GraduationPlanCreditsBySubject_AcademicSubjectDes_84b3f31eab", + "columns": [ + "GraduationPlan_DocumentId", + "AcademicSubjectDescriptor_DescriptorId" + ] + }, + { + "kind": "ForeignKey", + "name": "FK_GraduationPlanCreditsBySubject_AcademicSubjectDescriptor", + "columns": [ + "AcademicSubjectDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_GraduationPlanCreditsBySubject_CreditTypeDescriptor", + "columns": [ + "CreditTypeDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_GraduationPlanCreditsBySubject_GraduationPlan", + "columns": [ + "GraduationPlan_DocumentId" + ], + "target_table": { + "schema": "edfi", + "name": "GraduationPlan" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "Cascade", + "on_update": "NoAction" + } + ] + }, + { + "schema": "edfi", + "name": "GraduationPlanRequiredAssessment", + "scope": "$.requiredAssessments[*]", + "key_columns": [ + { + "name": "GraduationPlan_DocumentId", + "kind": "ParentKeyPart" + }, + { + "name": "Ordinal", + "kind": "Ordinal" + } + ], + "columns": [ + { + "name": "GraduationPlan_DocumentId", + "kind": "ParentKeyPart", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Ordinal", + "kind": "Ordinal", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "RequiredAssessmentAssessment_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.creditsBySubjects[*].academicSubjectDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.creditsBySubjects[*].creditTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CreditConversion", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 - }, - "is_nullable": true, - "source_path": "$.creditsBySubjects[*].creditConversion", + "source_path": "$.requiredAssessments[*].assessmentReference", "storage": { "kind": "Stored" } }, { - "name": "Credits", + "name": "RequiredAssessmentAssessment_AssessmentIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 3 - }, - "is_nullable": false, - "source_path": "$.creditsBySubjects[*].credits", - "storage": { - "kind": "Stored" - } - } - ], - "key_unification_classes": [], - "descriptor_fk_deduplications": [], - "constraints": [ - { - "kind": "Unique", - "name": "UX_GraduationPlanCreditsBySubject_AcademicSubjectDes_84b3f31eab", - "columns": [ - "GraduationPlan_DocumentId", - "AcademicSubjectDescriptor_DescriptorId" - ] - }, - { - "kind": "ForeignKey", - "name": "FK_GraduationPlanCreditsBySubject_AcademicSubjectDescriptor", - "columns": [ - "AcademicSubjectDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_GraduationPlanCreditsBySubject_CreditTypeDescriptor", - "columns": [ - "CreditTypeDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_GraduationPlanCreditsBySubject_GraduationPlan", - "columns": [ - "GraduationPlan_DocumentId" - ], - "target_table": { - "schema": "edfi", - "name": "GraduationPlan" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "Cascade", - "on_update": "NoAction" - } - ] - }, - { - "schema": "edfi", - "name": "GraduationPlanRequiredAssessment", - "scope": "$.requiredAssessments[*]", - "key_columns": [ - { - "name": "GraduationPlan_DocumentId", - "kind": "ParentKeyPart" - }, - { - "name": "Ordinal", - "kind": "Ordinal" - } - ], - "columns": [ - { - "name": "GraduationPlan_DocumentId", - "kind": "ParentKeyPart", - "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": null, + "source_path": "$.requiredAssessments[*].assessmentReference.assessmentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Ordinal", - "kind": "Ordinal", + "name": "RequiredAssessmentAssessment_Namespace", + "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": null, + "source_path": "$.requiredAssessments[*].assessmentReference.namespace", "storage": { "kind": "Stored" } @@ -30192,32 +30230,6 @@ "kind": "Stored" } }, - { - "name": "RequiredAssessmentAssessment_AssessmentIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.requiredAssessments[*].assessmentReference.assessmentIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "RequiredAssessmentAssessment_Namespace", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.requiredAssessments[*].assessmentReference.namespace", - "storage": { - "kind": "Stored" - } - }, { "name": "RequiredMaximumScore", "kind": "Scalar", @@ -30256,18 +30268,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "RequiredAssessmentAssessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.requiredAssessments[*].assessmentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -30432,38 +30432,38 @@ } }, { - "name": "CourseCourse_CourseCode", - "kind": "Scalar", + "name": "CourseCourse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.creditsByCourses[*].courses[*].courseReference.courseCode", + "source_path": "$.creditsByCourses[*].courses[*].courseReference", "storage": { "kind": "Stored" } }, { - "name": "CourseCourse_EducationOrganizationId", + "name": "CourseCourse_CourseCode", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.creditsByCourses[*].courses[*].courseReference.educationOrganizationId", + "source_path": "$.creditsByCourses[*].courses[*].courseReference.courseCode", "storage": { "kind": "Stored" } }, { - "name": "CourseCourse_DocumentId", - "kind": "DocumentFk", + "name": "CourseCourse_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.creditsByCourses[*].courses[*].courseReference", + "source_path": "$.creditsByCourses[*].courses[*].courseReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -31246,37 +31246,49 @@ } }, { - "name": "DeliveryMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.deliveryMethodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionClassDescriptor_DescriptorId", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DeliveryMethodDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.interventionClassDescriptor", + "source_path": "$.deliveryMethodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "InterventionClassDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.interventionClassDescriptor", "storage": { "kind": "Stored" } @@ -31330,18 +31342,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -31771,26 +31771,26 @@ } }, { - "name": "EducationContentSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "EducationContentSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", + "source_path": "$.educationContents[*].educationContentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationContentSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "EducationContentSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference", + "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -32228,37 +32228,37 @@ } }, { - "name": "DeliveryMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.deliveryMethodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionClassDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.interventionClassDescriptor", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "InterventionPrescriptionInterventionPrescription_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.interventionPrescriptionReference", "storage": { "kind": "Stored" } @@ -32289,50 +32289,50 @@ } }, { - "name": "InterventionStudyIdentificationCode", - "kind": "Scalar", + "name": "DeliveryMethodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.interventionStudyIdentificationCode", + "source_path": "$.deliveryMethodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Participants", - "kind": "Scalar", + "name": "InterventionClassDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.participants", + "source_path": "$.interventionClassDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "InterventionStudyIdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.interventionStudyIdentificationCode", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_DocumentId", - "kind": "DocumentFk", + "name": "Participants", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.interventionPrescriptionReference", + "source_path": "$.participants", "storage": { "kind": "Stored" } @@ -32688,26 +32688,26 @@ } }, { - "name": "EducationContentSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "EducationContentSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", + "source_path": "$.educationContents[*].educationContentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationContentSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "EducationContentSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference", + "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -33489,49 +33489,61 @@ } }, { - "name": "DeliveryMethodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.deliveryMethodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionClassDescriptor_DescriptorId", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DeliveryMethodDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.interventionClassDescriptor", + "source_path": "$.deliveryMethodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "InterventionClassDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.interventionClassDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } @@ -33597,18 +33609,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -34038,26 +34038,26 @@ } }, { - "name": "EducationContentSourceEducationContent_ContentIdentifier", - "kind": "Scalar", + "name": "EducationContentSourceEducationContent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 225 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", + "source_path": "$.educationContents[*].educationContentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationContentSourceEducationContent_DocumentId", - "kind": "DocumentFk", + "name": "EducationContentSourceEducationContent_ContentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 225 }, "is_nullable": true, - "source_path": "$.educationContents[*].educationContentReference", + "source_path": "$.educationContents[*].educationContentReference.contentIdentifier", "storage": { "kind": "Stored" } @@ -34150,38 +34150,38 @@ } }, { - "name": "InterventionPrescriptionInterventionPrescription_Edu_532babb247", - "kind": "Scalar", + "name": "InterventionPrescriptionInterventionPrescription_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.educationOrganizationId", + "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_Int_409fc39d28", + "name": "InterventionPrescriptionInterventionPrescription_Edu_532babb247", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.interventionPrescriptionIdentificationCode", + "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "InterventionPrescriptionInterventionPrescription_DocumentId", - "kind": "DocumentFk", + "name": "InterventionPrescriptionInterventionPrescription_Int_409fc39d28", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference", + "source_path": "$.interventionPrescriptions[*].interventionPrescriptionReference.interventionPrescriptionIdentificationCode", "storage": { "kind": "Stored" } @@ -34453,98 +34453,110 @@ } }, { - "name": "PopulationServedDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.populationServeds[*].populationServedDescriptor", - "storage": { - "kind": "Stored" - } - } - ], - "key_unification_classes": [], - "descriptor_fk_deduplications": [], - "constraints": [ - { - "kind": "Unique", - "name": "UX_InterventionPopulationServed_Intervention_Documen_bbffd68f0d", - "columns": [ - "Intervention_DocumentId", - "PopulationServedDescriptor_DescriptorId" - ] - }, - { - "kind": "ForeignKey", - "name": "FK_InterventionPopulationServed_Intervention", - "columns": [ - "Intervention_DocumentId" - ], - "target_table": { - "schema": "edfi", - "name": "Intervention" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "Cascade", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_InterventionPopulationServed_PopulationServedDescriptor", - "columns": [ - "PopulationServedDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - } - ] - }, - { - "schema": "edfi", - "name": "InterventionStaff", - "scope": "$.staffs[*]", - "key_columns": [ - { - "name": "Intervention_DocumentId", - "kind": "ParentKeyPart" - }, - { - "name": "Ordinal", - "kind": "Ordinal" - } - ], - "columns": [ - { - "name": "Intervention_DocumentId", - "kind": "ParentKeyPart", + "name": "PopulationServedDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.populationServeds[*].populationServedDescriptor", + "storage": { + "kind": "Stored" + } + } + ], + "key_unification_classes": [], + "descriptor_fk_deduplications": [], + "constraints": [ + { + "kind": "Unique", + "name": "UX_InterventionPopulationServed_Intervention_Documen_bbffd68f0d", + "columns": [ + "Intervention_DocumentId", + "PopulationServedDescriptor_DescriptorId" + ] + }, + { + "kind": "ForeignKey", + "name": "FK_InterventionPopulationServed_Intervention", + "columns": [ + "Intervention_DocumentId" + ], + "target_table": { + "schema": "edfi", + "name": "Intervention" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "Cascade", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_InterventionPopulationServed_PopulationServedDescriptor", + "columns": [ + "PopulationServedDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + } + ] + }, + { + "schema": "edfi", + "name": "InterventionStaff", + "scope": "$.staffs[*]", + "key_columns": [ + { + "name": "Intervention_DocumentId", + "kind": "ParentKeyPart" + }, + { + "name": "Ordinal", + "kind": "Ordinal" + } + ], + "columns": [ + { + "name": "Intervention_DocumentId", + "kind": "ParentKeyPart", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Ordinal", + "kind": "Ordinal", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "Ordinal", - "kind": "Ordinal", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.staffs[*].staffReference", "storage": { "kind": "Stored" } @@ -34561,18 +34573,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.staffs[*].staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -34908,101 +34908,101 @@ } }, { - "name": "LearningStandardEquivalenceStrengthDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SourceLearningStandard_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.learningStandardEquivalenceStrengthDescriptor", + "is_nullable": false, + "source_path": "$.sourceLearningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "EffectiveDate", + "name": "SourceLearningStandard_LearningStandardId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.effectiveDate", + "is_nullable": false, + "source_path": "$.sourceLearningStandardReference.learningStandardId", "storage": { "kind": "Stored" } }, { - "name": "LearningStandardEquivalenceStrengthDescription", - "kind": "Scalar", + "name": "TargetLearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.learningStandardEquivalenceStrengthDescription", + "is_nullable": false, + "source_path": "$.targetLearningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "Namespace", + "name": "TargetLearningStandard_LearningStandardId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.namespace", + "source_path": "$.targetLearningStandardReference.learningStandardId", "storage": { "kind": "Stored" } }, { - "name": "SourceLearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandardEquivalenceStrengthDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sourceLearningStandardReference.learningStandardId", + "is_nullable": true, + "source_path": "$.learningStandardEquivalenceStrengthDescriptor", "storage": { "kind": "Stored" } }, { - "name": "TargetLearningStandard_LearningStandardId", + "name": "EffectiveDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.targetLearningStandardReference.learningStandardId", + "is_nullable": true, + "source_path": "$.effectiveDate", "storage": { "kind": "Stored" } }, { - "name": "SourceLearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandardEquivalenceStrengthDescription", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.sourceLearningStandardReference", + "is_nullable": true, + "source_path": "$.learningStandardEquivalenceStrengthDescription", "storage": { "kind": "Stored" } }, { - "name": "TargetLearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.targetLearningStandardReference", + "source_path": "$.namespace", "storage": { "kind": "Stored" } @@ -35204,6 +35204,55 @@ "kind": "Stored" } }, + { + "name": "MandatingEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MandatingEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ParentLearningStandard_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.parentLearningStandardReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ParentLearningStandard_LearningStandardId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.parentLearningStandardReference.learningStandardId", + "storage": { + "kind": "Stored" + } + }, { "name": "ContentStandardPublicationStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -35379,18 +35428,6 @@ "kind": "Stored" } }, - { - "name": "MandatingEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "Namespace", "kind": "Scalar", @@ -35404,19 +35441,6 @@ "kind": "Stored" } }, - { - "name": "ParentLearningStandard_LearningStandardId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.parentLearningStandardReference.learningStandardId", - "storage": { - "kind": "Stored" - } - }, { "name": "SuccessCriteria", "kind": "Scalar", @@ -35442,30 +35466,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "MandatingEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.contentStandard.mandatingEducationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ParentLearningStandard_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.parentLearningStandardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -36167,27 +36167,25 @@ } }, { - "name": "AccountIdentifier", + "name": "FiscalYear_Unified", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.accountIdentifier", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "AccountName", - "kind": "Scalar", + "name": "ChartOfAccountChartOfAccount_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 100 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.accountName", + "is_nullable": false, + "source_path": "$.chartOfAccountReference", "storage": { "kind": "Stored" } @@ -36218,79 +36216,81 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ChartOfAccountChartOfAccount_FiscalYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.chartOfAccountReference.fiscalYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "FiscalYear_Unified", + "presence_column": "ChartOfAccountChartOfAccount_DocumentId" } }, { - "name": "FiscalYear_Unified", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "FiscalYear", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.fiscalYear", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "FiscalYear_Unified", - "presence_column": null + "kind": "Stored" } }, { - "name": "ChartOfAccountChartOfAccount_DocumentId", - "kind": "DocumentFk", + "name": "AccountIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.chartOfAccountReference", + "source_path": "$.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "ChartOfAccountChartOfAccount_FiscalYear", + "name": "AccountName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 100 }, - "is_nullable": false, - "source_path": "$.chartOfAccountReference.fiscalYear", + "is_nullable": true, + "source_path": "$.accountName", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "FiscalYear_Unified", - "presence_column": "ChartOfAccountChartOfAccount_DocumentId" + "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "FiscalYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.fiscalYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "FiscalYear_Unified", + "presence_column": null } } ], @@ -36581,88 +36581,88 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", + "is_nullable": false, + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } }, { - "name": "Amount", + "name": "LocalAccount_AccountIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.amount", + "source_path": "$.localAccountReference.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AsOfDate", + "name": "LocalAccount_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_AccountIdentifier", + "name": "LocalAccount_FiscalYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.localAccountReference.accountIdentifier", + "source_path": "$.localAccountReference.fiscalYear", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_EducationOrganizationId", - "kind": "Scalar", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localAccountReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_FiscalYear", + "name": "Amount", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 19, + "scale": 4 }, "is_nullable": false, - "source_path": "$.localAccountReference.fiscalYear", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -36804,88 +36804,88 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", + "is_nullable": false, + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } }, { - "name": "Amount", + "name": "LocalAccount_AccountIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.amount", + "source_path": "$.localAccountReference.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AsOfDate", + "name": "LocalAccount_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_AccountIdentifier", + "name": "LocalAccount_FiscalYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.localAccountReference.accountIdentifier", + "source_path": "$.localAccountReference.fiscalYear", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_EducationOrganizationId", - "kind": "Scalar", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localAccountReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_FiscalYear", + "name": "Amount", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 19, + "scale": 4 }, "is_nullable": false, - "source_path": "$.localAccountReference.fiscalYear", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -37027,39 +37027,13 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Amount", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 - }, "is_nullable": false, - "source_path": "$.amount", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } @@ -37101,6 +37075,18 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Staff_StaffUniqueId", "kind": "Scalar", @@ -37115,25 +37101,39 @@ } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Amount", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 19, + "scale": 4 + }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -37302,160 +37302,160 @@ } }, { - "name": "CharterStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationServiceCenter_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.charterStatusDescriptor", + "source_path": "$.educationServiceCenterReference", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationServiceCenter_EducationServiceCenterId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.localEducationAgencyCategoryDescriptor", + "is_nullable": true, + "source_path": "$.educationServiceCenterReference.educationServiceCenterId", "storage": { "kind": "Stored" } }, { - "name": "OperationalStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ParentLocalEducationAgency_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.operationalStatusDescriptor", + "source_path": "$.parentLocalEducationAgencyReference", "storage": { "kind": "Stored" } }, { - "name": "EducationServiceCenter_EducationServiceCenterId", + "name": "ParentLocalEducationAgency_LocalEducationAgencyId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": "$.educationServiceCenterReference.educationServiceCenterId", + "source_path": "$.parentLocalEducationAgencyReference.localEducationAgencyId", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyId", - "kind": "Scalar", + "name": "StateEducationAgency_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localEducationAgencyId", + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference", "storage": { "kind": "Stored" } }, { - "name": "NameOfInstitution", + "name": "StateEducationAgency_StateEducationAgencyId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 75 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.nameOfInstitution", + "is_nullable": true, + "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", "storage": { "kind": "Stored" } }, { - "name": "ParentLocalEducationAgency_LocalEducationAgencyId", - "kind": "Scalar", + "name": "CharterStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.parentLocalEducationAgencyReference.localEducationAgencyId", + "source_path": "$.charterStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ShortNameOfInstitution", - "kind": "Scalar", + "name": "LocalEducationAgencyCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 75 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.shortNameOfInstitution", + "is_nullable": false, + "source_path": "$.localEducationAgencyCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StateEducationAgency_StateEducationAgencyId", - "kind": "Scalar", + "name": "OperationalStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.stateEducationAgencyReference.stateEducationAgencyId", + "source_path": "$.operationalStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "WebSite", + "name": "LocalEducationAgencyId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.webSite", + "is_nullable": false, + "source_path": "$.localEducationAgencyId", "storage": { "kind": "Stored" } }, { - "name": "EducationServiceCenter_DocumentId", - "kind": "DocumentFk", + "name": "NameOfInstitution", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 75 }, - "is_nullable": true, - "source_path": "$.educationServiceCenterReference", + "is_nullable": false, + "source_path": "$.nameOfInstitution", "storage": { "kind": "Stored" } }, { - "name": "ParentLocalEducationAgency_DocumentId", - "kind": "DocumentFk", + "name": "ShortNameOfInstitution", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 75 }, "is_nullable": true, - "source_path": "$.parentLocalEducationAgencyReference", + "source_path": "$.shortNameOfInstitution", "storage": { "kind": "Stored" } }, { - "name": "StateEducationAgency_DocumentId", - "kind": "DocumentFk", + "name": "WebSite", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.stateEducationAgencyReference", + "source_path": "$.webSite", "storage": { "kind": "Stored" } @@ -37663,49 +37663,49 @@ } }, { - "name": "GunFreeSchoolsActReportingStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalEducationAgencyAccountabilitySchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.accountabilities[*].gunFreeSchoolsActReportingStatusDescriptor", + "is_nullable": false, + "source_path": "$.accountabilities[*].schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoiceImplementStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalEducationAgencyAccountabilitySchoolYear_SchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.accountabilities[*].schoolChoiceImplementStatusDescriptor", + "is_nullable": false, + "source_path": "$.accountabilities[*].schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyAccountabilitySchoolYear_SchoolYear", - "kind": "Scalar", + "name": "GunFreeSchoolsActReportingStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.accountabilities[*].schoolYearTypeReference.schoolYear", + "is_nullable": true, + "source_path": "$.accountabilities[*].gunFreeSchoolsActReportingStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalEducationAgencyAccountabilitySchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "SchoolChoiceImplementStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.accountabilities[*].schoolYearTypeReference", + "is_nullable": true, + "source_path": "$.accountabilities[*].schoolChoiceImplementStatusDescriptor", "storage": { "kind": "Stored" } @@ -39511,88 +39511,88 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", + "is_nullable": false, + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } }, { - "name": "Amount", + "name": "LocalAccount_AccountIdentifier", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.amount", + "source_path": "$.localAccountReference.accountIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AsOfDate", + "name": "LocalAccount_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_AccountIdentifier", + "name": "LocalAccount_FiscalYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.localAccountReference.accountIdentifier", + "source_path": "$.localAccountReference.fiscalYear", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_EducationOrganizationId", - "kind": "Scalar", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.localAccountReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_FiscalYear", + "name": "Amount", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 19, + "scale": 4 }, "is_nullable": false, - "source_path": "$.localAccountReference.fiscalYear", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -39734,39 +39734,13 @@ } }, { - "name": "FinancialCollectionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "LocalAccount_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.financialCollectionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Amount", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 19, - "scale": 4 - }, - "is_nullable": false, - "source_path": "$.amount", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.localAccountReference", "storage": { "kind": "Stored" } @@ -39808,6 +39782,18 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Staff_StaffUniqueId", "kind": "Scalar", @@ -39822,25 +39808,39 @@ } }, { - "name": "LocalAccount_DocumentId", - "kind": "DocumentFk", + "name": "FinancialCollectionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, + "is_nullable": true, + "source_path": "$.financialCollectionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Amount", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 19, + "scale": 4 + }, "is_nullable": false, - "source_path": "$.localAccountReference", + "source_path": "$.amount", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.asOfDate", "storage": { "kind": "Stored" } @@ -40029,62 +40029,62 @@ } }, { - "name": "ClassroomIdentificationCode", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.classroomIdentificationCode", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "MaximumNumberOfSeats", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.maximumNumberOfSeats", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "OptimalNumberOfSeats", + "name": "ClassroomIdentificationCode", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.optimalNumberOfSeats", + "is_nullable": false, + "source_path": "$.classroomIdentificationCode", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "MaximumNumberOfSeats", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "is_nullable": true, + "source_path": "$.maximumNumberOfSeats", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "OptimalNumberOfSeats", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.optimalNumberOfSeats", "storage": { "kind": "Stored" } @@ -40631,23 +40631,24 @@ } }, { - "name": "AcademicSubjectDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AssessmentIdentifier_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.academicSubjectDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "AssessmentIdentifier_Unified", + "name": "Namespace_Unified", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, "source_path": null, @@ -40656,180 +40657,179 @@ } }, { - "name": "Description", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.description", + "is_nullable": false, + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } }, { - "name": "IdentificationCode", + "name": "Assessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.identificationCode", + "source_path": "$.assessmentReference.assessmentIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "Assessment_DocumentId" } }, { - "name": "MaxRawScore", + "name": "Assessment_Namespace", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 15, - "scale": 5 + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.maxRawScore", + "is_nullable": false, + "source_path": "$.assessmentReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "Assessment_DocumentId" } }, { - "name": "Namespace_Unified", - "kind": "Scalar", + "name": "ParentObjectiveAssessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.parentObjectiveAssessmentReference", "storage": { "kind": "Stored" } }, { - "name": "Nomenclature", + "name": "ParentObjectiveAssessment_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 100 + "max_length": 60 }, "is_nullable": true, - "source_path": "$.nomenclature", + "source_path": "$.parentObjectiveAssessmentReference.assessmentIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "ParentObjectiveAssessment_DocumentId" } }, { - "name": "ParentObjectiveAssessment_IdentificationCode", + "name": "ParentObjectiveAssessment_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference.identificationCode", + "source_path": "$.parentObjectiveAssessmentReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "ParentObjectiveAssessment_DocumentId" } }, { - "name": "PercentOfAssessment", + "name": "ParentObjectiveAssessment_IdentificationCode", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.percentOfAssessment", + "source_path": "$.parentObjectiveAssessmentReference.identificationCode", "storage": { "kind": "Stored" } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AcademicSubjectDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.assessmentReference", + "is_nullable": true, + "source_path": "$.academicSubjectDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Assessment_AssessmentIdentifier", + "name": "Description", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.assessmentReference.assessmentIdentifier", + "is_nullable": true, + "source_path": "$.description", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", - "presence_column": "Assessment_DocumentId" + "kind": "Stored" } }, { - "name": "Assessment_Namespace", + "name": "IdentificationCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.assessmentReference.namespace", + "source_path": "$.identificationCode", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "Assessment_DocumentId" + "kind": "Stored" } }, { - "name": "ParentObjectiveAssessment_DocumentId", - "kind": "DocumentFk", + "name": "MaxRawScore", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 15, + "scale": 5 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference", + "source_path": "$.maxRawScore", "storage": { "kind": "Stored" } }, { - "name": "ParentObjectiveAssessment_AssessmentIdentifier", + "name": "Nomenclature", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 100 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference.assessmentIdentifier", + "source_path": "$.nomenclature", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", - "presence_column": "ParentObjectiveAssessment_DocumentId" + "kind": "Stored" } }, { - "name": "ParentObjectiveAssessment_Namespace", + "name": "PercentOfAssessment", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Decimal", + "precision": 5, + "scale": 4 }, "is_nullable": true, - "source_path": "$.parentObjectiveAssessmentReference.namespace", + "source_path": "$.percentOfAssessment", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "ParentObjectiveAssessment_DocumentId" + "kind": "Stored" } } ], @@ -41004,27 +41004,26 @@ } }, { - "name": "AssessmentItemAssessmentItem_AssessmentIdentifier", - "kind": "Scalar", + "name": "AssessmentItemAssessmentItem_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.assessmentItems[*].assessmentItemReference.assessmentIdentifier", + "source_path": "$.assessmentItems[*].assessmentItemReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentItemAssessmentItem_IdentificationCode", + "name": "AssessmentItemAssessmentItem_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.assessmentItems[*].assessmentItemReference.identificationCode", + "source_path": "$.assessmentItems[*].assessmentItemReference.assessmentIdentifier", "storage": { "kind": "Stored" } @@ -41043,13 +41042,14 @@ } }, { - "name": "AssessmentItemAssessmentItem_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentItemAssessmentItem_IdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.assessmentItems[*].assessmentItemReference", + "source_path": "$.assessmentItems[*].assessmentItemReference.identificationCode", "storage": { "kind": "Stored" } @@ -41148,26 +41148,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -41751,6 +41751,30 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "EmploymentStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -41823,18 +41847,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "PositionTitle", "kind": "Scalar", @@ -41860,18 +41872,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -42562,6 +42562,30 @@ "kind": "Stored" } }, + { + "name": "ParentEducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.parentEducationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ParentEducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.parentEducationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, { "name": "AcademicSubjectDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -42611,18 +42635,6 @@ "kind": "Stored" } }, - { - "name": "ParentEducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.parentEducationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "ShortNameOfInstitution", "kind": "Scalar", @@ -42648,18 +42660,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ParentEducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.parentEducationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -44527,37 +44527,37 @@ } }, { - "name": "PostSecondaryEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "PostSecondaryInstitution_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.postSecondaryEventCategoryDescriptor", + "is_nullable": true, + "source_path": "$.postSecondaryInstitutionReference", "storage": { "kind": "Stored" } }, { - "name": "EventDate", + "name": "PostSecondaryInstitution_PostSecondaryInstitutionId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.eventDate", + "is_nullable": true, + "source_path": "$.postSecondaryInstitutionReference.postSecondaryInstitutionId", "storage": { "kind": "Stored" } }, { - "name": "PostSecondaryInstitution_PostSecondaryInstitutionId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.postSecondaryInstitutionReference.postSecondaryInstitutionId", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -44576,25 +44576,25 @@ } }, { - "name": "PostSecondaryInstitution_DocumentId", - "kind": "DocumentFk", + "name": "PostSecondaryEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.postSecondaryInstitutionReference", + "is_nullable": false, + "source_path": "$.postSecondaryEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EventDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } @@ -46904,10 +46904,10 @@ } }, { - "name": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEducationOrganizationId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, "source_path": null, @@ -46916,7 +46916,7 @@ } }, { - "name": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "name": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" @@ -46928,10 +46928,11 @@ } }, { - "name": "ProgramTypeDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluationTitle_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, "source_path": null, @@ -46940,50 +46941,35 @@ } }, { - "name": "ElementMaxNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.elementMaxNumericRating", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ElementMinNumericRating", - "kind": "Scalar", + "name": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.elementMinNumericRating", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ElementSortOrder", + "name": "ProgramName_Unified", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.elementSortOrder", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ProgramEducationOrganizationId_Unified", - "kind": "Scalar", + "name": "ProgramTypeDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, "source_path": null, @@ -46992,27 +46978,13 @@ } }, { - "name": "ProgramEvaluationElementDescription", - "kind": "Scalar", + "name": "ProgramEvaluationObjective_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationElementDescription", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationElementTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationElementTitle", + "source_path": "$.programEvaluationObjectiveReference", "storage": { "kind": "Stored" } @@ -47031,41 +47003,17 @@ } }, { - "name": "ProgramEvaluationTitle_Unified", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramName_Unified", + "name": "ProgramEvaluationObjective_ProgramEducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationObjective_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference", + "source_path": "$.programEvaluationObjectiveReference.programEducationOrganizationId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "ProgramEducationOrganizationId_Unified", + "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { @@ -47083,74 +47031,60 @@ } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationTypeDesc_513b5067cb", - "kind": "DescriptorFk", + "name": "ProgramEvaluationObjective_ProgramEvaluationTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationTitle", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTitle_Unified", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluationObjective_ProgramEvaluationTypeDesc_513b5067cb", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programTypeDescriptor", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", - "presence_column": "ProgramEvaluationObjective_DocumentId" - } - }, - { - "name": "ProgramEvaluationObjective_ProgramEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEducationOrganizationId", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEducationOrganizationId_Unified", + "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationTitle", + "name": "ProgramEvaluationObjective_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationTitle", + "source_path": "$.programEvaluationObjectiveReference.programName", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTitle_Unified", + "canonical_column": "ProgramName_Unified", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramName", - "kind": "Scalar", + "name": "ProgramEvaluationObjective_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programName", + "source_path": "$.programEvaluationObjectiveReference.programTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramName_Unified", + "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, @@ -47181,30 +47115,31 @@ } }, { - "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationReference.programEvaluationTitle", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTitle_Unified", "presence_column": "ProgramEvaluation_DocumentId" } }, { - "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programTypeDescriptor", + "source_path": "$.programEvaluationReference.programEvaluationTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluation_DocumentId" } }, @@ -47223,34 +47158,99 @@ } }, { - "name": "ProgramEvaluation_ProgramEvaluationTitle", + "name": "ProgramEvaluation_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", + "source_path": "$.programEvaluationReference.programName", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTitle_Unified", + "canonical_column": "ProgramName_Unified", "presence_column": "ProgramEvaluation_DocumentId" } }, { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", + "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", + "source_path": "$.programEvaluationReference.programTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramName_Unified", + "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluation_DocumentId" } + }, + { + "name": "ElementMaxNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.elementMaxNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ElementMinNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.elementMinNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ElementSortOrder", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.elementSortOrder", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationElementDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.programEvaluationElementDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationElementTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationElementTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -47825,6 +47825,18 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", "kind": "DescriptorFk", @@ -47837,6 +47849,19 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEvaluationTitle", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -47849,6 +47874,31 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEducationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluation_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programName", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -47926,56 +47976,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ProgramEvaluation_ProgramEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramEvaluationTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -48373,91 +48373,13 @@ } }, { - "name": "ProgramEvaluationPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationPeriodDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EvaluationMaxNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.evaluationMaxNumericRating", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EvaluationMinNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.evaluationMinNumericRating", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationDescription", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.programEvaluationDescription", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationTitle", + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -48488,13 +48410,91 @@ } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference", + "source_path": "$.programReference.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationPeriodDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EvaluationMaxNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.evaluationMaxNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EvaluationMinNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.evaluationMinNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.programEvaluationDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationTitle", "storage": { "kind": "Stored" } @@ -48887,13 +48887,13 @@ } }, { - "name": "ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -48910,6 +48910,18 @@ "kind": "Stored" } }, + { + "name": "ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramId", "kind": "Scalar", @@ -48935,18 +48947,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -49168,26 +49168,26 @@ } }, { - "name": "LearningStandard_LearningStandardId", - "kind": "Scalar", + "name": "LearningStandard_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", + "source_path": "$.learningStandards[*].learningStandardReference", "storage": { "kind": "Stored" } }, { - "name": "LearningStandard_DocumentId", - "kind": "DocumentFk", + "name": "LearningStandard_LearningStandardId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.learningStandards[*].learningStandardReference", + "source_path": "$.learningStandards[*].learningStandardReference.learningStandardId", "storage": { "kind": "Stored" } @@ -49934,13 +49934,13 @@ } }, { - "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -49958,78 +49958,74 @@ } }, { - "name": "GradingPeriodGradingPeriod_GradingPeriodName", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.gradingPeriodName", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_SchoolId", - "kind": "Scalar", + "name": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.schoolId", + "source_path": "$.gradingPeriodReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_SchoolYear", + "name": "GradingPeriodGradingPeriod_GradingPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.gradingPeriodReference.schoolYear", + "source_path": "$.gradingPeriodReference.gradingPeriodName", "storage": { "kind": "Stored" } }, { - "name": "NumberOfDaysAbsent", + "name": "GradingPeriodGradingPeriod_SchoolId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 18, - "scale": 4 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.numberOfDaysAbsent", + "is_nullable": false, + "source_path": "$.gradingPeriodReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "NumberOfDaysInAttendance", + "name": "GradingPeriodGradingPeriod_SchoolYear", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 18, - "scale": 4 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.numberOfDaysInAttendance", + "is_nullable": false, + "source_path": "$.gradingPeriodReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "NumberOfDaysTardy", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.numberOfDaysTardy", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -50048,37 +50044,41 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "NumberOfDaysAbsent", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 18, + "scale": 4 }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.numberOfDaysAbsent", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_DocumentId", - "kind": "DocumentFk", + "name": "NumberOfDaysInAttendance", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 18, + "scale": 4 }, - "is_nullable": false, - "source_path": "$.gradingPeriodReference", + "is_nullable": true, + "source_path": "$.numberOfDaysInAttendance", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "NumberOfDaysTardy", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.numberOfDaysTardy", "storage": { "kind": "Stored" } @@ -50407,37 +50407,37 @@ } }, { - "name": "Grade_GradeTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Grade_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.grades[*].gradeReference.gradeTypeDescriptor", + "source_path": "$.grades[*].gradeReference", "storage": { "kind": "Stored" } }, { - "name": "Grade_GradingPeriodDescriptor_DescriptorId", + "name": "Grade_GradeTypeDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.grades[*].gradeReference.gradingPeriodDescriptor", + "source_path": "$.grades[*].gradeReference.gradeTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Grade_BeginDate", - "kind": "Scalar", + "name": "Grade_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.grades[*].gradeReference.beginDate", + "source_path": "$.grades[*].gradeReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } @@ -50479,6 +50479,18 @@ "kind": "Stored" } }, + { + "name": "Grade_BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.grades[*].gradeReference.beginDate", + "storage": { + "kind": "Stored" + } + }, { "name": "Grade_LocalCourseCode", "kind": "Scalar", @@ -50492,6 +50504,18 @@ "kind": "Stored" } }, + { + "name": "Grade_StudentSectionAssociationReferenceSchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.grades[*].gradeReference.schoolId", + "storage": { + "kind": "Stored" + } + }, { "name": "Grade_SchoolYear", "kind": "Scalar", @@ -50530,18 +50554,6 @@ "kind": "Stored" } }, - { - "name": "Grade_StudentSectionAssociationReferenceSchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.grades[*].gradeReference.schoolId", - "storage": { - "kind": "Stored" - } - }, { "name": "Grade_StudentUniqueId", "kind": "Scalar", @@ -50554,18 +50566,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Grade_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.grades[*].gradeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -50720,25 +50720,25 @@ } }, { - "name": "StudentCompetencyObjective_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentCompetencyObjective_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.gradingPeriodDescriptor", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_ObjectiveGradeLevelDescri_16507c4e9d", + "name": "StudentCompetencyObjective_GradingPeriodDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveGradeLevelDescriptor", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.gradingPeriodDescriptor", "storage": { "kind": "Stored" } @@ -50781,51 +50781,51 @@ } }, { - "name": "StudentCompetencyObjective_Objective", + "name": "StudentCompetencyObjective_ObjectiveEducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objective", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_ObjectiveEducationOrganizationId", + "name": "StudentCompetencyObjective_Objective", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveEducationOrganizationId", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objective", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_StudentUniqueId", - "kind": "Scalar", + "name": "StudentCompetencyObjective_ObjectiveGradeLevelDescri_16507c4e9d", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.studentUniqueId", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.objectiveGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjective_DocumentId", - "kind": "DocumentFk", + "name": "StudentCompetencyObjective_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference", + "source_path": "$.studentCompetencyObjectives[*].studentCompetencyObjectiveReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -51368,13 +51368,25 @@ } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } @@ -51393,38 +51405,53 @@ } }, { - "name": "EventDate", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.eventDate", + "is_nullable": true, + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "DisciplineIncident_DocumentId" } }, { - "name": "RestraintEventIdentifier", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.restraintEventIdentifier", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -51443,65 +51470,38 @@ } }, { - "name": "DisciplineIncident_DocumentId", - "kind": "DocumentFk", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.educationalEnvironmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", + "name": "EventDate", "kind": "Scalar", "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.disciplineIncidentReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "DisciplineIncident_DocumentId" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "RestraintEventIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "kind": "String", + "max_length": 36 }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.restraintEventIdentifier", "storage": { "kind": "Stored" } @@ -51682,13 +51682,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -51719,13 +51719,13 @@ } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -52251,6 +52251,54 @@ "kind": "Stored" } }, + { + "name": "CharterApprovalSchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.charterApprovalSchoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "CharterApprovalSchoolYear_CharterApprovalSchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.charterApprovalSchoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalEducationAgency_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.localEducationAgencyReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "LocalEducationAgency_LocalEducationAgencyId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.localEducationAgencyReference.localEducationAgencyId", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrativeFundingControlDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -52347,30 +52395,6 @@ "kind": "Stored" } }, - { - "name": "CharterApprovalSchoolYear_CharterApprovalSchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.charterApprovalSchoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalEducationAgency_LocalEducationAgencyId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.localEducationAgencyReference.localEducationAgencyId", - "storage": { - "kind": "Stored" - } - }, { "name": "NameOfInstitution", "kind": "Scalar", @@ -52421,30 +52445,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CharterApprovalSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.charterApprovalSchoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LocalEducationAgency_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.localEducationAgencyReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -54442,206 +54442,206 @@ } }, { - "name": "CalendarDate_CalendarCode", + "name": "SchoolId_Unified", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.calendarCode", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "CalendarDate_Date", + "name": "SchoolYear_Unified", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.date", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "CalendarDate_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.calendarDateReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "CalendarDate_CalendarCode", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": null, + "source_path": "$.calendarDateReference.calendarCode", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_Unified", + "name": "CalendarDate_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.calendarDateReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "CalendarDate_DocumentId" } }, { - "name": "Section_LocalCourseCode", + "name": "CalendarDate_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.sectionReference.localCourseCode", + "source_path": "$.calendarDateReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "CalendarDate_DocumentId" } }, { - "name": "Section_SectionIdentifier", + "name": "CalendarDate_Date", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sectionReference.sectionIdentifier", + "source_path": "$.calendarDateReference.date", "storage": { "kind": "Stored" } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } }, { - "name": "Staff_StaffUniqueId", + "name": "Section_LocalCourseCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CalendarDate_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "max_length": 60 }, "is_nullable": false, - "source_path": "$.calendarDateReference", + "source_path": "$.sectionReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "CalendarDate_SchoolId", + "name": "Section_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.schoolId", + "source_path": "$.sectionReference.schoolId", "storage": { "kind": "UnifiedAlias", "canonical_column": "SchoolId_Unified", - "presence_column": "CalendarDate_DocumentId" + "presence_column": "Section_DocumentId" } }, { - "name": "CalendarDate_SchoolYear", + "name": "Section_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.calendarDateReference.schoolYear", + "source_path": "$.sectionReference.schoolYear", "storage": { "kind": "UnifiedAlias", "canonical_column": "SchoolYear_Unified", - "presence_column": "CalendarDate_DocumentId" + "presence_column": "Section_DocumentId" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Section_SessionName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.sectionReference", + "source_path": "$.sectionReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolId", + "name": "Section_SectionIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.sectionReference.schoolId", + "source_path": "$.sectionReference.sectionIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" } }, { - "name": "Section_SchoolYear", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.schoolYear", + "is_nullable": true, + "source_path": "$.staffReference", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Section_DocumentId" + "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "Staff_StaffUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.staffReference", + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.eventDate", "storage": { "kind": "Stored" } @@ -54898,101 +54898,25 @@ } }, { - "name": "AvailableCreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.availableCreditTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "InstructionLanguageDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.instructionLanguageDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MediumOfInstructionDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.mediumOfInstructionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PopulationServedDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.populationServedDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SectionTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.sectionTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AvailableCreditConversion", + "name": "SchoolId_Unified", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.availableCreditConversion", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "AvailableCredits", - "kind": "Scalar", + "name": "CourseOffering_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 3 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.availableCredits", + "is_nullable": false, + "source_path": "$.courseOfferingReference", "storage": { "kind": "Stored" } @@ -55022,31 +54946,6 @@ "kind": "Stored" } }, - { - "name": "CourseOffering_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.courseOfferingReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CourseOffering_SessionName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.courseOfferingReference.sessionName", - "storage": { - "kind": "Stored" - } - }, { "name": "CourseOffering_SessionReferenceSchoolId", "kind": "Scalar", @@ -55060,100 +54959,51 @@ } }, { - "name": "LocationLocation_ClassroomIdentificationCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.locationReference.classroomIdentificationCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "OfficialAttendancePeriod", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.officialAttendancePeriod", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolId_Unified", + "name": "CourseOffering_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, "is_nullable": false, - "source_path": "$.sectionIdentifier", + "source_path": "$.courseOfferingReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "SectionName", + "name": "CourseOffering_SessionName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 100 - }, - "is_nullable": true, - "source_path": "$.sectionName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SequenceOfCourse", - "kind": "Scalar", - "type": { - "kind": "Int32" + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.sequenceOfCourse", + "is_nullable": false, + "source_path": "$.courseOfferingReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "CourseOffering_DocumentId", + "name": "LocationLocation_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.courseOfferingReference", + "is_nullable": true, + "source_path": "$.locationReference", "storage": { "kind": "Stored" } }, { - "name": "LocationLocation_DocumentId", - "kind": "DocumentFk", + "name": "LocationLocation_ClassroomIdentificationCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.locationReference", + "source_path": "$.locationReference.classroomIdentificationCode", "storage": { "kind": "Stored" } @@ -55197,6 +55047,156 @@ "canonical_column": "SchoolId_Unified", "presence_column": "LocationSchool_DocumentId" } + }, + { + "name": "AvailableCreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.availableCreditTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "InstructionLanguageDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.instructionLanguageDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MediumOfInstructionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.mediumOfInstructionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PopulationServedDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.populationServedDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sectionTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AvailableCreditConversion", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.availableCreditConversion", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AvailableCredits", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.availableCredits", + "storage": { + "kind": "Stored" + } + }, + { + "name": "OfficialAttendancePeriod", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.officialAttendancePeriod", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.sectionIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": true, + "source_path": "$.sectionName", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SequenceOfCourse", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.sequenceOfCourse", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -55574,38 +55574,38 @@ } }, { - "name": "ClassPeriod_ClassPeriodName", - "kind": "Scalar", + "name": "ClassPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", + "source_path": "$.classPeriods[*].classPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_SchoolId", + "name": "ClassPeriod_ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.schoolId", + "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_DocumentId", - "kind": "DocumentFk", + "name": "ClassPeriod_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference", + "source_path": "$.classPeriods[*].classPeriodReference.schoolId", "storage": { "kind": "Stored" } @@ -55895,13 +55895,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -55932,13 +55932,13 @@ } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -56283,110 +56283,110 @@ } }, { - "name": "TermDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.termDescriptor", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.endDate", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", + "source_path": "$.schoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", - "kind": "Scalar", + "name": "TermDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "source_path": "$.termDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SessionName", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sessionName", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "TotalInstructionalDays", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.totalInstructionalDays", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "SessionName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.sessionName", "storage": { "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "TotalInstructionalDays", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.totalInstructionalDays", "storage": { "kind": "Stored" } @@ -56540,38 +56540,38 @@ } }, { - "name": "AcademicWeek_SchoolId", - "kind": "Scalar", + "name": "AcademicWeek_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.academicWeeks[*].academicWeekReference.schoolId", + "source_path": "$.academicWeeks[*].academicWeekReference", "storage": { "kind": "Stored" } }, { - "name": "AcademicWeek_WeekIdentifier", + "name": "AcademicWeek_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 80 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.academicWeeks[*].academicWeekReference.weekIdentifier", + "source_path": "$.academicWeeks[*].academicWeekReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "AcademicWeek_DocumentId", - "kind": "DocumentFk", + "name": "AcademicWeek_WeekIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 80 }, "is_nullable": true, - "source_path": "$.academicWeeks[*].academicWeekReference", + "source_path": "$.academicWeeks[*].academicWeekReference.weekIdentifier", "storage": { "kind": "Stored" } @@ -56666,6 +56666,18 @@ "kind": "Stored" } }, + { + "name": "GradingPeriod_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.gradingPeriods[*].gradingPeriodReference", + "storage": { + "kind": "Stored" + } + }, { "name": "GradingPeriod_GradingPeriodDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -56714,18 +56726,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "GradingPeriod_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.gradingPeriods[*].gradingPeriodReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -57264,77 +57264,77 @@ } }, { - "name": "AbsenceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.absenceEventCategoryDescriptor", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "AbsenceEventReason", + "name": "Staff_StaffUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 40 + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.absenceEventReason", + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "AbsenceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.absenceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "HoursAbsent", + "name": "AbsenceEventReason", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 18, - "scale": 2 + "kind": "String", + "max_length": 40 }, "is_nullable": true, - "source_path": "$.hoursAbsent", + "source_path": "$.absenceEventReason", "storage": { "kind": "Stored" } }, { - "name": "Staff_StaffUniqueId", + "name": "EventDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "HoursAbsent", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 18, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.hoursAbsent", "storage": { "kind": "Stored" } @@ -57491,13 +57491,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "Cohort_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.cohortReference", "storage": { "kind": "Stored" } @@ -57528,13 +57528,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.staffReference", "storage": { "kind": "Stored" } @@ -57553,37 +57553,37 @@ } }, { - "name": "StudentRecordAccess", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.studentRecordAccess", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Cohort_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.cohortReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "StudentRecordAccess", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.studentRecordAccess", "storage": { "kind": "Stored" } @@ -57719,63 +57719,63 @@ } }, { - "name": "DisciplineIncident_IncidentIdentifier", - "kind": "Scalar", + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.incidentIdentifier", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", + "name": "DisciplineIncident_IncidentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 36 }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.schoolId", + "source_path": "$.disciplineIncidentReference.incidentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Staff_StaffUniqueId", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_DocumentId", + "name": "Staff_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "Staff_StaffUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } @@ -58021,49 +58021,26 @@ } }, { - "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StaffUniqueId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.credentialReference.stateOfIssueStateAbbreviationDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_48a7f76b56", - "kind": "DescriptorFk", + "name": "Credential_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.employmentStatusDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffClassificationDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffClassificationDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.credentialReference", "storage": { "kind": "Stored" } @@ -58082,137 +58059,85 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_0cbe1eb337", - "kind": "Scalar", + "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.hireDate", + "source_path": "$.credentialReference.stateOfIssueStateAbbreviationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_af1202f2de", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "FullTimeEquivalency", - "kind": "Scalar", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_7a3d86aa2b", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.fullTimeEquivalency", + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "OrderOfAssignment", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_af1202f2de", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": "$.orderOfAssignment", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PositionTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 100 - }, - "is_nullable": true, - "source_path": "$.positionTitle", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffUniqueId_Unified", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": null, + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "Credential_DocumentId", - "kind": "DocumentFk", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_48a7f76b56", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.credentialReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.employmentStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_7a3d86aa2b", - "kind": "DocumentFk", + "name": "EmploymentStaffEducationOrganizationEmploymentAssoci_0cbe1eb337", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference", + "source_path": "$.employmentStaffEducationOrganizationEmploymentAssociationReference.hireDate", "storage": { "kind": "Stored" } @@ -58258,6 +58183,81 @@ "canonical_column": "StaffUniqueId_Unified", "presence_column": "Staff_DocumentId" } + }, + { + "name": "StaffClassificationDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffClassificationDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.endDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "FullTimeEquivalency", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 5, + "scale": 4 + }, + "is_nullable": true, + "source_path": "$.fullTimeEquivalency", + "storage": { + "kind": "Stored" + } + }, + { + "name": "OrderOfAssignment", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.orderOfAssignment", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PositionTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 100 + }, + "is_nullable": true, + "source_path": "$.positionTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -58559,6 +58559,55 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "AddressAddressTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -58762,18 +58811,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "ElectronicMailAddress", "kind": "Scalar", @@ -58786,43 +58823,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -59321,6 +59321,31 @@ "kind": "Stored" } }, + { + "name": "Credential_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.credentialReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Credential_CredentialIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": true, + "source_path": "$.credentialReference.credentialIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -59333,6 +59358,55 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "EmploymentStatusDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -59383,19 +59457,6 @@ "kind": "Stored" } }, - { - "name": "Credential_CredentialIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.credentialReference.credentialIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Department", "kind": "Scalar", @@ -59409,18 +59470,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "EndDate", "kind": "Scalar", @@ -59484,55 +59533,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Credential_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.credentialReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -59859,6 +59859,31 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "StaffLeaveEventCategoryDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -59908,19 +59933,6 @@ "kind": "Stored" } }, - { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "SubstituteAssigned", "kind": "Scalar", @@ -59932,18 +59944,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -60077,62 +60077,62 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programName", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } @@ -60151,37 +60151,37 @@ } }, { - "name": "StudentRecordAccess", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.studentRecordAccess", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "StudentRecordAccess", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.studentRecordAccess", "storage": { "kind": "Stored" } @@ -60349,31 +60349,6 @@ "kind": "Stored" } }, - { - "name": "ProgramAssignmentDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programAssignmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Calendar_CalendarCode", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": true, - "source_path": "$.calendarReference.calendarCode", - "storage": { - "kind": "Stored" - } - }, { "name": "SchoolId_Unified", "kind": "Scalar", @@ -60399,26 +60374,26 @@ } }, { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", + "name": "Calendar_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "is_nullable": true, + "source_path": "$.calendarReference", "storage": { "kind": "Stored" } }, { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", + "name": "Calendar_CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.calendarReference", + "source_path": "$.calendarReference.calendarCode", "storage": { "kind": "Stored" } @@ -60514,6 +60489,31 @@ "storage": { "kind": "Stored" } + }, + { + "name": "Staff_StaffUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.staffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramAssignmentDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programAssignmentDescriptor", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -60989,63 +60989,13 @@ } }, { - "name": "ClassroomPositionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.classroomPositionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.beginDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EndDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.endDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "HighlyQualifiedTeacher", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.highlyQualifiedTeacher", - "storage": { - "kind": "Stored" - } - }, - { - "name": "PercentageContribution", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 - }, - "is_nullable": true, - "source_path": "$.percentageContribution", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } @@ -61087,6 +61037,19 @@ "kind": "Stored" } }, + { + "name": "Section_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.sectionReference.sessionName", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_SectionIdentifier", "kind": "Scalar", @@ -61101,14 +61064,13 @@ } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } @@ -61127,37 +61089,75 @@ } }, { - "name": "TeacherStudentDataLinkExclusion", + "name": "ClassroomPositionDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.classroomPositionDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "BeginDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.endDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "HighlyQualifiedTeacher", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.teacherStudentDataLinkExclusion", + "source_path": "$.highlyQualifiedTeacher", "storage": { "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "PercentageContribution", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 5, + "scale": 4 }, - "is_nullable": false, - "source_path": "$.sectionReference", + "is_nullable": true, + "source_path": "$.percentageContribution", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "TeacherStudentDataLinkExclusion", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.staffReference", + "is_nullable": true, + "source_path": "$.teacherStudentDataLinkExclusion", "storage": { "kind": "Stored" } @@ -61332,37 +61332,62 @@ } }, { - "name": "CitizenshipStatusDescriptor_DescriptorId", + "name": "Person_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.personReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_PersonId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.personReference.personId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_SourceSystemDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.citizenshipStatusDescriptor", + "source_path": "$.personReference.sourceSystemDescriptor", "storage": { "kind": "Stored" } }, { - "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", + "name": "CitizenshipStatusDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.highestCompletedLevelOfEducationDescriptor", + "source_path": "$.citizenshipStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Person_SourceSystemDescriptor_DescriptorId", + "name": "HighestCompletedLevelOfEducationDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.personReference.sourceSystemDescriptor", + "source_path": "$.highestCompletedLevelOfEducationDescriptor", "storage": { "kind": "Stored" } @@ -61506,19 +61531,6 @@ "kind": "Stored" } }, - { - "name": "Person_PersonId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.personReference.personId", - "storage": { - "kind": "Stored" - } - }, { "name": "PersonalTitlePrefix", "kind": "Scalar", @@ -61598,18 +61610,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Person_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.personReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -62177,13 +62177,13 @@ } }, { - "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Credential_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.credentials[*].credentialReference.stateOfIssueStateAbbreviationDescriptor", + "source_path": "$.credentials[*].credentialReference", "storage": { "kind": "Stored" } @@ -62202,13 +62202,13 @@ } }, { - "name": "Credential_DocumentId", - "kind": "DocumentFk", + "name": "Credential_StateOfIssueStateAbbreviationDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.credentials[*].credentialReference", + "source_path": "$.credentials[*].credentialReference.stateOfIssueStateAbbreviationDescriptor", "storage": { "kind": "Stored" } @@ -64951,13 +64951,13 @@ } }, { - "name": "CteGraduationRateInclusion", - "kind": "Scalar", + "name": "StateEducationAgencyAccountabilitySchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.accountabilities[*].cteGraduationRateInclusion", + "is_nullable": false, + "source_path": "$.accountabilities[*].schoolYearTypeReference", "storage": { "kind": "Stored" } @@ -64975,13 +64975,13 @@ } }, { - "name": "StateEducationAgencyAccountabilitySchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "CteGraduationRateInclusion", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.accountabilities[*].schoolYearTypeReference", + "is_nullable": true, + "source_path": "$.accountabilities[*].cteGraduationRateInclusion", "storage": { "kind": "Stored" } @@ -66584,6 +66584,79 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "CumulativeAttemptedCreditTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -66748,18 +66821,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "ProjectedGraduationDate", "kind": "Scalar", @@ -66772,18 +66833,6 @@ "kind": "Stored" } }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, { "name": "SessionAttemptedCreditConversion", "kind": "Scalar", @@ -66839,55 +66888,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -68107,13 +68107,13 @@ } }, { - "name": "ReportCard_GradingPeriodDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ReportCard_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.reportCards[*].reportCardReference.gradingPeriodDescriptor", + "source_path": "$.reportCards[*].reportCardReference", "storage": { "kind": "Stored" } @@ -68130,6 +68130,18 @@ "kind": "Stored" } }, + { + "name": "ReportCard_GradingPeriodDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.reportCards[*].reportCardReference.gradingPeriodDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ReportCard_GradingPeriodName", "kind": "Scalar", @@ -68179,18 +68191,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "ReportCard_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.reportCards[*].reportCardReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -68540,13 +68540,13 @@ } }, { - "name": "EducationOrganizationAssociationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationAssociationTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -68563,6 +68563,18 @@ "kind": "Stored" } }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, { "name": "SchoolYear_SchoolYear", "kind": "Scalar", @@ -68575,6 +68587,18 @@ "kind": "Stored" } }, + { + "name": "StudentAssessment_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentAssessmentReference", + "storage": { + "kind": "Stored" + } + }, { "name": "StudentAssessment_AssessmentIdentifier", "kind": "Scalar", @@ -68628,37 +68652,13 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentAssessment_DocumentId", - "kind": "DocumentFk", + "name": "EducationOrganizationAssociationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentAssessmentReference", + "source_path": "$.educationOrganizationAssociationTypeDescriptor", "storage": { "kind": "Stored" } @@ -68855,19 +68855,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentBatteryPart_AssessmentBatteryPartName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 65 - }, - "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference.assessmentBatteryPartName", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentIdentifier_Unified", "kind": "Scalar", @@ -68895,137 +68882,150 @@ } }, { - "name": "StudentAssessmentRegistration_AdministrationIdentifier", - "kind": "Scalar", + "name": "AssessmentBatteryPart_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.administrationIdentifier", + "source_path": "$.assessmentBatteryPartReference", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentRegistration_AssigningEducationOrganizationId", + "name": "AssessmentBatteryPart_AssessmentBatteryPartName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 65 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.assigningEducationOrganizationId", + "source_path": "$.assessmentBatteryPartReference.assessmentBatteryPartName", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentRegistration_EducationOrganizationId", + "name": "AssessmentBatteryPart_AssessmentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.educationOrganizationId", + "source_path": "$.assessmentBatteryPartReference.assessmentIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "AssessmentBatteryPart_DocumentId" } }, { - "name": "StudentAssessmentRegistration_StudentUniqueId", + "name": "AssessmentBatteryPart_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.studentUniqueId", + "source_path": "$.assessmentBatteryPartReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "AssessmentBatteryPart_DocumentId" } }, { - "name": "AssessmentBatteryPart_DocumentId", + "name": "StudentAssessmentRegistration_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference", + "source_path": "$.studentAssessmentRegistrationReference", "storage": { "kind": "Stored" } }, { - "name": "AssessmentBatteryPart_AssessmentIdentifier", + "name": "StudentAssessmentRegistration_AdministrationIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference.assessmentIdentifier", + "source_path": "$.studentAssessmentRegistrationReference.administrationIdentifier", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", - "presence_column": "AssessmentBatteryPart_DocumentId" + "kind": "Stored" } }, { - "name": "AssessmentBatteryPart_Namespace", + "name": "StudentAssessmentRegistration_AssessmentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.assessmentBatteryPartReference.namespace", + "source_path": "$.studentAssessmentRegistrationReference.assessmentIdentifier", "storage": { "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "AssessmentBatteryPart_DocumentId" + "canonical_column": "AssessmentIdentifier_Unified", + "presence_column": "StudentAssessmentRegistration_DocumentId" } }, { - "name": "StudentAssessmentRegistration_DocumentId", - "kind": "DocumentFk", + "name": "StudentAssessmentRegistration_AssigningEducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference", + "source_path": "$.studentAssessmentRegistrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentRegistration_AssessmentIdentifier", + "name": "StudentAssessmentRegistration_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.assessmentIdentifier", + "source_path": "$.studentAssessmentRegistrationReference.namespace", "storage": { "kind": "UnifiedAlias", - "canonical_column": "AssessmentIdentifier_Unified", + "canonical_column": "Namespace_Unified", "presence_column": "StudentAssessmentRegistration_DocumentId" } }, { - "name": "StudentAssessmentRegistration_Namespace", + "name": "StudentAssessmentRegistration_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.studentAssessmentRegistrationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentAssessmentRegistration_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentAssessmentRegistrationReference.namespace", + "source_path": "$.studentAssessmentRegistrationReference.studentUniqueId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "StudentAssessmentRegistration_DocumentId" + "kind": "Stored" } } ], @@ -69325,25 +69325,26 @@ } }, { - "name": "AssessmentGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentUniqueId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.assessmentGradeLevelDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "PlatformTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AssessmentAdministration_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.platformTypeDescriptor", + "is_nullable": false, + "source_path": "$.assessmentAdministrationReference", "storage": { "kind": "Stored" } @@ -69374,18 +69375,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentAdministration_AssigningEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentAdministration_Namespace", "kind": "Scalar", @@ -69400,201 +69389,212 @@ } }, { - "name": "ReportingEducationOrganization_EducationOrganizationId", + "name": "AssessmentAdministration_AssigningEducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reportingEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_42c01c7c2c", - "kind": "Scalar", + "name": "ReportingEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", + "source_path": "$.reportingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_44578471b1", + "name": "ReportingEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", + "source_path": "$.reportingEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_EducationOrganizationId", - "kind": "Scalar", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_8a1ccd30ea", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_EntryDate", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_42c01c7c2c", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.entryDate", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_SchoolId", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_44578471b1", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.schoolId", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "StudentUniqueId_Unified", - "kind": "Scalar", + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.studentEducationOrganizationAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "TestingEducationOrganization_EducationOrganizationId", + "name": "StudentEducationOrganizationAssociation_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.testingEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_DocumentId", - "kind": "DocumentFk", + "name": "StudentEducationOrganizationAssociation_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference", + "source_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "StudentUniqueId_Unified", + "presence_column": "StudentEducationOrganizationAssociation_DocumentId" } }, { - "name": "ReportingEducationOrganization_DocumentId", + "name": "StudentSchoolAssociation_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.reportingEducationOrganizationReference", + "is_nullable": false, + "source_path": "$.studentSchoolAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_8a1ccd30ea", - "kind": "DocumentFk", + "name": "StudentSchoolAssociation_EntryDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference", + "is_nullable": false, + "source_path": "$.studentSchoolAssociationReference.entryDate", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "DocumentFk", + "name": "StudentSchoolAssociation_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference", + "source_path": "$.studentSchoolAssociationReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_StudentUniqueId", + "name": "StudentSchoolAssociation_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId", + "source_path": "$.studentSchoolAssociationReference.studentUniqueId", "storage": { "kind": "UnifiedAlias", "canonical_column": "StudentUniqueId_Unified", - "presence_column": "StudentEducationOrganizationAssociation_DocumentId" + "presence_column": "StudentSchoolAssociation_DocumentId" } }, { - "name": "StudentSchoolAssociation_DocumentId", + "name": "TestingEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference", + "is_nullable": true, + "source_path": "$.testingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_StudentUniqueId", + "name": "TestingEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.testingEducationOrganizationReference.educationOrganizationId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "StudentUniqueId_Unified", - "presence_column": "StudentSchoolAssociation_DocumentId" + "kind": "Stored" } }, { - "name": "TestingEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.testingEducationOrganizationReference", + "source_path": "$.assessmentGradeLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PlatformTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.platformTypeDescriptor", "storage": { "kind": "Stored" } @@ -70147,6 +70147,117 @@ "kind": "Stored" } }, + { + "name": "Assessment_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.assessmentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Assessment_AssessmentIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.assessmentReference.assessmentIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Assessment_Namespace", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.assessmentReference.namespace", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReportedSchool_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.reportedSchoolReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReportedSchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.reportedSchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.schoolYearTypeReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrationEnvironmentDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -70279,32 +70390,6 @@ "kind": "Stored" } }, - { - "name": "Assessment_AssessmentIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.assessmentReference.assessmentIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Assessment_Namespace", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.assessmentReference.namespace", - "storage": { - "kind": "Stored" - } - }, { "name": "EventDescription", "kind": "Scalar", @@ -70355,30 +70440,6 @@ "kind": "Stored" } }, - { - "name": "ReportedSchool_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.reportedSchoolReference.schoolId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, { "name": "SerialNumber", "kind": "Scalar", @@ -70404,67 +70465,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.assessmentReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ReportedSchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.reportedSchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -70880,141 +70880,141 @@ } }, { - "name": "AssessmentItemResultDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentAssessmentItemAssessmentItem_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.items[*].assessmentItemResultDescriptor", + "source_path": "$.items[*].assessmentItemReference", "storage": { "kind": "Stored" } }, { - "name": "ResponseIndicatorDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentAssessmentItemAssessmentItem_AssessmentIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.items[*].responseIndicatorDescriptor", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemReference.assessmentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "AssessmentResponse", + "name": "StudentAssessmentItemAssessmentItem_Namespace", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, - "is_nullable": true, - "source_path": "$.items[*].assessmentResponse", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "DescriptiveFeedback", + "name": "StudentAssessmentItemAssessmentItem_IdentificationCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.items[*].descriptiveFeedback", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemReference.identificationCode", "storage": { "kind": "Stored" } }, { - "name": "ItemNumber", - "kind": "Scalar", + "name": "AssessmentItemResultDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.items[*].itemNumber", + "is_nullable": false, + "source_path": "$.items[*].assessmentItemResultDescriptor", "storage": { "kind": "Stored" } }, { - "name": "RawScoreResult", - "kind": "Scalar", + "name": "ResponseIndicatorDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 15, - "scale": 5 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.items[*].rawScoreResult", + "source_path": "$.items[*].responseIndicatorDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_AssessmentIdentifier", + "name": "AssessmentResponse", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference.assessmentIdentifier", + "is_nullable": true, + "source_path": "$.items[*].assessmentResponse", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_IdentificationCode", + "name": "DescriptiveFeedback", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference.identificationCode", + "is_nullable": true, + "source_path": "$.items[*].descriptiveFeedback", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_Namespace", + "name": "ItemNumber", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference.namespace", + "is_nullable": true, + "source_path": "$.items[*].itemNumber", "storage": { "kind": "Stored" } }, { - "name": "TimeAssessed", + "name": "RawScoreResult", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 30 + "kind": "Decimal", + "precision": 15, + "scale": 5 }, "is_nullable": true, - "source_path": "$.items[*].timeAssessed", + "source_path": "$.items[*].rawScoreResult", "storage": { "kind": "Stored" } }, { - "name": "StudentAssessmentItemAssessmentItem_DocumentId", - "kind": "DocumentFk", + "name": "TimeAssessed", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 30 }, - "is_nullable": false, - "source_path": "$.items[*].assessmentItemReference", + "is_nullable": true, + "source_path": "$.items[*].timeAssessed", "storage": { "kind": "Stored" } @@ -71429,6 +71429,57 @@ "kind": "Stored" } }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_Assess_2cf36d20d7", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_Namespace", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.namespace", + "storage": { + "kind": "Stored" + } + }, + { + "name": "StudentObjectiveAssessmentObjectiveAssessment_Identi_8450435919", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.identificationCode", + "storage": { + "kind": "Stored" + } + }, { "name": "AdministrationDate", "kind": "Scalar", @@ -71464,57 +71515,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_Assess_2cf36d20d7", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.assessmentIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_Identi_8450435919", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.identificationCode", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_Namespace", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference.namespace", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StudentObjectiveAssessmentObjectiveAssessment_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentObjectiveAssessments[*].objectiveAssessmentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -72265,183 +72265,183 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "TechnicalSkillsAssessmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.technicalSkillsAssessmentDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "NonTraditionalGenderStatus", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.nonTraditionalGenderStatus", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "PrivateCTEProgram", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.privateCTEProgram", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "TechnicalSkillsAssessmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.technicalSkillsAssessmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "NonTraditionalGenderStatus", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.nonTraditionalGenderStatus", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "PrivateCTEProgram", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.privateCTEProgram", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -73022,13 +73022,13 @@ } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "Cohort_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.cohortReference", "storage": { "kind": "Stored" } @@ -73059,13 +73059,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -73084,25 +73084,25 @@ } }, { - "name": "Cohort_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.cohortReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -73232,6 +73232,18 @@ "kind": "Stored" } }, + { + "name": "Section_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.sections[*].sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_LocalCourseCode", "kind": "Scalar", @@ -73269,19 +73281,6 @@ "kind": "Stored" } }, - { - "name": "Section_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.sections[*].sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Section_SessionName", "kind": "Scalar", @@ -73296,13 +73295,14 @@ } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Section_SectionIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.sections[*].sectionReference", + "source_path": "$.sections[*].sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } @@ -73412,13 +73412,13 @@ } }, { - "name": "CompetencyLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GradingPeriodGradingPeriod_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.competencyLevelDescriptor", + "source_path": "$.gradingPeriodReference", "storage": { "kind": "Stored" } @@ -73435,31 +73435,6 @@ "kind": "Stored" } }, - { - "name": "ObjectiveCompetencyObjective_ObjectiveGradeLevelDesc_5b5c253e2e", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.objectiveCompetencyObjectiveReference.objectiveGradeLevelDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DiagnosticStatement", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.diagnosticStatement", - "storage": { - "kind": "Stored" - } - }, { "name": "GradingPeriodGradingPeriod_GradingPeriodName", "kind": "Scalar", @@ -73497,6 +73472,18 @@ "kind": "Stored" } }, + { + "name": "ObjectiveCompetencyObjective_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.objectiveCompetencyObjectiveReference", + "storage": { + "kind": "Stored" + } + }, { "name": "ObjectiveCompetencyObjective_EducationOrganizationId", "kind": "Scalar", @@ -73523,50 +73510,63 @@ } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "ObjectiveCompetencyObjective_ObjectiveGradeLevelDesc_5b5c253e2e", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.objectiveCompetencyObjectiveReference.objectiveGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "GradingPeriodGradingPeriod_DocumentId", + "name": "Student_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.gradingPeriodReference", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ObjectiveCompetencyObjective_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.objectiveCompetencyObjectiveReference", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "CompetencyLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.competencyLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DiagnosticStatement", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.diagnosticStatement", "storage": { "kind": "Stored" } @@ -73798,25 +73798,25 @@ } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_7c5bfc584c", - "kind": "DescriptorFk", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_9ca396b829", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programTypeDescriptor", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_20ceb9d821", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_e4556d7896", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programEducationOrganizationId", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.beginDate", "storage": { "kind": "Stored" } @@ -73834,51 +73834,51 @@ } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_72e6052582", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_20ceb9d821", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programName", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_d759bcc32e", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_72e6052582", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 60 }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.studentUniqueId", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programName", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_e4556d7896", - "kind": "Scalar", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_7c5bfc584c", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.beginDate", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_9ca396b829", - "kind": "DocumentFk", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceGene_d759bcc32e", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference", + "source_path": "$.generalStudentProgramAssociations[*].generalStudentProgramAssociationReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -74002,101 +74002,101 @@ } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_1128ef7fe6", - "kind": "Scalar", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_393aa361a0", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.studentUniqueId", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_650d92a922", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_87433eab93", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sectionIdentifier", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.beginDate", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_82873650ab", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_8caa9ebb36", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sessionName", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_87433eab93", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_f52295ff38", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.beginDate", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_8caa9ebb36", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_c56563e4b7", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.localCourseCode", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_c56563e4b7", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_650d92a922", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolYear", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sectionIdentifier", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_f52295ff38", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_82873650ab", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.schoolId", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_393aa361a0", - "kind": "DocumentFk", + "name": "StudentCompetencyObjectiveSectionOrProgramChoiceStud_1128ef7fe6", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference", + "source_path": "$.studentSectionAssociations[*].studentSectionAssociationReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -74306,136 +74306,136 @@ } }, { - "name": "RelationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Contact_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.relationDescriptor", + "is_nullable": false, + "source_path": "$.contactReference", "storage": { "kind": "Stored" } }, { - "name": "ContactPriority", + "name": "Contact_ContactUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.contactPriority", + "is_nullable": false, + "source_path": "$.contactReference.contactUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ContactRestrictions", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 250 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.contactRestrictions", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "Contact_ContactUniqueId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.contactReference.contactUniqueId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "EmergencyContactStatus", - "kind": "Scalar", + "name": "RelationDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.emergencyContactStatus", + "source_path": "$.relationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "LegalGuardian", + "name": "ContactPriority", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.legalGuardian", + "source_path": "$.contactPriority", "storage": { "kind": "Stored" } }, { - "name": "LivesWith", + "name": "ContactRestrictions", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 250 }, "is_nullable": true, - "source_path": "$.livesWith", + "source_path": "$.contactRestrictions", "storage": { "kind": "Stored" } }, { - "name": "PrimaryContactStatus", + "name": "EmergencyContactStatus", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.primaryContactStatus", + "source_path": "$.emergencyContactStatus", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "LegalGuardian", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.legalGuardian", "storage": { "kind": "Stored" } }, { - "name": "Contact_DocumentId", - "kind": "DocumentFk", + "name": "LivesWith", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.contactReference", + "is_nullable": true, + "source_path": "$.livesWith", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "PrimaryContactStatus", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.primaryContactStatus", "storage": { "kind": "Stored" } @@ -74597,51 +74597,50 @@ } }, { - "name": "BehaviorDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.behaviorDescriptor", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } }, { - "name": "BehaviorDetailedDescription", + "name": "DisciplineIncident_IncidentIdentifier", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 36 }, - "is_nullable": true, - "source_path": "$.behaviorDetailedDescription", + "is_nullable": false, + "source_path": "$.disciplineIncidentReference.incidentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_IncidentIdentifier", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.incidentIdentifier", + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.schoolId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -74660,25 +74659,26 @@ } }, { - "name": "DisciplineIncident_DocumentId", - "kind": "DocumentFk", + "name": "BehaviorDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.behaviorDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "BehaviorDetailedDescription", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.behaviorDetailedDescription", "storage": { "kind": "Stored" } @@ -75075,63 +75075,63 @@ } }, { - "name": "DisciplineIncident_IncidentIdentifier", - "kind": "Scalar", + "name": "DisciplineIncident_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.incidentIdentifier", + "source_path": "$.disciplineIncidentReference", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_SchoolId", + "name": "DisciplineIncident_IncidentIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 36 }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference.schoolId", + "source_path": "$.disciplineIncidentReference.incidentIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "DisciplineIncident_SchoolId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.disciplineIncidentReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DisciplineIncident_DocumentId", + "name": "Student_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.disciplineIncidentReference", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -75377,50 +75377,50 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", + "name": "Student_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } @@ -75671,6 +75671,55 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, { "name": "BarrierToInternetAccessInResidenceDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -75779,18 +75828,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "GenderIdentity", "kind": "Scalar", @@ -75853,43 +75890,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -76465,98 +76465,122 @@ } }, { - "name": "AncestryEthnicOriginDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.ancestryEthnicOrigins[*].ancestryEthnicOriginDescriptor", - "storage": { - "kind": "Stored" - } - } - ], - "key_unification_classes": [], - "descriptor_fk_deduplications": [], - "constraints": [ - { - "kind": "Unique", - "name": "UX_StudentEducationOrganizationAssociationAncestryEt_82c4aa29b4", - "columns": [ - "StudentEducationOrganizationAssociation_DocumentId", - "AncestryEthnicOriginDescriptor_DescriptorId" - ] - }, - { - "kind": "ForeignKey", - "name": "FK_StudentEducationOrganizationAssociationAncestryEt_1ffe76a84c", - "columns": [ - "StudentEducationOrganizationAssociation_DocumentId" - ], - "target_table": { - "schema": "edfi", - "name": "StudentEducationOrganizationAssociation" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "Cascade", - "on_update": "NoAction" - }, - { - "kind": "ForeignKey", - "name": "FK_StudentEducationOrganizationAssociationAncestryEt_ceea8fef1b", - "columns": [ - "AncestryEthnicOriginDescriptor_DescriptorId" - ], - "target_table": { - "schema": "dms", - "name": "Descriptor" - }, - "target_columns": [ - "DocumentId" - ], - "on_delete": "NoAction", - "on_update": "NoAction" - } - ] - }, - { - "schema": "edfi", - "name": "StudentEducationOrganizationAssociationCohortYear", - "scope": "$.cohortYears[*]", - "key_columns": [ - { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "ParentKeyPart" - }, - { - "name": "Ordinal", - "kind": "Ordinal" - } - ], - "columns": [ - { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "ParentKeyPart", + "name": "AncestryEthnicOriginDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.ancestryEthnicOrigins[*].ancestryEthnicOriginDescriptor", + "storage": { + "kind": "Stored" + } + } + ], + "key_unification_classes": [], + "descriptor_fk_deduplications": [], + "constraints": [ + { + "kind": "Unique", + "name": "UX_StudentEducationOrganizationAssociationAncestryEt_82c4aa29b4", + "columns": [ + "StudentEducationOrganizationAssociation_DocumentId", + "AncestryEthnicOriginDescriptor_DescriptorId" + ] + }, + { + "kind": "ForeignKey", + "name": "FK_StudentEducationOrganizationAssociationAncestryEt_1ffe76a84c", + "columns": [ + "StudentEducationOrganizationAssociation_DocumentId" + ], + "target_table": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssociation" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "Cascade", + "on_update": "NoAction" + }, + { + "kind": "ForeignKey", + "name": "FK_StudentEducationOrganizationAssociationAncestryEt_ceea8fef1b", + "columns": [ + "AncestryEthnicOriginDescriptor_DescriptorId" + ], + "target_table": { + "schema": "dms", + "name": "Descriptor" + }, + "target_columns": [ + "DocumentId" + ], + "on_delete": "NoAction", + "on_update": "NoAction" + } + ] + }, + { + "schema": "edfi", + "name": "StudentEducationOrganizationAssociationCohortYear", + "scope": "$.cohortYears[*]", + "key_columns": [ + { + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "ParentKeyPart" + }, + { + "name": "Ordinal", + "kind": "Ordinal" + } + ], + "columns": [ + { + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "ParentKeyPart", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "Ordinal", + "kind": "Ordinal", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "CohortYearSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.cohortYears[*].schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "Ordinal", - "kind": "Ordinal", + "name": "CohortYearSchoolYear_SchoolYear", + "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.cohortYears[*].schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } @@ -76584,30 +76608,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "CohortYearSchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.cohortYears[*].schoolYearTypeReference.schoolYear", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CohortYearSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.cohortYears[*].schoolYearTypeReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -76888,74 +76888,74 @@ } }, { - "name": "DisplacedStudentStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DisplacedStudentCrisisEvent_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.displacedStudents[*].displacedStudentStatusDescriptor", + "source_path": "$.displacedStudents[*].crisisEventReference", "storage": { "kind": "Stored" } }, { - "name": "CrisisHomelessnessIndicator", + "name": "DisplacedStudentCrisisEvent_CrisisEventName", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 100 }, - "is_nullable": true, - "source_path": "$.displacedStudents[*].crisisHomelessnessIndicator", + "is_nullable": false, + "source_path": "$.displacedStudents[*].crisisEventReference.crisisEventName", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentCrisisEvent_CrisisEventName", - "kind": "Scalar", + "name": "DisplacedStudentStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 100 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.displacedStudents[*].crisisEventReference.crisisEventName", + "source_path": "$.displacedStudents[*].displacedStudentStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentEndDate", + "name": "CrisisHomelessnessIndicator", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.displacedStudents[*].displacedStudentEndDate", + "source_path": "$.displacedStudents[*].crisisHomelessnessIndicator", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentStartDate", + "name": "DisplacedStudentEndDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": true, - "source_path": "$.displacedStudents[*].displacedStudentStartDate", + "source_path": "$.displacedStudents[*].displacedStudentEndDate", "storage": { "kind": "Stored" } }, { - "name": "DisplacedStudentCrisisEvent_DocumentId", - "kind": "DocumentFk", + "name": "DisplacedStudentStartDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.displacedStudents[*].crisisEventReference", + "is_nullable": true, + "source_path": "$.displacedStudents[*].displacedStudentStartDate", "storage": { "kind": "Stored" } @@ -79178,25 +79178,13 @@ } }, { - "name": "ResponsibilityDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.responsibilityDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -79214,13 +79202,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -79239,25 +79227,37 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ResponsibilityDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.responsibilityDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } @@ -79421,62 +79421,13 @@ } }, { - "name": "AssignmentLateStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assignmentLateStatusDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "CompetencyLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.competencyLevelDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SubmissionStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GradebookEntry_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.submissionStatusDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DateFulfilled", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.dateFulfilled", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DiagnosticStatement", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.diagnosticStatement", + "is_nullable": false, + "source_path": "$.gradebookEntryReference", "storage": { "kind": "Stored" } @@ -79508,91 +79459,140 @@ } }, { - "name": "LetterGradeEarned", + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 20 + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AssignmentLateStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.letterGradeEarned", + "source_path": "$.assignmentLateStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "NumericGradeEarned", + "name": "CompetencyLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.competencyLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SubmissionStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.submissionStatusDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DateFulfilled", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "Date" }, "is_nullable": true, - "source_path": "$.numericGradeEarned", + "source_path": "$.dateFulfilled", "storage": { "kind": "Stored" } }, { - "name": "PointsEarned", + "name": "DiagnosticStatement", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 9, - "scale": 2 + "kind": "String", + "max_length": 1024 }, "is_nullable": true, - "source_path": "$.pointsEarned", + "source_path": "$.diagnosticStatement", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "LetterGradeEarned", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 20 }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.letterGradeEarned", "storage": { "kind": "Stored" } }, { - "name": "TimeFulfilled", + "name": "NumericGradeEarned", "kind": "Scalar", "type": { - "kind": "Time" + "kind": "Decimal", + "precision": 9, + "scale": 2 }, "is_nullable": true, - "source_path": "$.timeFulfilled", + "source_path": "$.numericGradeEarned", "storage": { "kind": "Stored" } }, { - "name": "GradebookEntry_DocumentId", - "kind": "DocumentFk", + "name": "PointsEarned", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 9, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.gradebookEntryReference", + "is_nullable": true, + "source_path": "$.pointsEarned", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TimeFulfilled", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Time" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.timeFulfilled", "storage": { "kind": "Stored" } @@ -79815,25 +79815,13 @@ } }, { - "name": "NonMedicalImmunizationExemptionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.nonMedicalImmunizationExemptionDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AsOfDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.asOfDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -79851,13 +79839,13 @@ } }, { - "name": "NonMedicalImmunizationExemptionDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.nonMedicalImmunizationExemptionDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -79876,25 +79864,37 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "NonMedicalImmunizationExemptionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.nonMedicalImmunizationExemptionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "AsOfDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.asOfDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NonMedicalImmunizationExemptionDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.nonMedicalImmunizationExemptionDate", "storage": { "kind": "Stored" } @@ -80473,13 +80473,62 @@ } }, { - "name": "HomelessPrimaryNighttimeResidenceDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.homelessPrimaryNighttimeResidenceDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } @@ -80496,6 +80545,43 @@ "kind": "Stored" } }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "HomelessPrimaryNighttimeResidenceDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.homelessPrimaryNighttimeResidenceDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ReasonExitedDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -80532,18 +80618,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "EndDate", "kind": "Scalar", @@ -80568,31 +80642,6 @@ "kind": "Stored" } }, - { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programReference.programName", - "storage": { - "kind": "Stored" - } - }, { "name": "ServedOutsideOfRegularSession", "kind": "Scalar", @@ -80604,55 +80653,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -81217,51 +81217,50 @@ } }, { - "name": "CohortCohort_CohortIdentifier", - "kind": "Scalar", + "name": "CohortCohort_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.cohortReference.cohortIdentifier", + "source_path": "$.cohortReference", "storage": { "kind": "Stored" } }, { - "name": "CohortCohort_EducationOrganizationId", + "name": "CohortCohort_CohortIdentifier", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 36 }, "is_nullable": true, - "source_path": "$.cohortReference.educationOrganizationId", + "source_path": "$.cohortReference.cohortIdentifier", "storage": { "kind": "Stored" } }, { - "name": "DiagnosticStatement", + "name": "CohortCohort_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.diagnosticStatement", + "source_path": "$.cohortReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "Dosage", - "kind": "Scalar", + "name": "Intervention_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.dosage", + "is_nullable": false, + "source_path": "$.interventionReference", "storage": { "kind": "Stored" } @@ -81292,50 +81291,51 @@ } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "CohortCohort_DocumentId", - "kind": "DocumentFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.cohortReference", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Intervention_DocumentId", - "kind": "DocumentFk", + "name": "DiagnosticStatement", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.interventionReference", + "is_nullable": true, + "source_path": "$.diagnosticStatement", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "Dosage", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.dosage", "storage": { "kind": "Stored" } @@ -81747,138 +81747,138 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Intervention_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", + "source_path": "$.interventionReference", "storage": { "kind": "Stored" } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Intervention_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", + "is_nullable": false, + "source_path": "$.interventionReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AttendanceEventReason", + "name": "Intervention_InterventionIdentificationCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", + "is_nullable": false, + "source_path": "$.interventionReference.interventionIdentificationCode", "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EventDuration", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.eventDuration", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "InterventionDuration", - "kind": "Scalar", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.interventionDuration", + "is_nullable": false, + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Intervention_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.interventionReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Intervention_InterventionIdentificationCode", + "name": "AttendanceEventReason", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.interventionReference.interventionIdentificationCode", + "is_nullable": true, + "source_path": "$.attendanceEventReason", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EventDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "Intervention_DocumentId", - "kind": "DocumentFk", + "name": "EventDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 3, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.interventionReference", + "is_nullable": true, + "source_path": "$.eventDuration", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "InterventionDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.interventionDuration", "storage": { "kind": "Stored" } @@ -82074,171 +82074,171 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "Dosage", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.dosage", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EnglishLearnerParticipation", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.englishLearnerParticipation", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "Dosage", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.dosage", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EnglishLearnerParticipation", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.englishLearnerParticipation", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -82431,73 +82431,73 @@ } }, { - "name": "MonitoredDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EnglishLanguageProficiencyAssessmentSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].monitoredDescriptor", + "is_nullable": false, + "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "ParticipationDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EnglishLanguageProficiencyAssessmentSchoolYear_SchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].participationDescriptor", + "is_nullable": false, + "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "ProficiencyDescriptor_DescriptorId", + "name": "MonitoredDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].proficiencyDescriptor", + "source_path": "$.englishLanguageProficiencyAssessments[*].monitoredDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgressDescriptor_DescriptorId", + "name": "ParticipationDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.englishLanguageProficiencyAssessments[*].progressDescriptor", + "source_path": "$.englishLanguageProficiencyAssessments[*].participationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EnglishLanguageProficiencyAssessmentSchoolYear_SchoolYear", - "kind": "Scalar", + "name": "ProficiencyDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference.schoolYear", + "is_nullable": true, + "source_path": "$.englishLanguageProficiencyAssessments[*].proficiencyDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EnglishLanguageProficiencyAssessmentSchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "ProgressDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.englishLanguageProficiencyAssessments[*].schoolYearTypeReference", + "is_nullable": true, + "source_path": "$.englishLanguageProficiencyAssessments[*].progressDescriptor", "storage": { "kind": "Stored" } @@ -83040,13 +83040,62 @@ } }, { - "name": "ContinuationOfServicesReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.continuationOfServicesReasonDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } @@ -83063,6 +83112,43 @@ "kind": "Stored" } }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ContinuationOfServicesReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.continuationOfServicesReasonDescriptor", + "storage": { + "kind": "Stored" + } + }, { "name": "ReasonExitedDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -83087,18 +83173,6 @@ "kind": "Stored" } }, - { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "EligibilityExpirationDate", "kind": "Scalar", @@ -83147,31 +83221,6 @@ "kind": "Stored" } }, - { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programReference.programName", - "storage": { - "kind": "Stored" - } - }, { "name": "QualifyingArrivalDate", "kind": "Scalar", @@ -83208,19 +83257,6 @@ "kind": "Stored" } }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "UsInitialEntry", "kind": "Scalar", @@ -83256,42 +83292,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -83836,183 +83836,183 @@ } }, { - "name": "ElaProgressLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.elaProgressLevelDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "MathematicsProgressLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.mathematicsProgressLevelDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "NeglectedOrDelinquentProgramDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.neglectedOrDelinquentProgramDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EndDate", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "ElaProgressLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.elaProgressLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "MathematicsProgressLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.mathematicsProgressLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "NeglectedOrDelinquentProgramDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.neglectedOrDelinquentProgramDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -84618,37 +84618,13 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -84666,13 +84642,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -84703,13 +84679,25 @@ } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -84728,37 +84716,49 @@ } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.programReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.endDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -85277,174 +85277,174 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "AttendanceEventReason", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EventDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EventDuration", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.eventDuration", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramAttendanceDuration", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.programAttendanceDuration", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "AttendanceEventReason", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.attendanceEventReason", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EventDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.eventDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EventDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 3, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.eventDuration", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ProgramAttendanceDuration", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.programAttendanceDuration", "storage": { "kind": "Stored" } @@ -85698,6 +85698,42 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.educationOrganizationReference.educationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluation_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", "kind": "DescriptorFk", @@ -85710,6 +85746,19 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEvaluationTitle", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -85722,6 +85771,31 @@ "kind": "Stored" } }, + { + "name": "ProgramEvaluation_ProgramEducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programEducationOrganizationId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluation_ProgramName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.programEvaluationReference.programName", + "storage": { + "kind": "Stored" + } + }, { "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", "kind": "DescriptorFk", @@ -85735,25 +85809,63 @@ } }, { - "name": "SummaryEvaluationRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StaffEvaluatorStaff_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.summaryEvaluationRatingLevelDescriptor", + "source_path": "$.staffEvaluatorStaffReference", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "StaffEvaluatorStaff_StaffUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": true, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.staffEvaluatorStaffReference.staffUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SummaryEvaluationRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.summaryEvaluationRatingLevelDescriptor", "storage": { "kind": "Stored" } @@ -85782,70 +85894,6 @@ "kind": "Stored" } }, - { - "name": "ProgramEvaluation_ProgramEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramEvaluationTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 50 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffEvaluatorStaff_StaffUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.staffEvaluatorStaffReference.staffUniqueId", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "SummaryEvaluationComment", "kind": "Scalar", @@ -85872,54 +85920,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluation_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programEvaluationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "StaffEvaluatorStaff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.staffEvaluatorStaffReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -86257,126 +86257,126 @@ } }, { - "name": "EvaluationElementRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentEvaluationElementProgramEvaluationElement_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.studentEvaluationElements[*].evaluationElementRatingLevelDescriptor", + "is_nullable": false, + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_38d123670f", - "kind": "DescriptorFk", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_56aa4525fb", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationPeriodDescriptor", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationElementTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_b27b83c178", - "kind": "DescriptorFk", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_467059facd", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTypeDescriptor", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_ef497c5466", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_38d123670f", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programTypeDescriptor", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationPeriodDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationElementNumericRating", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_57fb6d52f8", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 + "kind": "String", + "max_length": 50 }, - "is_nullable": true, - "source_path": "$.studentEvaluationElements[*].evaluationElementNumericRating", + "is_nullable": false, + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_467059facd", - "kind": "Scalar", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_b27b83c178", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEducationOrganizationId", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_56aa4525fb", + "name": "StudentEvaluationElementProgramEvaluationElement_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationElementTitle", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programName", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_Pro_57fb6d52f8", - "kind": "Scalar", + "name": "StudentEvaluationElementProgramEvaluationElement_Pro_ef497c5466", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programEvaluationTitle", + "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_ProgramName", - "kind": "Scalar", + "name": "EvaluationElementRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference.programName", + "is_nullable": true, + "source_path": "$.studentEvaluationElements[*].evaluationElementRatingLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationElementProgramEvaluationElement_DocumentId", - "kind": "DocumentFk", + "name": "EvaluationElementNumericRating", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 6, + "scale": 3 }, - "is_nullable": false, - "source_path": "$.studentEvaluationElements[*].programEvaluationElementReference", + "is_nullable": true, + "source_path": "$.studentEvaluationElements[*].evaluationElementNumericRating", "storage": { "kind": "Stored" } @@ -86559,37 +86559,38 @@ } }, { - "name": "EvaluationObjectiveRatingLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveRatingLevelDescriptor", + "is_nullable": false, + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_344bbaad76", - "kind": "DescriptorFk", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_74b56ed982", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programTypeDescriptor", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationObjectiveTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_5c8a926f84", - "kind": "DescriptorFk", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_dd70a2e950", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTypeDescriptor", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEducationOrganizationId", "storage": { "kind": "Stored" } @@ -86607,78 +86608,77 @@ } }, { - "name": "EvaluationObjectiveNumericRating", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_4b2b771726", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 + "kind": "String", + "max_length": 50 }, - "is_nullable": true, - "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveNumericRating", + "is_nullable": false, + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTitle", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_4b2b771726", - "kind": "Scalar", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_5c8a926f84", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTitle", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_74b56ed982", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_e1d44bbcf0", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEvaluationObjectiveTitle", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programName", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_dd70a2e950", - "kind": "Scalar", + "name": "StudentEvaluationObjectiveProgramEvaluationObjective_344bbaad76", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programEducationOrganizationId", + "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_e1d44bbcf0", - "kind": "Scalar", + "name": "EvaluationObjectiveRatingLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference.programName", + "is_nullable": true, + "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveRatingLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentEvaluationObjectiveProgramEvaluationObjective_DocumentId", - "kind": "DocumentFk", + "name": "EvaluationObjectiveNumericRating", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 6, + "scale": 3 }, - "is_nullable": false, - "source_path": "$.studentEvaluationObjectives[*].programEvaluationObjectiveReference", + "is_nullable": true, + "source_path": "$.studentEvaluationObjectives[*].evaluationObjectiveNumericRating", "storage": { "kind": "Stored" } @@ -87254,61 +87254,126 @@ } }, { - "name": "EnrollmentTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_Unified", + "kind": "Scalar", + "type": { + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.enrollmentTypeDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EntryGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.entryGradeLevelDescriptor", + "is_nullable": true, + "source_path": "$.calendarReference", "storage": { "kind": "Stored" } }, { - "name": "EntryGradeLevelReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.entryGradeLevelReasonDescriptor", + "source_path": "$.calendarReference.calendarCode", "storage": { "kind": "Stored" } }, { - "name": "EntryTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.calendarReference.schoolId", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Calendar_DocumentId" + } + }, + { + "name": "Calendar_SchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.calendarReference.schoolYear", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Calendar_DocumentId" + } + }, + { + "name": "ClassOfSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.entryTypeDescriptor", + "source_path": "$.classOfSchoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "ExitWithdrawTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ClassOfSchoolYear_ClassOfSchoolYear", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.classOfSchoolYearTypeReference.schoolYear", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GraduationPlan_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.exitWithdrawTypeDescriptor", + "source_path": "$.graduationPlanReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "GraduationPlan_EducationOrganizationId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.graduationPlanReference.educationOrganizationId", "storage": { "kind": "Stored" } @@ -87326,148 +87391,260 @@ } }, { - "name": "NextYearGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GraduationPlan_GraduationSchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.nextYearGradeLevelDescriptor", + "source_path": "$.graduationPlanReference.graduationSchoolYear", "storage": { "kind": "Stored" } }, { - "name": "ResidencyStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "NextYearSchool_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.residencyStatusDescriptor", + "source_path": "$.nextYearSchoolReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoiceBasisDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "NextYearSchool_SchoolId", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.nextYearSchoolReference.schoolId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.schoolChoiceBasisDescriptor", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "Calendar_CalendarCode", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.calendarReference.calendarCode", + "source_path": "$.schoolYearTypeReference.schoolYear", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "SchoolYear_DocumentId" + } + }, + { + "name": "School_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "ClassOfSchoolYear_ClassOfSchoolYear", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.classOfSchoolYearTypeReference.schoolYear", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EmployedWhileEnrolled", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EnrollmentTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.employedWhileEnrolled", + "source_path": "$.enrollmentTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EntryDate", - "kind": "Scalar", + "name": "EntryGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.entryDate", + "source_path": "$.entryGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ExitWithdrawDate", - "kind": "Scalar", + "name": "EntryGradeLevelReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.exitWithdrawDate", + "source_path": "$.entryGradeLevelReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "FullTimeEquivalency", - "kind": "Scalar", + "name": "EntryTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.fullTimeEquivalency", + "source_path": "$.entryTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "GraduationPlan_EducationOrganizationId", + "name": "ExitWithdrawTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.exitWithdrawTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NextYearGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.nextYearGradeLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ResidencyStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.residencyStatusDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolChoiceBasisDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.schoolChoiceBasisDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EmployedWhileEnrolled", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.graduationPlanReference.educationOrganizationId", + "source_path": "$.employedWhileEnrolled", "storage": { "kind": "Stored" } }, { - "name": "GraduationPlan_GraduationSchoolYear", + "name": "EntryDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.entryDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ExitWithdrawDate", + "kind": "Scalar", + "type": { + "kind": "Date" }, "is_nullable": true, - "source_path": "$.graduationPlanReference.graduationSchoolYear", + "source_path": "$.exitWithdrawDate", "storage": { "kind": "Stored" } }, { - "name": "NextYearSchool_SchoolId", + "name": "FullTimeEquivalency", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Decimal", + "precision": 5, + "scale": 4 }, "is_nullable": true, - "source_path": "$.nextYearSchoolReference.schoolId", + "source_path": "$.fullTimeEquivalency", "storage": { "kind": "Stored" } @@ -87520,43 +87697,6 @@ "kind": "Stored" } }, - { - "name": "SchoolId_Unified", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_Unified", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "Student_StudentUniqueId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", - "storage": { - "kind": "Stored" - } - }, { "name": "TermCompletionIndicator", "kind": "Scalar", @@ -87568,146 +87708,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.calendarReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Calendar_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.calendarReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Calendar_DocumentId" - } - }, - { - "name": "Calendar_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.calendarReference.schoolYear", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Calendar_DocumentId" - } - }, - { - "name": "ClassOfSchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.classOfSchoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "GraduationPlan_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.graduationPlanReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "NextYearSchool_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.nextYearSchoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SchoolYear_SchoolYear", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.schoolYearTypeReference.schoolYear", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "SchoolYear_DocumentId" - } - }, - { - "name": "School_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.schoolReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "School_SchoolId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", - "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" - } - }, - { - "name": "Student_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.studentReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [ @@ -88143,13 +88143,13 @@ } }, { - "name": "AlternativeGraduationPlan_GraduationPlanTypeDescript_0b71806181", - "kind": "DescriptorFk", + "name": "AlternativeGraduationPlan_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationPlanTypeDescriptor", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference", "storage": { "kind": "Stored" } @@ -88167,25 +88167,25 @@ } }, { - "name": "AlternativeGraduationPlan_GraduationSchoolYear", - "kind": "Scalar", + "name": "AlternativeGraduationPlan_GraduationPlanTypeDescript_0b71806181", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationSchoolYear", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationPlanTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "AlternativeGraduationPlan_DocumentId", - "kind": "DocumentFk", + "name": "AlternativeGraduationPlan_GraduationSchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationSchoolYear", "storage": { "kind": "Stored" } @@ -88569,114 +88569,67 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ArrivalTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.arrivalTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AttendanceEventReason", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DepartureTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.departureTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EventDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.eventDate", + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "EventDuration", + "name": "School_SchoolId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.eventDuration", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" } }, { - "name": "SchoolAttendanceDuration", - "kind": "Scalar", + "name": "Session_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.schoolAttendanceDuration", + "is_nullable": false, + "source_path": "$.sessionReference", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", + "name": "Session_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": false, - "source_path": null, + "source_path": "$.sessionReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Session_DocumentId" } }, { @@ -88704,6 +88657,18 @@ "kind": "Stored" } }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Student_StudentUniqueId", "kind": "Scalar", @@ -88718,65 +88683,100 @@ } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.schoolReference", + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ArrivalTime", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Time" }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "is_nullable": true, + "source_path": "$.arrivalTime", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" + "kind": "Stored" } }, { - "name": "Session_DocumentId", - "kind": "DocumentFk", + "name": "AttendanceEventReason", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.sessionReference", + "is_nullable": true, + "source_path": "$.attendanceEventReason", "storage": { "kind": "Stored" } }, { - "name": "Session_SchoolId", + "name": "DepartureTime", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Time" }, - "is_nullable": false, - "source_path": "$.sessionReference.schoolId", + "is_nullable": true, + "source_path": "$.departureTime", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Session_DocumentId" + "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EventDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.eventDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDuration", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 3, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.eventDuration", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SchoolAttendanceDuration", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.schoolAttendanceDuration", "storage": { "kind": "Stored" } @@ -89022,159 +89022,159 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "DirectCertification", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.directCertification", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.programName", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "DirectCertification", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.directCertification", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -89693,207 +89693,207 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "Section504DisabilityDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.section504DisabilityDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "AccommodationPlan", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.accommodationPlan", + "is_nullable": false, + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section504Eligibility", - "kind": "Scalar", + "name": "Section504DisabilityDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.section504Eligibility", + "is_nullable": true, + "source_path": "$.section504DisabilityDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section504EligibilityDecisionDate", + "name": "AccommodationPlan", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.section504EligibilityDecisionDate", + "source_path": "$.accommodationPlan", "storage": { "kind": "Stored" } }, { - "name": "Section504MeetingDate", + "name": "BeginDate", "kind": "Scalar", "type": { "kind": "Date" }, - "is_nullable": true, - "source_path": "$.section504MeetingDate", + "is_nullable": false, + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "EndDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "Section504Eligibility", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Boolean" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.section504Eligibility", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "Section504EligibilityDecisionDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.section504EligibilityDecisionDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "Section504MeetingDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.section504MeetingDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -90295,245 +90295,245 @@ } }, { - "name": "AttemptStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DualCreditEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.attemptStatusDescriptor", + "source_path": "$.dualCreditEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "DualCreditInstitutionDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "DualCreditEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.dualCreditInstitutionDescriptor", + "source_path": "$.dualCreditEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "DualCreditTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.dualCreditTypeDescriptor", + "is_nullable": false, + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } }, { - "name": "RepeatIdentifierDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_LocalCourseCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.repeatIdentifierDescriptor", + "is_nullable": false, + "source_path": "$.sectionReference.localCourseCode", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "Section_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.sectionReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "DualCreditEducationOrganization_EducationOrganizationId", + "name": "Section_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.dualCreditEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.sectionReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "DualCreditIndicator", + "name": "Section_SessionName", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.dualCreditIndicator", + "is_nullable": false, + "source_path": "$.sectionReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "DualHighSchoolCreditIndicator", + "name": "Section_SectionIdentifier", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.dualHighSchoolCreditIndicator", + "is_nullable": false, + "source_path": "$.sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "HomeroomIndicator", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.homeroomIndicator", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Section_LocalCourseCode", - "kind": "Scalar", + "name": "AttemptStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.localCourseCode", + "is_nullable": true, + "source_path": "$.attemptStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolId", - "kind": "Scalar", + "name": "DualCreditInstitutionDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.schoolId", + "is_nullable": true, + "source_path": "$.dualCreditInstitutionDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SchoolYear", - "kind": "Scalar", + "name": "DualCreditTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.schoolYear", + "is_nullable": true, + "source_path": "$.dualCreditTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SectionIdentifier", - "kind": "Scalar", + "name": "RepeatIdentifierDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.sectionReference.sectionIdentifier", + "is_nullable": true, + "source_path": "$.repeatIdentifierDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Section_SessionName", + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Date" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "DualCreditIndicator", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.dualCreditIndicator", "storage": { "kind": "Stored" } }, { - "name": "TeacherStudentDataLinkExclusion", + "name": "DualHighSchoolCreditIndicator", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.teacherStudentDataLinkExclusion", + "source_path": "$.dualHighSchoolCreditIndicator", "storage": { "kind": "Stored" } }, { - "name": "DualCreditEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.dualCreditEducationOrganizationReference", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "HomeroomIndicator", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.sectionReference", + "is_nullable": true, + "source_path": "$.homeroomIndicator", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TeacherStudentDataLinkExclusion", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.teacherStudentDataLinkExclusion", "storage": { "kind": "Stored" } @@ -90777,13 +90777,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference.programTypeDescriptor", + "source_path": "$.programs[*].programReference", "storage": { "kind": "Stored" } @@ -90814,13 +90814,13 @@ } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programs[*].programReference", + "source_path": "$.programs[*].programReference.programTypeDescriptor", "storage": { "kind": "Stored" } @@ -91006,100 +91006,13 @@ } }, { - "name": "AttendanceEventCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.attendanceEventCategoryDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EducationalEnvironmentDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Section_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.educationalEnvironmentDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ArrivalTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.arrivalTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "AttendanceEventReason", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": true, - "source_path": "$.attendanceEventReason", - "storage": { - "kind": "Stored" - } - }, - { - "name": "DepartureTime", - "kind": "Scalar", - "type": { - "kind": "Time" - }, - "is_nullable": true, - "source_path": "$.departureTime", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EventDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.eventDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "EventDuration", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 3, - "scale": 2 - }, - "is_nullable": true, - "source_path": "$.eventDuration", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SectionAttendanceDuration", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": true, - "source_path": "$.sectionAttendanceDuration", + "source_path": "$.sectionReference", "storage": { "kind": "Stored" } @@ -91141,6 +91054,19 @@ "kind": "Stored" } }, + { + "name": "Section_SessionName", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.sectionReference.sessionName", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_SectionIdentifier", "kind": "Scalar", @@ -91155,14 +91081,13 @@ } }, { - "name": "Section_SessionName", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference.sessionName", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } @@ -91181,25 +91106,100 @@ } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "AttendanceEventCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.sectionReference", + "source_path": "$.attendanceEventCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "EducationalEnvironmentDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, + "is_nullable": true, + "source_path": "$.educationalEnvironmentDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ArrivalTime", + "kind": "Scalar", + "type": { + "kind": "Time" + }, + "is_nullable": true, + "source_path": "$.arrivalTime", + "storage": { + "kind": "Stored" + } + }, + { + "name": "AttendanceEventReason", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.attendanceEventReason", + "storage": { + "kind": "Stored" + } + }, + { + "name": "DepartureTime", + "kind": "Scalar", + "type": { + "kind": "Time" + }, + "is_nullable": true, + "source_path": "$.departureTime", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, "is_nullable": false, - "source_path": "$.studentReference", + "source_path": "$.eventDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EventDuration", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 3, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.eventDuration", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionAttendanceDuration", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.sectionAttendanceDuration", "storage": { "kind": "Stored" } @@ -91372,38 +91372,38 @@ } }, { - "name": "ClassPeriod_ClassPeriodName", - "kind": "Scalar", + "name": "ClassPeriod_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", + "source_path": "$.classPeriods[*].classPeriodReference", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_SchoolId", + "name": "ClassPeriod_ClassPeriodName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference.schoolId", + "source_path": "$.classPeriods[*].classPeriodReference.classPeriodName", "storage": { "kind": "Stored" } }, { - "name": "ClassPeriod_DocumentId", - "kind": "DocumentFk", + "name": "ClassPeriod_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.classPeriods[*].classPeriodReference", + "source_path": "$.classPeriods[*].classPeriodReference.schoolId", "storage": { "kind": "Stored" } @@ -91553,61 +91553,13 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SpecialEducationExitReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.specialEducationExitReasonDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SpecialEducationSettingDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.specialEducationSettingDescriptor", - "storage": { - "kind": "Stored" - } - }, - { - "name": "BeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -91625,97 +91577,13 @@ } }, { - "name": "EndDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.endDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IdeaEligibility", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.ideaEligibility", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IepBeginDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.iepBeginDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IepEndDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.iepEndDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "IepReviewDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.iepReviewDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "LastEvaluationDate", - "kind": "Scalar", - "type": { - "kind": "Date" - }, - "is_nullable": true, - "source_path": "$.lastEvaluationDate", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MedicallyFragile", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.medicallyFragile", - "storage": { - "kind": "Stored" - } - }, - { - "name": "MultiplyDisabled", - "kind": "Scalar", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.multiplyDisabled", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -91746,84 +91614,188 @@ } }, { - "name": "ReductionInHoursPerWeekComparedToPeers", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.studentReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 2 + "kind": "String", + "max_length": 32 + }, + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.reductionInHoursPerWeekComparedToPeers", + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolHoursPerWeek", + "name": "SpecialEducationExitReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.specialEducationExitReasonDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SpecialEducationSettingDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.specialEducationSettingDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "BeginDate", "kind": "Scalar", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 2 + "kind": "Date" + }, + "is_nullable": false, + "source_path": "$.beginDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "EndDate", + "kind": "Scalar", + "type": { + "kind": "Date" }, "is_nullable": true, - "source_path": "$.schoolHoursPerWeek", + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", + "name": "IdeaEligibility", "kind": "Scalar", "type": { "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.ideaEligibility", "storage": { "kind": "Stored" } }, { - "name": "ShortenedSchoolDayIndicator", + "name": "IepBeginDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.shortenedSchoolDayIndicator", + "source_path": "$.iepBeginDate", "storage": { "kind": "Stored" } }, { - "name": "SpecialEducationExitDate", + "name": "IepEndDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": true, - "source_path": "$.specialEducationExitDate", + "source_path": "$.iepEndDate", "storage": { "kind": "Stored" } }, { - "name": "SpecialEducationExitExplained", + "name": "IepReviewDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Date" }, "is_nullable": true, - "source_path": "$.specialEducationExitExplained", + "source_path": "$.iepReviewDate", "storage": { "kind": "Stored" } }, { - "name": "SpecialEducationHoursPerWeek", + "name": "LastEvaluationDate", + "kind": "Scalar", + "type": { + "kind": "Date" + }, + "is_nullable": true, + "source_path": "$.lastEvaluationDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MedicallyFragile", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.medicallyFragile", + "storage": { + "kind": "Stored" + } + }, + { + "name": "MultiplyDisabled", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.multiplyDisabled", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ReductionInHoursPerWeekComparedToPeers", "kind": "Scalar", "type": { "kind": "Decimal", @@ -91831,56 +91803,84 @@ "scale": 2 }, "is_nullable": true, - "source_path": "$.specialEducationHoursPerWeek", + "source_path": "$.reductionInHoursPerWeekComparedToPeers", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "SchoolHoursPerWeek", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Decimal", + "precision": 5, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.schoolHoursPerWeek", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "ShortenedSchoolDayIndicator", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.shortenedSchoolDayIndicator", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "SpecialEducationExitDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.specialEducationExitDate", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SpecialEducationExitExplained", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.specialEducationExitExplained", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SpecialEducationHoursPerWeek", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 5, + "scale": 2 + }, + "is_nullable": true, + "source_path": "$.specialEducationHoursPerWeek", "storage": { "kind": "Stored" } @@ -92390,13 +92390,13 @@ } }, { - "name": "PrimaryProvider", - "kind": "Scalar", + "name": "ServiceProviderStaff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.serviceProviders[*].primaryProvider", + "is_nullable": false, + "source_path": "$.serviceProviders[*].staffReference", "storage": { "kind": "Stored" } @@ -92415,13 +92415,13 @@ } }, { - "name": "ServiceProviderStaff_DocumentId", - "kind": "DocumentFk", + "name": "PrimaryProvider", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.serviceProviders[*].staffReference", + "is_nullable": true, + "source_path": "$.serviceProviders[*].primaryProvider", "storage": { "kind": "Stored" } @@ -92787,13 +92787,13 @@ } }, { - "name": "PrimaryProvider", - "kind": "Scalar", + "name": "SpecialEducationProgramServiceServiceProviderStaff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.specialEducationProgramServices[*].providers[*].primaryProvider", + "is_nullable": false, + "source_path": "$.specialEducationProgramServices[*].providers[*].staffReference", "storage": { "kind": "Stored" } @@ -92812,13 +92812,13 @@ } }, { - "name": "SpecialEducationProgramServiceServiceProviderStaff_DocumentId", - "kind": "DocumentFk", + "name": "PrimaryProvider", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.specialEducationProgramServices[*].providers[*].staffReference", + "is_nullable": true, + "source_path": "$.specialEducationProgramServices[*].providers[*].primaryProvider", "storage": { "kind": "Stored" } @@ -93045,292 +93045,292 @@ } }, { - "name": "EligibilityDelayReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.eligibilityDelayReasonDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "EligibilityEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.eligibilityEvaluationTypeDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EvaluationDelayReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.evaluationDelayReasonDescriptor", + "is_nullable": false, + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "IdeaPartDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.ideaPartDescriptor", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_ProgramName", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "ConsentToEvaluationDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.consentToEvaluationDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ConsentToEvaluationReceivedDate", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.consentToEvaluationReceivedDate", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "EligibilityConferenceDate", - "kind": "Scalar", + "name": "EligibilityDelayReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.eligibilityConferenceDate", + "source_path": "$.eligibilityDelayReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EligibilityDeterminationDate", - "kind": "Scalar", + "name": "EligibilityEvaluationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.eligibilityDeterminationDate", + "source_path": "$.eligibilityEvaluationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EligibilityEvaluationDate", - "kind": "Scalar", + "name": "EvaluationDelayReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.eligibilityEvaluationDate", + "source_path": "$.evaluationDelayReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationCompleteIndicator", - "kind": "Scalar", + "name": "IdeaPartDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.evaluationCompleteIndicator", + "is_nullable": false, + "source_path": "$.ideaPartDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EvaluationDelayDays", + "name": "ConsentToEvaluationDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.evaluationDelayDays", + "source_path": "$.consentToEvaluationDate", "storage": { "kind": "Stored" } }, { - "name": "EvaluationLateReason", + "name": "ConsentToEvaluationReceivedDate", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.evaluationLateReason", + "is_nullable": false, + "source_path": "$.consentToEvaluationReceivedDate", "storage": { "kind": "Stored" } }, { - "name": "IdeaIndicator", + "name": "EligibilityConferenceDate", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.ideaIndicator", + "source_path": "$.eligibilityConferenceDate", "storage": { "kind": "Stored" } }, { - "name": "OriginalECIServicesDate", + "name": "EligibilityDeterminationDate", "kind": "Scalar", "type": { "kind": "Date" }, "is_nullable": true, - "source_path": "$.originalECIServicesDate", + "source_path": "$.eligibilityDeterminationDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", + "name": "EligibilityEvaluationDate", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.eligibilityEvaluationDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", + "name": "EvaluationCompleteIndicator", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.programReference.programName", + "is_nullable": true, + "source_path": "$.evaluationCompleteIndicator", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", + "name": "EvaluationDelayDays", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.evaluationDelayDays", "storage": { "kind": "Stored" } }, { - "name": "TransitionConferenceDate", + "name": "EvaluationLateReason", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 255 }, "is_nullable": true, - "source_path": "$.transitionConferenceDate", + "source_path": "$.evaluationLateReason", "storage": { "kind": "Stored" } }, { - "name": "TransitionNotificationDate", + "name": "IdeaIndicator", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.transitionNotificationDate", + "source_path": "$.ideaIndicator", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "OriginalECIServicesDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "is_nullable": true, + "source_path": "$.originalECIServicesDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "TransitionConferenceDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.transitionConferenceDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TransitionNotificationDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.transitionNotificationDate", "storage": { "kind": "Stored" } @@ -93642,159 +93642,159 @@ } }, { - "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ReasonExitedDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "EducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reasonExitedDescriptor", + "is_nullable": false, + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "TitleIPartAParticipantDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramProgram_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.titleIPartAParticipantDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } }, { - "name": "BeginDate", + "name": "ProgramProgram_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.beginDate", + "source_path": "$.programReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_EducationOrganizationId", + "name": "ProgramProgram_ProgramName", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.programReference.programName", "storage": { "kind": "Stored" } }, { - "name": "EndDate", - "kind": "Scalar", + "name": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.endDate", + "is_nullable": false, + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_EducationOrganizationId", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.educationOrganizationId", + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_ProgramName", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.programReference.programName", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ServedOutsideOfRegularSession", - "kind": "Scalar", + "name": "ReasonExitedDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.servedOutsideOfRegularSession", + "source_path": "$.reasonExitedDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "TitleIPartAParticipantDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.titleIPartAParticipantDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "BeginDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.beginDate", "storage": { "kind": "Stored" } }, { - "name": "ProgramProgram_DocumentId", - "kind": "DocumentFk", + "name": "EndDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": false, - "source_path": "$.programReference", + "is_nullable": true, + "source_path": "$.endDate", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "ServedOutsideOfRegularSession", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.servedOutsideOfRegularSession", "storage": { "kind": "Stored" } @@ -94342,126 +94342,126 @@ } }, { - "name": "StudentBusDetailsBusRouteDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.studentBusDetails.busRouteDescriptor", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "TransportationPublicExpenseEligibilityTypeDescriptor_16bbab4652", - "kind": "DescriptorFk", + "name": "Student_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.transportationPublicExpenseEligibilityTypeDescriptor", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "TransportationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "TransportationEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.transportationTypeDescriptor", + "is_nullable": false, + "source_path": "$.transportationEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "SpecialAccomodationRequirements", + "name": "TransportationEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 1024 + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.specialAccomodationRequirements", + "is_nullable": false, + "source_path": "$.transportationEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentBusDetailsBusNumber", - "kind": "Scalar", + "name": "StudentBusDetailsBusRouteDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 36 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentBusDetails.busNumber", + "source_path": "$.studentBusDetails.busRouteDescriptor", "storage": { "kind": "Stored" } }, { - "name": "StudentBusDetailsMileage", - "kind": "Scalar", + "name": "TransportationPublicExpenseEligibilityTypeDescriptor_16bbab4652", + "kind": "DescriptorFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 2 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.studentBusDetails.mileage", + "source_path": "$.transportationPublicExpenseEligibilityTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "TransportationTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.transportationTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "TransportationEducationOrganization_EducationOrganizationId", + "name": "SpecialAccomodationRequirements", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 1024 }, - "is_nullable": false, - "source_path": "$.transportationEducationOrganizationReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.specialAccomodationRequirements", "storage": { "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "StudentBusDetailsBusNumber", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 36 }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.studentBusDetails.busNumber", "storage": { "kind": "Stored" } }, { - "name": "TransportationEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "StudentBusDetailsMileage", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 5, + "scale": 2 }, - "is_nullable": false, - "source_path": "$.transportationEducationOrganizationReference", + "is_nullable": true, + "source_path": "$.studentBusDetails.mileage", "storage": { "kind": "Stored" } @@ -94901,61 +94901,86 @@ } }, { - "name": "BirthCountryDescriptor_DescriptorId", + "name": "Person_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.personReference", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_PersonId", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 32 + }, + "is_nullable": true, + "source_path": "$.personReference.personId", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Person_SourceSystemDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.birthCountryDescriptor", + "source_path": "$.personReference.sourceSystemDescriptor", "storage": { "kind": "Stored" } }, { - "name": "BirthSexDescriptor_DescriptorId", + "name": "BirthCountryDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.birthSexDescriptor", + "source_path": "$.birthCountryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "BirthStateAbbreviationDescriptor_DescriptorId", + "name": "BirthSexDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.birthStateAbbreviationDescriptor", + "source_path": "$.birthSexDescriptor", "storage": { "kind": "Stored" } }, { - "name": "CitizenshipStatusDescriptor_DescriptorId", + "name": "BirthStateAbbreviationDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.citizenshipStatusDescriptor", + "source_path": "$.birthStateAbbreviationDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Person_SourceSystemDescriptor_DescriptorId", + "name": "CitizenshipStatusDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.personReference.sourceSystemDescriptor", + "source_path": "$.citizenshipStatusDescriptor", "storage": { "kind": "Stored" } @@ -95087,19 +95112,6 @@ "kind": "Stored" } }, - { - "name": "Person_PersonId", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 32 - }, - "is_nullable": true, - "source_path": "$.personReference.personId", - "storage": { - "kind": "Stored" - } - }, { "name": "PersonalTitlePrefix", "kind": "Scalar", @@ -95151,18 +95163,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Person_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.personReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -96253,6 +96253,18 @@ "kind": "Stored" } }, + { + "name": "Course_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.courseReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Course_CourseCode", "kind": "Scalar", @@ -96279,51 +96291,39 @@ } }, { - "name": "Survey_Namespace", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", + "name": "Survey_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "Course_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" + "max_length": 255 }, "is_nullable": false, - "source_path": "$.courseReference", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "Survey_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } @@ -96481,13 +96481,13 @@ } }, { - "name": "Program_ProgramTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Program_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programReference.programTypeDescriptor", + "source_path": "$.programReference", "storage": { "kind": "Stored" } @@ -96518,51 +96518,51 @@ } }, { - "name": "Survey_Namespace", - "kind": "Scalar", + "name": "Program_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.programReference.programTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "Program_DocumentId", - "kind": "DocumentFk", + "name": "Survey_Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.programReference", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "Survey_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } @@ -96732,19 +96732,6 @@ "kind": "Stored" } }, - { - "name": "Comment", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 1024 - }, - "is_nullable": true, - "source_path": "$.comment", - "storage": { - "kind": "Stored" - } - }, { "name": "Namespace_Unified", "kind": "Scalar", @@ -96758,18 +96745,6 @@ "kind": "Stored" } }, - { - "name": "NoResponse", - "kind": "Scalar", - "type": { - "kind": "Boolean" - }, - "is_nullable": true, - "source_path": "$.noResponse", - "storage": { - "kind": "Stored" - } - }, { "name": "SurveyIdentifier_Unified", "kind": "Scalar", @@ -96784,39 +96759,26 @@ } }, { - "name": "SurveyQuestion_QuestionCode", - "kind": "Scalar", + "name": "SurveyQuestion_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyQuestionReference.questionCode", + "source_path": "$.surveyQuestionReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyResponseIdentifier", + "name": "SurveyQuestion_QuestionCode", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveyQuestion_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.surveyQuestionReference", + "source_path": "$.surveyQuestionReference.questionCode", "storage": { "kind": "Stored" } @@ -96892,6 +96854,44 @@ "canonical_column": "SurveyIdentifier_Unified", "presence_column": "SurveyResponse_DocumentId" } + }, + { + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, + { + "name": "Comment", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 1024 + }, + "is_nullable": true, + "source_path": "$.comment", + "storage": { + "kind": "Stored" + } + }, + { + "name": "NoResponse", + "kind": "Scalar", + "type": { + "kind": "Boolean" + }, + "is_nullable": true, + "source_path": "$.noResponse", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -97319,23 +97319,24 @@ } }, { - "name": "QuestionFormDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Namespace_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.questionFormDescriptor", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "Namespace_Unified", + "name": "SurveyIdentifier_Unified", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, "source_path": null, @@ -97344,42 +97345,45 @@ } }, { - "name": "QuestionCode", - "kind": "Scalar", + "name": "SurveySection_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.questionCode", + "is_nullable": true, + "source_path": "$.surveySectionReference", "storage": { "kind": "Stored" } }, { - "name": "QuestionText", + "name": "SurveySection_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 1024 + "max_length": 255 }, - "is_nullable": false, - "source_path": "$.questionText", + "is_nullable": true, + "source_path": "$.surveySectionReference.namespace", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "Namespace_Unified", + "presence_column": "SurveySection_DocumentId" } }, { - "name": "SurveyIdentifier_Unified", + "name": "SurveySection_SurveyIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.surveySectionReference.surveyIdentifier", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SurveyIdentifier_Unified", + "presence_column": "SurveySection_DocumentId" } }, { @@ -97396,87 +97400,83 @@ } }, { - "name": "SurveySection_DocumentId", + "name": "Survey_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.surveySectionReference", + "is_nullable": false, + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "SurveySection_Namespace", + "name": "Survey_Namespace", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, - "is_nullable": true, - "source_path": "$.surveySectionReference.namespace", + "is_nullable": false, + "source_path": "$.surveyReference.namespace", "storage": { "kind": "UnifiedAlias", "canonical_column": "Namespace_Unified", - "presence_column": "SurveySection_DocumentId" + "presence_column": "Survey_DocumentId" } }, { - "name": "SurveySection_SurveyIdentifier", + "name": "Survey_SurveyIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, - "is_nullable": true, - "source_path": "$.surveySectionReference.surveyIdentifier", + "is_nullable": false, + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "UnifiedAlias", "canonical_column": "SurveyIdentifier_Unified", - "presence_column": "SurveySection_DocumentId" + "presence_column": "Survey_DocumentId" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "QuestionFormDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.questionFormDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Survey_Namespace", + "name": "QuestionCode", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.questionCode", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "Namespace_Unified", - "presence_column": "Survey_DocumentId" + "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", + "name": "QuestionText", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 1024 }, "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "source_path": "$.questionText", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SurveyIdentifier_Unified", - "presence_column": "Survey_DocumentId" + "kind": "Stored" } } ], @@ -97905,76 +97905,76 @@ } }, { - "name": "EducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.educationOrganizationReference.educationOrganizationId", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_Namespace", + "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.surveyResponseReference.namespace", + "source_path": "$.educationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyIdentifier", - "kind": "Scalar", + "name": "SurveyResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyIdentifier", + "source_path": "$.surveyResponseReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyResponseIdentifier", + "name": "SurveyResponse_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "source_path": "$.surveyResponseReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.educationOrganizationReference", + "source_path": "$.surveyResponseReference.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseReference", + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", "storage": { "kind": "Stored" } @@ -98112,77 +98112,77 @@ } }, { - "name": "Staff_StaffUniqueId", - "kind": "Scalar", + "name": "Staff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_Namespace", + "name": "Staff_StaffUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 32 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.namespace", + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyIdentifier", - "kind": "Scalar", + "name": "SurveyResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyIdentifier", + "source_path": "$.surveyResponseReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_SurveyResponseIdentifier", + "name": "SurveyResponse_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "source_path": "$.surveyResponseReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Staff_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.surveyResponseReference.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponse_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseReference", + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", "storage": { "kind": "Stored" } @@ -98320,190 +98320,190 @@ } }, { - "name": "ElectronicMailAddress", - "kind": "Scalar", + "name": "SurveyResponderChoiceContact_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 128 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.electronicMailAddress", + "is_nullable": false, + "source_path": "$.contactReference", "storage": { "kind": "Stored" } }, { - "name": "FullName", + "name": "SurveyResponderChoiceContact_ContactUniqueId", "kind": "Scalar", "type": { "kind": "String", - "max_length": 80 + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.fullName", + "is_nullable": false, + "source_path": "$.contactReference.contactUniqueId", "storage": { "kind": "Stored" } }, { - "name": "Location", - "kind": "Scalar", + "name": "SurveyResponderChoiceStaff_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 75 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.location", + "is_nullable": false, + "source_path": "$.staffReference", "storage": { "kind": "Stored" } }, { - "name": "ResponseDate", + "name": "SurveyResponderChoiceStaff_StaffUniqueId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.responseDate", + "source_path": "$.staffReference.staffUniqueId", "storage": { "kind": "Stored" } }, { - "name": "ResponseTime", - "kind": "Scalar", + "name": "SurveyResponderChoiceStudent_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.responseTime", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceContact_ContactUniqueId", + "name": "SurveyResponderChoiceStudent_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.contactReference.contactUniqueId", + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStaff_StaffUniqueId", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.staffReference.staffUniqueId", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStudent_StudentUniqueId", + "name": "Survey_Namespace", "kind": "Scalar", "type": { "kind": "String", - "max_length": 32 + "max_length": 255 }, "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponseIdentifier", + "name": "Survey_SurveyIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyResponseIdentifier", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Survey_Namespace", + "name": "ElectronicMailAddress", "kind": "Scalar", "type": { "kind": "String", - "max_length": 255 + "max_length": 128 }, - "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "is_nullable": true, + "source_path": "$.electronicMailAddress", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", + "name": "FullName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 60 + "max_length": 80 }, - "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "is_nullable": true, + "source_path": "$.fullName", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceContact_DocumentId", - "kind": "DocumentFk", + "name": "Location", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 75 }, - "is_nullable": false, - "source_path": "$.contactReference", + "is_nullable": true, + "source_path": "$.location", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStaff_DocumentId", - "kind": "DocumentFk", + "name": "ResponseDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": false, - "source_path": "$.staffReference", + "source_path": "$.responseDate", "storage": { "kind": "Stored" } }, { - "name": "SurveyResponderChoiceStudent_DocumentId", - "kind": "DocumentFk", + "name": "ResponseTime", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.responseTime", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "SurveyResponseIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyResponseIdentifier", "storage": { "kind": "Stored" } @@ -98810,6 +98810,18 @@ "kind": "Stored" } }, + { + "name": "Section_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.sectionReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Section_LocalCourseCode", "kind": "Scalar", @@ -98847,19 +98859,6 @@ "kind": "Stored" } }, - { - "name": "Section_SectionIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.sectionReference.sectionIdentifier", - "storage": { - "kind": "Stored" - } - }, { "name": "Section_SessionName", "kind": "Scalar", @@ -98874,51 +98873,52 @@ } }, { - "name": "Survey_Namespace", + "name": "Section_SectionIdentifier", "kind": "Scalar", "type": { "kind": "String", "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyReference.namespace", + "source_path": "$.sectionReference.sectionIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Survey_SurveyIdentifier", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveyReference.surveyIdentifier", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } }, { - "name": "Section_DocumentId", - "kind": "DocumentFk", + "name": "Survey_Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.sectionReference", + "source_path": "$.surveyReference.namespace", "storage": { "kind": "Stored" } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "Survey_SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveyReference.surveyIdentifier", "storage": { "kind": "Stored" } @@ -99064,6 +99064,18 @@ "kind": "Stored" } }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.educationOrganizationReference", + "storage": { + "kind": "Stored" + } + }, { "name": "EducationOrganization_EducationOrganizationId", "kind": "Scalar", @@ -99077,14 +99089,13 @@ } }, { - "name": "SurveySectionResponse_SurveyResponseIdentifier", - "kind": "Scalar", + "name": "SurveySectionResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "source_path": "$.surveySectionResponseReference", "storage": { "kind": "Stored" } @@ -99115,6 +99126,19 @@ "kind": "Stored" } }, + { + "name": "SurveySectionResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "SurveySectionResponse_SurveySectionReferenceNamespace", "kind": "Scalar", @@ -99153,30 +99177,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.educationOrganizationReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveySectionResponse_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.surveySectionResponseReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -99319,6 +99319,18 @@ "kind": "Stored" } }, + { + "name": "Staff_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": false, + "source_path": "$.staffReference", + "storage": { + "kind": "Stored" + } + }, { "name": "Staff_StaffUniqueId", "kind": "Scalar", @@ -99333,14 +99345,13 @@ } }, { - "name": "SurveySectionResponse_SurveyResponseIdentifier", - "kind": "Scalar", + "name": "SurveySectionResponse_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "source_path": "$.surveySectionResponseReference", "storage": { "kind": "Stored" } @@ -99371,6 +99382,19 @@ "kind": "Stored" } }, + { + "name": "SurveySectionResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveySectionResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "SurveySectionResponse_SurveySectionReferenceNamespace", "kind": "Scalar", @@ -99409,30 +99433,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "Staff_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.staffReference", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveySectionResponse_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": "$.surveySectionResponseReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -99588,20 +99588,6 @@ "kind": "Stored" } }, - { - "name": "SectionRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 9, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.sectionRating", - "storage": { - "kind": "Stored" - } - }, { "name": "SurveyIdentifier_Unified", "kind": "Scalar", @@ -99615,32 +99601,6 @@ "kind": "Stored" } }, - { - "name": "SurveyResponse_SurveyResponseIdentifier", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 60 - }, - "is_nullable": false, - "source_path": "$.surveyResponseReference.surveyResponseIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveySection_SurveySectionTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.surveySectionReference.surveySectionTitle", - "storage": { - "kind": "Stored" - } - }, { "name": "SurveyResponse_DocumentId", "kind": "DocumentFk", @@ -99683,6 +99643,19 @@ "presence_column": "SurveyResponse_DocumentId" } }, + { + "name": "SurveyResponse_SurveyResponseIdentifier", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 60 + }, + "is_nullable": false, + "source_path": "$.surveyResponseReference.surveyResponseIdentifier", + "storage": { + "kind": "Stored" + } + }, { "name": "SurveySection_DocumentId", "kind": "DocumentFk", @@ -99724,6 +99697,33 @@ "canonical_column": "SurveyIdentifier_Unified", "presence_column": "SurveySection_DocumentId" } + }, + { + "name": "SurveySection_SurveySectionTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": false, + "source_path": "$.surveySectionReference.surveySectionTitle", + "storage": { + "kind": "Stored" + } + }, + { + "name": "SectionRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 9, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.sectionRating", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -99915,14 +99915,13 @@ } }, { - "name": "SurveySectionTitle", - "kind": "Scalar", + "name": "Survey_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.surveySectionTitle", + "source_path": "$.surveyReference", "storage": { "kind": "Stored" } @@ -99954,13 +99953,14 @@ } }, { - "name": "Survey_DocumentId", - "kind": "DocumentFk", + "name": "SurveySectionTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.surveyReference", + "source_path": "$.surveySectionTitle", "storage": { "kind": "Stored" } @@ -100079,13 +100079,25 @@ } }, { - "name": "SurveyCategoryDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_Unified", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": false, + "source_path": null, + "storage": { + "kind": "Stored" + } + }, + { + "name": "EducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.surveyCategoryDescriptor", + "source_path": "$.educationOrganizationReference", "storage": { "kind": "Stored" } @@ -100103,38 +100115,39 @@ } }, { - "name": "Namespace", - "kind": "Scalar", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.namespace", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "NumberAdministered", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.numberAdministered", + "is_nullable": false, + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "SchoolYear_DocumentId" } }, { - "name": "SchoolYear_Unified", - "kind": "Scalar", + "name": "Session_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.sessionReference", "storage": { "kind": "Stored" } @@ -100152,106 +100165,93 @@ } }, { - "name": "Session_SessionName", + "name": "Session_SchoolYear", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.sessionReference.sessionName", + "source_path": "$.sessionReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Session_DocumentId" } }, { - "name": "SurveyIdentifier", + "name": "Session_SessionName", "kind": "Scalar", "type": { "kind": "String", "max_length": 60 }, - "is_nullable": false, - "source_path": "$.surveyIdentifier", - "storage": { - "kind": "Stored" - } - }, - { - "name": "SurveyTitle", - "kind": "Scalar", - "type": { - "kind": "String", - "max_length": 255 - }, - "is_nullable": false, - "source_path": "$.surveyTitle", + "is_nullable": true, + "source_path": "$.sessionReference.sessionName", "storage": { "kind": "Stored" } }, { - "name": "EducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "SurveyCategoryDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.educationOrganizationReference", + "source_path": "$.surveyCategoryDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "Namespace", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.namespace", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", + "name": "NumberAdministered", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.schoolYearTypeReference.schoolYear", + "is_nullable": true, + "source_path": "$.numberAdministered", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "SchoolYear_DocumentId" + "kind": "Stored" } }, { - "name": "Session_DocumentId", - "kind": "DocumentFk", + "name": "SurveyIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, - "is_nullable": true, - "source_path": "$.sessionReference", + "is_nullable": false, + "source_path": "$.surveyIdentifier", "storage": { "kind": "Stored" } }, { - "name": "Session_SchoolYear", + "name": "SurveyTitle", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 255 }, - "is_nullable": true, - "source_path": "$.sessionReference.schoolYear", + "is_nullable": false, + "source_path": "$.surveyTitle", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Session_DocumentId" + "kind": "Stored" } } ], diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/sample/expected/authoritative-derived-relational-model-set.json b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/sample/expected/authoritative-derived-relational-model-set.json index c66438e50..22b4c4e6e 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/sample/expected/authoritative-derived-relational-model-set.json +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/Fixtures/authoritative/sample/expected/authoritative-derived-relational-model-set.json @@ -29360,6 +29360,19 @@ "identity_projection_columns": [ "School_SchoolId", "WeekIdentifier" + ], + "resource_key_id": 4, + "project_name": "Ed-Fi", + "resource_name": "AcademicWeek", + "identity_elements": [ + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "WeekIdentifier", + "identity_json_path": "$.weekIdentifier" + } ] }, { @@ -29391,6 +29404,23 @@ "EducationOrganization_EducationOrganizationId", "RatingTitle", "SchoolYear_SchoolYear" + ], + "resource_key_id": 7, + "project_name": "Ed-Fi", + "resource_name": "AccountabilityRating", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "RatingTitle", + "identity_json_path": "$.ratingTitle" + }, + { + "column": "SchoolYear_SchoolYear", + "identity_json_path": "$.schoolYearTypeReference.schoolYear" + } ] }, { @@ -29422,6 +29452,19 @@ "identity_projection_columns": [ "AssessmentIdentifier", "Namespace" + ], + "resource_key_id": 14, + "project_name": "Ed-Fi", + "resource_name": "Assessment", + "identity_elements": [ + { + "column": "AssessmentIdentifier", + "identity_json_path": "$.assessmentIdentifier" + }, + { + "column": "Namespace", + "identity_json_path": "$.namespace" + } ] }, { @@ -29466,6 +29509,27 @@ "Assessment_AssessmentIdentifier", "Assessment_Namespace", "AssigningEducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 15, + "project_name": "Ed-Fi", + "resource_name": "AssessmentAdministration", + "identity_elements": [ + { + "column": "AdministrationIdentifier", + "identity_json_path": "$.administrationIdentifier" + }, + { + "column": "Assessment_AssessmentIdentifier", + "identity_json_path": "$.assessmentReference.assessmentIdentifier" + }, + { + "column": "Assessment_Namespace", + "identity_json_path": "$.assessmentReference.namespace" + }, + { + "column": "AssigningEducationOrganization_EducationOrganizationId", + "identity_json_path": "$.assigningEducationOrganizationReference.educationOrganizationId" + } ] }, { @@ -29513,6 +29577,31 @@ "AssessmentAdministration_AssigningEducationOrganizationId", "AssessmentAdministration_Namespace", "ParticipatingEducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 16, + "project_name": "Ed-Fi", + "resource_name": "AssessmentAdministrationParticipation", + "identity_elements": [ + { + "column": "AssessmentAdministration_AdministrationIdentifier", + "identity_json_path": "$.assessmentAdministrationReference.administrationIdentifier" + }, + { + "column": "AssessmentAdministration_AssessmentIdentifier", + "identity_json_path": "$.assessmentAdministrationReference.assessmentIdentifier" + }, + { + "column": "AssessmentAdministration_AssigningEducationOrganizationId", + "identity_json_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId" + }, + { + "column": "AssessmentAdministration_Namespace", + "identity_json_path": "$.assessmentAdministrationReference.namespace" + }, + { + "column": "ParticipatingEducationOrganization_EducationOrganizationId", + "identity_json_path": "$.participatingEducationOrganizationReference.educationOrganizationId" + } ] }, { @@ -29595,6 +29684,23 @@ "AssessmentBatteryPartName", "Assessment_AssessmentIdentifier", "Assessment_Namespace" + ], + "resource_key_id": 17, + "project_name": "Ed-Fi", + "resource_name": "AssessmentBatteryPart", + "identity_elements": [ + { + "column": "AssessmentBatteryPartName", + "identity_json_path": "$.assessmentBatteryPartName" + }, + { + "column": "Assessment_AssessmentIdentifier", + "identity_json_path": "$.assessmentReference.assessmentIdentifier" + }, + { + "column": "Assessment_Namespace", + "identity_json_path": "$.assessmentReference.namespace" + } ] }, { @@ -29651,6 +29757,23 @@ "Assessment_AssessmentIdentifier", "Assessment_Namespace", "IdentificationCode" + ], + "resource_key_id": 20, + "project_name": "Ed-Fi", + "resource_name": "AssessmentItem", + "identity_elements": [ + { + "column": "Assessment_AssessmentIdentifier", + "identity_json_path": "$.assessmentReference.assessmentIdentifier" + }, + { + "column": "Assessment_Namespace", + "identity_json_path": "$.assessmentReference.namespace" + }, + { + "column": "IdentificationCode", + "identity_json_path": "$.identificationCode" + } ] }, { @@ -29776,9 +29899,26 @@ "DocumentId" ], "identity_projection_columns": [ - "Assessment_AssessmentIdentifier", - "Assessment_Namespace", + "AssessmentIdentifier_Unified", + "Namespace_Unified", "ScoreRangeId" + ], + "resource_key_id": 25, + "project_name": "Ed-Fi", + "resource_name": "AssessmentScoreRangeLearningStandard", + "identity_elements": [ + { + "column": "Assessment_AssessmentIdentifier", + "identity_json_path": "$.assessmentReference.assessmentIdentifier" + }, + { + "column": "Assessment_Namespace", + "identity_json_path": "$.assessmentReference.namespace" + }, + { + "column": "ScoreRangeId", + "identity_json_path": "$.scoreRangeId" + } ] }, { @@ -29792,8 +29932,8 @@ "DocumentId" ], "identity_projection_columns": [ - "Assessment_AssessmentIdentifier", - "Assessment_Namespace", + "AssessmentIdentifier_Unified", + "Namespace_Unified", "ScoreRangeId" ] }, @@ -29834,6 +29974,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 29, + "project_name": "Ed-Fi", + "resource_name": "BalanceSheetDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -29876,6 +30029,19 @@ "identity_projection_columns": [ "BellScheduleName", "School_SchoolId" + ], + "resource_key_id": 32, + "project_name": "Ed-Fi", + "resource_name": "BellSchedule", + "identity_elements": [ + { + "column": "BellScheduleName", + "identity_json_path": "$.bellScheduleName" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + } ] }, { @@ -29943,6 +30109,23 @@ "CalendarCode", "School_SchoolId", "SchoolYear_SchoolYear" + ], + "resource_key_id": 35, + "project_name": "Ed-Fi", + "resource_name": "Calendar", + "identity_elements": [ + { + "column": "CalendarCode", + "identity_json_path": "$.calendarCode" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "SchoolYear_SchoolYear", + "identity_json_path": "$.schoolYearTypeReference.schoolYear" + } ] }, { @@ -29976,6 +30159,27 @@ "Calendar_SchoolId", "Calendar_SchoolYear", "Date" + ], + "resource_key_id": 36, + "project_name": "Ed-Fi", + "resource_name": "CalendarDate", + "identity_elements": [ + { + "column": "Calendar_CalendarCode", + "identity_json_path": "$.calendarReference.calendarCode" + }, + { + "column": "Calendar_SchoolId", + "identity_json_path": "$.calendarReference.schoolId" + }, + { + "column": "Calendar_SchoolYear", + "identity_json_path": "$.calendarReference.schoolYear" + }, + { + "column": "Date", + "identity_json_path": "$.date" + } ] }, { @@ -30032,7 +30236,24 @@ "identity_projection_columns": [ "AccountIdentifier", "EducationOrganization_EducationOrganizationId", - "FiscalYear" + "FiscalYear_Unified" + ], + "resource_key_id": 40, + "project_name": "Ed-Fi", + "resource_name": "ChartOfAccount", + "identity_elements": [ + { + "column": "AccountIdentifier", + "identity_json_path": "$.accountIdentifier" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -30048,7 +30269,7 @@ "identity_projection_columns": [ "AccountIdentifier", "EducationOrganization_EducationOrganizationId", - "FiscalYear" + "FiscalYear_Unified" ] }, { @@ -30076,6 +30297,19 @@ "identity_projection_columns": [ "ClassPeriodName", "School_SchoolId" + ], + "resource_key_id": 44, + "project_name": "Ed-Fi", + "resource_name": "ClassPeriod", + "identity_elements": [ + { + "column": "ClassPeriodName", + "identity_json_path": "$.classPeriodName" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + } ] }, { @@ -30118,6 +30352,19 @@ "identity_projection_columns": [ "CohortIdentifier", "EducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 46, + "project_name": "Ed-Fi", + "resource_name": "Cohort", + "identity_elements": [ + { + "column": "CohortIdentifier", + "identity_json_path": "$.cohortIdentifier" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + } ] }, { @@ -30163,7 +30410,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "CommunityOrganizationId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:CommunityOrganization" }, { "name": "TR_CommunityOrganization_ReferentialIdentity", @@ -30177,7 +30431,27 @@ ], "identity_projection_columns": [ "CommunityOrganizationId" - ] + ], + "resource_key_id": 50, + "project_name": "Ed-Fi", + "resource_name": "CommunityOrganization", + "identity_elements": [ + { + "column": "CommunityOrganizationId", + "identity_json_path": "$.communityOrganizationId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "CommunityOrganizationId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_CommunityOrganization_Stamp", @@ -30305,7 +30579,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "CommunityProviderId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:CommunityProvider" }, { "name": "TR_CommunityProvider_ReferentialIdentity", @@ -30319,7 +30600,27 @@ ], "identity_projection_columns": [ "CommunityProviderId" - ] + ], + "resource_key_id": 51, + "project_name": "Ed-Fi", + "resource_name": "CommunityProvider", + "identity_elements": [ + { + "column": "CommunityProviderId", + "identity_json_path": "$.communityProviderId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "CommunityProviderId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_CommunityProvider_Stamp", @@ -30445,6 +30746,23 @@ "CommunityProvider_CommunityProviderId", "LicenseIdentifier", "LicensingOrganization" + ], + "resource_key_id": 52, + "project_name": "Ed-Fi", + "resource_name": "CommunityProviderLicense", + "identity_elements": [ + { + "column": "CommunityProvider_CommunityProviderId", + "identity_json_path": "$.communityProviderReference.communityProviderId" + }, + { + "column": "LicenseIdentifier", + "identity_json_path": "$.licenseIdentifier" + }, + { + "column": "LicensingOrganization", + "identity_json_path": "$.licensingOrganization" + } ] }, { @@ -30477,6 +30795,23 @@ "EducationOrganization_EducationOrganizationId", "Objective", "ObjectiveGradeLevelDescriptor_DescriptorId" + ], + "resource_key_id": 54, + "project_name": "Ed-Fi", + "resource_name": "CompetencyObjective", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "Objective", + "identity_json_path": "$.objective" + }, + { + "column": "ObjectiveGradeLevelDescriptor_DescriptorId", + "identity_json_path": "$.objectiveGradeLevelDescriptor" + } ] }, { @@ -30507,6 +30842,15 @@ ], "identity_projection_columns": [ "ContactUniqueId" + ], + "resource_key_id": 55, + "project_name": "Ed-Fi", + "resource_name": "Contact", + "identity_elements": [ + { + "column": "ContactUniqueId", + "identity_json_path": "$.contactUniqueId" + } ] }, { @@ -30644,6 +30988,19 @@ "identity_projection_columns": [ "CourseCode", "EducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 61, + "project_name": "Ed-Fi", + "resource_name": "Course", + "identity_elements": [ + { + "column": "CourseCode", + "identity_json_path": "$.courseCode" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + } ] }, { @@ -30745,10 +31102,34 @@ ], "identity_projection_columns": [ "LocalCourseCode", - "School_SchoolId", - "Session_SchoolId", + "SchoolId_Unified", "Session_SchoolYear", "Session_SessionName" + ], + "resource_key_id": 67, + "project_name": "Ed-Fi", + "resource_name": "CourseOffering", + "identity_elements": [ + { + "column": "LocalCourseCode", + "identity_json_path": "$.localCourseCode" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "Session_SchoolId", + "identity_json_path": "$.sessionReference.schoolId" + }, + { + "column": "Session_SchoolYear", + "identity_json_path": "$.sessionReference.schoolYear" + }, + { + "column": "Session_SessionName", + "identity_json_path": "$.sessionReference.sessionName" + } ] }, { @@ -30763,8 +31144,7 @@ ], "identity_projection_columns": [ "LocalCourseCode", - "School_SchoolId", - "Session_SchoolId", + "SchoolId_Unified", "Session_SchoolYear", "Session_SessionName" ] @@ -30823,6 +31203,39 @@ "StudentAcademicRecord_SchoolYear", "StudentAcademicRecord_StudentUniqueId", "StudentAcademicRecord_TermDescriptor_DescriptorId" + ], + "resource_key_id": 69, + "project_name": "Ed-Fi", + "resource_name": "CourseTranscript", + "identity_elements": [ + { + "column": "CourseAttemptResultDescriptor_DescriptorId", + "identity_json_path": "$.courseAttemptResultDescriptor" + }, + { + "column": "CourseCourse_CourseCode", + "identity_json_path": "$.courseReference.courseCode" + }, + { + "column": "CourseCourse_EducationOrganizationId", + "identity_json_path": "$.courseReference.educationOrganizationId" + }, + { + "column": "StudentAcademicRecord_EducationOrganizationId", + "identity_json_path": "$.studentAcademicRecordReference.educationOrganizationId" + }, + { + "column": "StudentAcademicRecord_SchoolYear", + "identity_json_path": "$.studentAcademicRecordReference.schoolYear" + }, + { + "column": "StudentAcademicRecord_StudentUniqueId", + "identity_json_path": "$.studentAcademicRecordReference.studentUniqueId" + }, + { + "column": "StudentAcademicRecord_TermDescriptor_DescriptorId", + "identity_json_path": "$.studentAcademicRecordReference.termDescriptor" + } ] }, { @@ -30942,6 +31355,19 @@ "identity_projection_columns": [ "CredentialIdentifier", "StateOfIssueStateAbbreviationDescriptor_DescriptorId" + ], + "resource_key_id": 70, + "project_name": "Ed-Fi", + "resource_name": "Credential", + "identity_elements": [ + { + "column": "CredentialIdentifier", + "identity_json_path": "$.credentialIdentifier" + }, + { + "column": "StateOfIssueStateAbbreviationDescriptor_DescriptorId", + "identity_json_path": "$.stateOfIssueStateAbbreviationDescriptor" + } ] }, { @@ -31007,6 +31433,15 @@ ], "identity_projection_columns": [ "CrisisEventName" + ], + "resource_key_id": 75, + "project_name": "Ed-Fi", + "resource_name": "CrisisEvent", + "identity_elements": [ + { + "column": "CrisisEventName", + "identity_json_path": "$.crisisEventName" + } ] }, { @@ -31038,7 +31473,28 @@ "MappedValue", "Namespace", "Value" - ] + ], + "resource_key_id": 79, + "project_name": "Ed-Fi", + "resource_name": "DescriptorMapping", + "identity_elements": [ + { + "column": "MappedNamespace", + "identity_json_path": "$.mappedNamespace" + }, + { + "column": "MappedValue", + "identity_json_path": "$.mappedValue" + }, + { + "column": "Namespace", + "identity_json_path": "$.namespace" + }, + { + "column": "Value", + "identity_json_path": "$.value" + } + ] }, { "name": "TR_DescriptorMapping_Stamp", @@ -31083,6 +31539,23 @@ "DisciplineActionIdentifier", "DisciplineDate", "Student_StudentUniqueId" + ], + "resource_key_id": 86, + "project_name": "Ed-Fi", + "resource_name": "DisciplineAction", + "identity_elements": [ + { + "column": "DisciplineActionIdentifier", + "identity_json_path": "$.disciplineActionIdentifier" + }, + { + "column": "DisciplineDate", + "identity_json_path": "$.disciplineDate" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -31150,6 +31623,19 @@ "identity_projection_columns": [ "IncidentIdentifier", "School_SchoolId" + ], + "resource_key_id": 89, + "project_name": "Ed-Fi", + "resource_name": "DisciplineIncident", + "identity_elements": [ + { + "column": "IncidentIdentifier", + "identity_json_path": "$.incidentIdentifier" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + } ] }, { @@ -31215,6 +31701,15 @@ ], "identity_projection_columns": [ "ContentIdentifier" + ], + "resource_key_id": 94, + "project_name": "Ed-Fi", + "resource_name": "EducationContent", + "identity_elements": [ + { + "column": "ContentIdentifier", + "identity_json_path": "$.contentIdentifier" + } ] }, { @@ -31345,6 +31840,23 @@ "EducationOrganization_EducationOrganizationId", "InterventionPrescriptionInterventionPrescription_Edu_532babb247", "InterventionPrescriptionInterventionPrescription_Int_409fc39d28" + ], + "resource_key_id": 99, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganizationInterventionPrescriptionAssociation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "InterventionPrescriptionInterventionPrescription_Edu_532babb247", + "identity_json_path": "$.interventionPrescriptionReference.educationOrganizationId" + }, + { + "column": "InterventionPrescriptionInterventionPrescription_Int_409fc39d28", + "identity_json_path": "$.interventionPrescriptionReference.interventionPrescriptionIdentificationCode" + } ] }, { @@ -31363,7 +31875,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "EducationOrganizationNetworkId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:EducationOrganizationNetwork" }, { "name": "TR_EducationOrganizationNetwork_ReferentialIdentity", @@ -31377,7 +31896,27 @@ ], "identity_projection_columns": [ "EducationOrganizationNetworkId" - ] + ], + "resource_key_id": 100, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganizationNetwork", + "identity_elements": [ + { + "column": "EducationOrganizationNetworkId", + "identity_json_path": "$.educationOrganizationNetworkId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "EducationOrganizationNetworkId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_EducationOrganizationNetwork_Stamp", @@ -31430,6 +31969,19 @@ "identity_projection_columns": [ "EducationOrganizationNetwork_EducationOrganizationNetworkId", "MemberEducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 101, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganizationNetworkAssociation", + "identity_elements": [ + { + "column": "EducationOrganizationNetwork_EducationOrganizationNetworkId", + "identity_json_path": "$.educationOrganizationNetworkReference.educationOrganizationNetworkId" + }, + { + "column": "MemberEducationOrganization_EducationOrganizationId", + "identity_json_path": "$.memberEducationOrganizationReference.educationOrganizationId" + } ] }, { @@ -31532,6 +32084,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "PeerEducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 102, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganizationPeerAssociation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "PeerEducationOrganization_EducationOrganizationId", + "identity_json_path": "$.peerEducationOrganizationReference.educationOrganizationId" + } ] }, { @@ -31565,7 +32130,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "EducationServiceCenterId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:EducationServiceCenter" }, { "name": "TR_EducationServiceCenter_ReferentialIdentity", @@ -31579,7 +32151,27 @@ ], "identity_projection_columns": [ "EducationServiceCenterId" - ] + ], + "resource_key_id": 104, + "project_name": "Ed-Fi", + "resource_name": "EducationServiceCenter", + "identity_elements": [ + { + "column": "EducationServiceCenterId", + "identity_json_path": "$.educationServiceCenterId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "EducationServiceCenterId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_EducationServiceCenter_Stamp", @@ -31710,6 +32302,43 @@ "ProgramEvaluationElement_ProgramEvaluationTypeDescri_18bd7f7e71", "ProgramEvaluationElement_ProgramName", "ProgramEvaluationElement_ProgramTypeDescriptor_DescriptorId" + ], + "resource_key_id": 114, + "project_name": "Ed-Fi", + "resource_name": "EvaluationRubricDimension", + "identity_elements": [ + { + "column": "EvaluationRubricRating", + "identity_json_path": "$.evaluationRubricRating" + }, + { + "column": "ProgramEvaluationElement_ProgramEducationOrganizationId", + "identity_json_path": "$.programEvaluationElementReference.programEducationOrganizationId" + }, + { + "column": "ProgramEvaluationElement_ProgramEvaluationElementTitle", + "identity_json_path": "$.programEvaluationElementReference.programEvaluationElementTitle" + }, + { + "column": "ProgramEvaluationElement_ProgramEvaluationPeriodDesc_cc4f929706", + "identity_json_path": "$.programEvaluationElementReference.programEvaluationPeriodDescriptor" + }, + { + "column": "ProgramEvaluationElement_ProgramEvaluationTitle", + "identity_json_path": "$.programEvaluationElementReference.programEvaluationTitle" + }, + { + "column": "ProgramEvaluationElement_ProgramEvaluationTypeDescri_18bd7f7e71", + "identity_json_path": "$.programEvaluationElementReference.programEvaluationTypeDescriptor" + }, + { + "column": "ProgramEvaluationElement_ProgramName", + "identity_json_path": "$.programEvaluationElementReference.programName" + }, + { + "column": "ProgramEvaluationElement_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationElementReference.programTypeDescriptor" + } ] }, { @@ -31747,6 +32376,23 @@ "BeginDate", "FeederSchool_SchoolId", "School_SchoolId" + ], + "resource_key_id": 117, + "project_name": "Ed-Fi", + "resource_name": "FeederSchoolAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "FeederSchool_SchoolId", + "identity_json_path": "$.feederSchoolReference.schoolId" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + } ] }, { @@ -31778,6 +32424,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 119, + "project_name": "Ed-Fi", + "resource_name": "FunctionDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -31820,6 +32479,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 120, + "project_name": "Ed-Fi", + "resource_name": "FundDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -31863,15 +32535,66 @@ "GradeTypeDescriptor_DescriptorId", "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", "GradingPeriodGradingPeriod_GradingPeriodName", - "GradingPeriodGradingPeriod_SchoolId", - "GradingPeriodGradingPeriod_SchoolYear", + "SchoolId_Unified", + "SchoolYear_Unified", "StudentSectionAssociation_BeginDate", "StudentSectionAssociation_LocalCourseCode", - "StudentSectionAssociation_SchoolId", - "StudentSectionAssociation_SchoolYear", "StudentSectionAssociation_SectionIdentifier", "StudentSectionAssociation_SessionName", "StudentSectionAssociation_StudentUniqueId" + ], + "resource_key_id": 122, + "project_name": "Ed-Fi", + "resource_name": "Grade", + "identity_elements": [ + { + "column": "GradeTypeDescriptor_DescriptorId", + "identity_json_path": "$.gradeTypeDescriptor" + }, + { + "column": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "identity_json_path": "$.gradingPeriodReference.gradingPeriodDescriptor" + }, + { + "column": "GradingPeriodGradingPeriod_GradingPeriodName", + "identity_json_path": "$.gradingPeriodReference.gradingPeriodName" + }, + { + "column": "GradingPeriodGradingPeriod_SchoolId", + "identity_json_path": "$.gradingPeriodReference.schoolId" + }, + { + "column": "GradingPeriodGradingPeriod_SchoolYear", + "identity_json_path": "$.gradingPeriodReference.schoolYear" + }, + { + "column": "StudentSectionAssociation_BeginDate", + "identity_json_path": "$.studentSectionAssociationReference.beginDate" + }, + { + "column": "StudentSectionAssociation_LocalCourseCode", + "identity_json_path": "$.studentSectionAssociationReference.localCourseCode" + }, + { + "column": "StudentSectionAssociation_SchoolId", + "identity_json_path": "$.studentSectionAssociationReference.schoolId" + }, + { + "column": "StudentSectionAssociation_SchoolYear", + "identity_json_path": "$.studentSectionAssociationReference.schoolYear" + }, + { + "column": "StudentSectionAssociation_SectionIdentifier", + "identity_json_path": "$.studentSectionAssociationReference.sectionIdentifier" + }, + { + "column": "StudentSectionAssociation_SessionName", + "identity_json_path": "$.studentSectionAssociationReference.sessionName" + }, + { + "column": "StudentSectionAssociation_StudentUniqueId", + "identity_json_path": "$.studentSectionAssociationReference.studentUniqueId" + } ] }, { @@ -31888,12 +32611,10 @@ "GradeTypeDescriptor_DescriptorId", "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", "GradingPeriodGradingPeriod_GradingPeriodName", - "GradingPeriodGradingPeriod_SchoolId", - "GradingPeriodGradingPeriod_SchoolYear", + "SchoolId_Unified", + "SchoolYear_Unified", "StudentSectionAssociation_BeginDate", "StudentSectionAssociation_LocalCourseCode", - "StudentSectionAssociation_SchoolId", - "StudentSectionAssociation_SchoolYear", "StudentSectionAssociation_SectionIdentifier", "StudentSectionAssociation_SessionName", "StudentSectionAssociation_StudentUniqueId" @@ -31924,6 +32645,19 @@ "identity_projection_columns": [ "GradebookEntryIdentifier", "Namespace" + ], + "resource_key_id": 126, + "project_name": "Ed-Fi", + "resource_name": "GradebookEntry", + "identity_elements": [ + { + "column": "GradebookEntryIdentifier", + "identity_json_path": "$.gradebookEntryIdentifier" + }, + { + "column": "Namespace", + "identity_json_path": "$.namespace" + } ] }, { @@ -31968,6 +32702,27 @@ "GradingPeriodName", "School_SchoolId", "SchoolYear_SchoolYear" + ], + "resource_key_id": 128, + "project_name": "Ed-Fi", + "resource_name": "GradingPeriod", + "identity_elements": [ + { + "column": "GradingPeriodDescriptor_DescriptorId", + "identity_json_path": "$.gradingPeriodDescriptor" + }, + { + "column": "GradingPeriodName", + "identity_json_path": "$.gradingPeriodName" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "SchoolYear_SchoolYear", + "identity_json_path": "$.schoolYearTypeReference.schoolYear" + } ] }, { @@ -32001,6 +32756,23 @@ "EducationOrganization_EducationOrganizationId", "GraduationPlanTypeDescriptor_DescriptorId", "GraduationSchoolYear_GraduationSchoolYear" + ], + "resource_key_id": 130, + "project_name": "Ed-Fi", + "resource_name": "GraduationPlan", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "GraduationPlanTypeDescriptor_DescriptorId", + "identity_json_path": "$.graduationPlanTypeDescriptor" + }, + { + "column": "GraduationSchoolYear_GraduationSchoolYear", + "identity_json_path": "$.graduationSchoolYearTypeReference.schoolYear" + } ] }, { @@ -32104,6 +32876,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "InterventionIdentificationCode" + ], + "resource_key_id": 147, + "project_name": "Ed-Fi", + "resource_name": "Intervention", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "InterventionIdentificationCode", + "identity_json_path": "$.interventionIdentificationCode" + } ] }, { @@ -32230,6 +33015,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "InterventionPrescriptionIdentificationCode" + ], + "resource_key_id": 150, + "project_name": "Ed-Fi", + "resource_name": "InterventionPrescription", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "InterventionPrescriptionIdentificationCode", + "identity_json_path": "$.interventionPrescriptionIdentificationCode" + } ] }, { @@ -32356,6 +33154,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "InterventionStudyIdentificationCode" + ], + "resource_key_id": 151, + "project_name": "Ed-Fi", + "resource_name": "InterventionStudy", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "InterventionStudyIdentificationCode", + "identity_json_path": "$.interventionStudyIdentificationCode" + } ] }, { @@ -32493,6 +33304,15 @@ ], "identity_projection_columns": [ "LearningStandardId" + ], + "resource_key_id": 155, + "project_name": "Ed-Fi", + "resource_name": "LearningStandard", + "identity_elements": [ + { + "column": "LearningStandardId", + "identity_json_path": "$.learningStandardId" + } ] }, { @@ -32547,6 +33367,23 @@ "Namespace", "SourceLearningStandard_LearningStandardId", "TargetLearningStandard_LearningStandardId" + ], + "resource_key_id": 157, + "project_name": "Ed-Fi", + "resource_name": "LearningStandardEquivalenceAssociation", + "identity_elements": [ + { + "column": "Namespace", + "identity_json_path": "$.namespace" + }, + { + "column": "SourceLearningStandard_LearningStandardId", + "identity_json_path": "$.sourceLearningStandardReference.learningStandardId" + }, + { + "column": "TargetLearningStandard_LearningStandardId", + "identity_json_path": "$.targetLearningStandardReference.learningStandardId" + } ] }, { @@ -32602,7 +33439,24 @@ "identity_projection_columns": [ "AccountIdentifier", "EducationOrganization_EducationOrganizationId", - "FiscalYear" + "FiscalYear_Unified" + ], + "resource_key_id": 164, + "project_name": "Ed-Fi", + "resource_name": "LocalAccount", + "identity_elements": [ + { + "column": "AccountIdentifier", + "identity_json_path": "$.accountIdentifier" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -32618,7 +33472,7 @@ "identity_projection_columns": [ "AccountIdentifier", "EducationOrganization_EducationOrganizationId", - "FiscalYear" + "FiscalYear_Unified" ] }, { @@ -32648,6 +33502,27 @@ "LocalAccount_AccountIdentifier", "LocalAccount_EducationOrganizationId", "LocalAccount_FiscalYear" + ], + "resource_key_id": 165, + "project_name": "Ed-Fi", + "resource_name": "LocalActual", + "identity_elements": [ + { + "column": "AsOfDate", + "identity_json_path": "$.asOfDate" + }, + { + "column": "LocalAccount_AccountIdentifier", + "identity_json_path": "$.localAccountReference.accountIdentifier" + }, + { + "column": "LocalAccount_EducationOrganizationId", + "identity_json_path": "$.localAccountReference.educationOrganizationId" + }, + { + "column": "LocalAccount_FiscalYear", + "identity_json_path": "$.localAccountReference.fiscalYear" + } ] }, { @@ -32682,9 +33557,30 @@ "LocalAccount_AccountIdentifier", "LocalAccount_EducationOrganizationId", "LocalAccount_FiscalYear" - ] - }, - { + ], + "resource_key_id": 166, + "project_name": "Ed-Fi", + "resource_name": "LocalBudget", + "identity_elements": [ + { + "column": "AsOfDate", + "identity_json_path": "$.asOfDate" + }, + { + "column": "LocalAccount_AccountIdentifier", + "identity_json_path": "$.localAccountReference.accountIdentifier" + }, + { + "column": "LocalAccount_EducationOrganizationId", + "identity_json_path": "$.localAccountReference.educationOrganizationId" + }, + { + "column": "LocalAccount_FiscalYear", + "identity_json_path": "$.localAccountReference.fiscalYear" + } + ] + }, + { "name": "TR_LocalBudget_Stamp", "table": { "schema": "edfi", @@ -32717,6 +33613,31 @@ "LocalAccount_EducationOrganizationId", "LocalAccount_FiscalYear", "Staff_StaffUniqueId" + ], + "resource_key_id": 167, + "project_name": "Ed-Fi", + "resource_name": "LocalContractedStaff", + "identity_elements": [ + { + "column": "AsOfDate", + "identity_json_path": "$.asOfDate" + }, + { + "column": "LocalAccount_AccountIdentifier", + "identity_json_path": "$.localAccountReference.accountIdentifier" + }, + { + "column": "LocalAccount_EducationOrganizationId", + "identity_json_path": "$.localAccountReference.educationOrganizationId" + }, + { + "column": "LocalAccount_FiscalYear", + "identity_json_path": "$.localAccountReference.fiscalYear" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -32753,7 +33674,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "LocalEducationAgencyId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:LocalEducationAgency" }, { "name": "TR_LocalEducationAgency_ReferentialIdentity", @@ -32767,7 +33695,27 @@ ], "identity_projection_columns": [ "LocalEducationAgencyId" - ] + ], + "resource_key_id": 168, + "project_name": "Ed-Fi", + "resource_name": "LocalEducationAgency", + "identity_elements": [ + { + "column": "LocalEducationAgencyId", + "identity_json_path": "$.localEducationAgencyId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "LocalEducationAgencyId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_LocalEducationAgency_Stamp", @@ -32918,6 +33866,27 @@ "LocalAccount_AccountIdentifier", "LocalAccount_EducationOrganizationId", "LocalAccount_FiscalYear" + ], + "resource_key_id": 170, + "project_name": "Ed-Fi", + "resource_name": "LocalEncumbrance", + "identity_elements": [ + { + "column": "AsOfDate", + "identity_json_path": "$.asOfDate" + }, + { + "column": "LocalAccount_AccountIdentifier", + "identity_json_path": "$.localAccountReference.accountIdentifier" + }, + { + "column": "LocalAccount_EducationOrganizationId", + "identity_json_path": "$.localAccountReference.educationOrganizationId" + }, + { + "column": "LocalAccount_FiscalYear", + "identity_json_path": "$.localAccountReference.fiscalYear" + } ] }, { @@ -32953,6 +33922,31 @@ "LocalAccount_EducationOrganizationId", "LocalAccount_FiscalYear", "Staff_StaffUniqueId" + ], + "resource_key_id": 171, + "project_name": "Ed-Fi", + "resource_name": "LocalPayroll", + "identity_elements": [ + { + "column": "AsOfDate", + "identity_json_path": "$.asOfDate" + }, + { + "column": "LocalAccount_AccountIdentifier", + "identity_json_path": "$.localAccountReference.accountIdentifier" + }, + { + "column": "LocalAccount_EducationOrganizationId", + "identity_json_path": "$.localAccountReference.educationOrganizationId" + }, + { + "column": "LocalAccount_FiscalYear", + "identity_json_path": "$.localAccountReference.fiscalYear" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -32986,6 +33980,19 @@ "identity_projection_columns": [ "ClassroomIdentificationCode", "School_SchoolId" + ], + "resource_key_id": 173, + "project_name": "Ed-Fi", + "resource_name": "Location", + "identity_elements": [ + { + "column": "ClassroomIdentificationCode", + "identity_json_path": "$.classroomIdentificationCode" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + } ] }, { @@ -33016,6 +34023,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 184, + "project_name": "Ed-Fi", + "resource_name": "ObjectDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -33056,9 +34076,26 @@ "DocumentId" ], "identity_projection_columns": [ - "Assessment_AssessmentIdentifier", - "Assessment_Namespace", + "AssessmentIdentifier_Unified", + "Namespace_Unified", "IdentificationCode" + ], + "resource_key_id": 185, + "project_name": "Ed-Fi", + "resource_name": "ObjectiveAssessment", + "identity_elements": [ + { + "column": "Assessment_AssessmentIdentifier", + "identity_json_path": "$.assessmentReference.assessmentIdentifier" + }, + { + "column": "Assessment_Namespace", + "identity_json_path": "$.assessmentReference.namespace" + }, + { + "column": "IdentificationCode", + "identity_json_path": "$.identificationCode" + } ] }, { @@ -33072,8 +34109,8 @@ "DocumentId" ], "identity_projection_columns": [ - "Assessment_AssessmentIdentifier", - "Assessment_Namespace", + "AssessmentIdentifier_Unified", + "Namespace_Unified", "IdentificationCode" ] }, @@ -33138,6 +34175,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "RequisitionNumber" + ], + "resource_key_id": 186, + "project_name": "Ed-Fi", + "resource_name": "OpenStaffPosition", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "RequisitionNumber", + "identity_json_path": "$.requisitionNumber" + } ] }, { @@ -33192,6 +34242,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 188, + "project_name": "Ed-Fi", + "resource_name": "OperationalUnitDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -33237,7 +34300,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "OrganizationDepartmentId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:OrganizationDepartment" }, { "name": "TR_OrganizationDepartment_ReferentialIdentity", @@ -33251,7 +34321,27 @@ ], "identity_projection_columns": [ "OrganizationDepartmentId" - ] + ], + "resource_key_id": 189, + "project_name": "Ed-Fi", + "resource_name": "OrganizationDepartment", + "identity_elements": [ + { + "column": "OrganizationDepartmentId", + "identity_json_path": "$.organizationDepartmentId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "OrganizationDepartmentId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_OrganizationDepartment_Stamp", @@ -33376,6 +34466,19 @@ "identity_projection_columns": [ "PersonId", "SourceSystemDescriptor_DescriptorId" + ], + "resource_key_id": 195, + "project_name": "Ed-Fi", + "resource_name": "Person", + "identity_elements": [ + { + "column": "PersonId", + "identity_json_path": "$.personId" + }, + { + "column": "SourceSystemDescriptor_DescriptorId", + "identity_json_path": "$.sourceSystemDescriptor" + } ] }, { @@ -33407,6 +34510,23 @@ "EventDate", "PostSecondaryEventCategoryDescriptor_DescriptorId", "Student_StudentUniqueId" + ], + "resource_key_id": 199, + "project_name": "Ed-Fi", + "resource_name": "PostSecondaryEvent", + "identity_elements": [ + { + "column": "EventDate", + "identity_json_path": "$.eventDate" + }, + { + "column": "PostSecondaryEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.postSecondaryEventCategoryDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -33441,7 +34561,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "PostSecondaryInstitutionId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:PostSecondaryInstitution" }, { "name": "TR_PostSecondaryInstitution_ReferentialIdentity", @@ -33455,7 +34582,27 @@ ], "identity_projection_columns": [ "PostSecondaryInstitutionId" - ] + ], + "resource_key_id": 201, + "project_name": "Ed-Fi", + "resource_name": "PostSecondaryInstitution", + "identity_elements": [ + { + "column": "PostSecondaryInstitutionId", + "identity_json_path": "$.postSecondaryInstitutionId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "PostSecondaryInstitutionId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_PostSecondaryInstitution_Stamp", @@ -33593,6 +34740,23 @@ "EducationOrganization_EducationOrganizationId", "ProgramName", "ProgramTypeDescriptor_DescriptorId" + ], + "resource_key_id": 208, + "project_name": "Ed-Fi", + "resource_name": "Program", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramName", + "identity_json_path": "$.programName" + }, + { + "column": "ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programTypeDescriptor" + } ] }, { @@ -33636,6 +34800,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 211, + "project_name": "Ed-Fi", + "resource_name": "ProgramDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -33682,6 +34859,35 @@ "ProgramProgram_EducationOrganizationId", "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId" + ], + "resource_key_id": 212, + "project_name": "Ed-Fi", + "resource_name": "ProgramEvaluation", + "identity_elements": [ + { + "column": "ProgramEvaluationPeriodDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationPeriodDescriptor" + }, + { + "column": "ProgramEvaluationTitle", + "identity_json_path": "$.programEvaluationTitle" + }, + { + "column": "ProgramEvaluationTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationTypeDescriptor" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + } ] }, { @@ -33715,12 +34921,45 @@ ], "identity_projection_columns": [ "ProgramEvaluationElementTitle", - "ProgramEvaluation_ProgramEducationOrganizationId", - "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", - "ProgramEvaluation_ProgramEvaluationTitle", - "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", - "ProgramEvaluation_ProgramName", - "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId" + "ProgramEducationOrganizationId_Unified", + "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", + "ProgramEvaluationTitle_Unified", + "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "ProgramName_Unified", + "ProgramTypeDescriptor_Unified_DescriptorId" + ], + "resource_key_id": 213, + "project_name": "Ed-Fi", + "resource_name": "ProgramEvaluationElement", + "identity_elements": [ + { + "column": "ProgramEvaluationElementTitle", + "identity_json_path": "$.programEvaluationElementTitle" + }, + { + "column": "ProgramEvaluation_ProgramEducationOrganizationId", + "identity_json_path": "$.programEvaluationReference.programEducationOrganizationId" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", + "identity_json_path": "$.programEvaluationReference.programEvaluationPeriodDescriptor" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationTitle", + "identity_json_path": "$.programEvaluationReference.programEvaluationTitle" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationReference.programEvaluationTypeDescriptor" + }, + { + "column": "ProgramEvaluation_ProgramName", + "identity_json_path": "$.programEvaluationReference.programName" + }, + { + "column": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationReference.programTypeDescriptor" + } ] }, { @@ -33735,12 +34974,12 @@ ], "identity_projection_columns": [ "ProgramEvaluationElementTitle", - "ProgramEvaluation_ProgramEducationOrganizationId", - "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", - "ProgramEvaluation_ProgramEvaluationTitle", - "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", - "ProgramEvaluation_ProgramName", - "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId" + "ProgramEducationOrganizationId_Unified", + "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", + "ProgramEvaluationTitle_Unified", + "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "ProgramName_Unified", + "ProgramTypeDescriptor_Unified_DescriptorId" ] }, { @@ -33785,6 +35024,39 @@ "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "ProgramEvaluation_ProgramName", "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId" + ], + "resource_key_id": 214, + "project_name": "Ed-Fi", + "resource_name": "ProgramEvaluationObjective", + "identity_elements": [ + { + "column": "ProgramEvaluationObjectiveTitle", + "identity_json_path": "$.programEvaluationObjectiveTitle" + }, + { + "column": "ProgramEvaluation_ProgramEducationOrganizationId", + "identity_json_path": "$.programEvaluationReference.programEducationOrganizationId" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", + "identity_json_path": "$.programEvaluationReference.programEvaluationPeriodDescriptor" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationTitle", + "identity_json_path": "$.programEvaluationReference.programEvaluationTitle" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationReference.programEvaluationTypeDescriptor" + }, + { + "column": "ProgramEvaluation_ProgramName", + "identity_json_path": "$.programEvaluationReference.programName" + }, + { + "column": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationReference.programTypeDescriptor" + } ] }, { @@ -33856,10 +35128,23 @@ "identity_projection_columns": [ "Code", "FiscalYear" - ] - }, - { - "name": "TR_ProjectDimension_Stamp", + ], + "resource_key_id": 221, + "project_name": "Ed-Fi", + "resource_name": "ProjectDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } + ] + }, + { + "name": "TR_ProjectDimension_Stamp", "table": { "schema": "edfi", "name": "ProjectDimension" @@ -33902,6 +35187,35 @@ "GradingPeriodGradingPeriod_SchoolId", "GradingPeriodGradingPeriod_SchoolYear", "Student_StudentUniqueId" + ], + "resource_key_id": 234, + "project_name": "Ed-Fi", + "resource_name": "ReportCard", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "identity_json_path": "$.gradingPeriodReference.gradingPeriodDescriptor" + }, + { + "column": "GradingPeriodGradingPeriod_GradingPeriodName", + "identity_json_path": "$.gradingPeriodReference.gradingPeriodName" + }, + { + "column": "GradingPeriodGradingPeriod_SchoolId", + "identity_json_path": "$.gradingPeriodReference.schoolId" + }, + { + "column": "GradingPeriodGradingPeriod_SchoolYear", + "identity_json_path": "$.gradingPeriodReference.schoolYear" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -33971,8 +35285,25 @@ ], "identity_projection_columns": [ "RestraintEventIdentifier", - "School_SchoolId", + "SchoolId_Unified", "Student_StudentUniqueId" + ], + "resource_key_id": 240, + "project_name": "Ed-Fi", + "resource_name": "RestraintEvent", + "identity_elements": [ + { + "column": "RestraintEventIdentifier", + "identity_json_path": "$.restraintEventIdentifier" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -33987,7 +35318,7 @@ ], "identity_projection_columns": [ "RestraintEventIdentifier", - "School_SchoolId", + "SchoolId_Unified", "Student_StudentUniqueId" ] }, @@ -34031,7 +35362,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "SchoolId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:School" }, { "name": "TR_School_ReferentialIdentity", @@ -34045,7 +35383,27 @@ ], "identity_projection_columns": [ "SchoolId" - ] + ], + "resource_key_id": 244, + "project_name": "Ed-Fi", + "resource_name": "School", + "identity_elements": [ + { + "column": "SchoolId", + "identity_json_path": "$.schoolId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "SchoolId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } }, { "name": "TR_School_Stamp", @@ -34193,6 +35551,15 @@ ], "identity_projection_columns": [ "SchoolYear" + ], + "resource_key_id": 250, + "project_name": "Ed-Fi", + "resource_name": "SchoolYearType", + "identity_elements": [ + { + "column": "SchoolYear", + "identity_json_path": "$.schoolYear" + } ] }, { @@ -34226,6 +35593,35 @@ "CourseOffering_SchoolYear", "CourseOffering_SessionName", "SectionIdentifier" + ], + "resource_key_id": 251, + "project_name": "Ed-Fi", + "resource_name": "Section", + "identity_elements": [ + { + "column": "CourseOffering_LocalCourseCode", + "identity_json_path": "$.courseOfferingReference.localCourseCode" + }, + { + "column": "CourseOffering_SchoolReferenceSchoolId", + "identity_json_path": "$.courseOfferingReference.schoolId" + }, + { + "column": "CourseOffering_SessionReferenceSchoolId", + "identity_json_path": "$.courseOfferingReference.schoolId" + }, + { + "column": "CourseOffering_SchoolYear", + "identity_json_path": "$.courseOfferingReference.schoolYear" + }, + { + "column": "CourseOffering_SessionName", + "identity_json_path": "$.courseOfferingReference.sessionName" + }, + { + "column": "SectionIdentifier", + "identity_json_path": "$.sectionIdentifier" + } ] }, { @@ -34260,13 +35656,52 @@ "identity_projection_columns": [ "CalendarDate_CalendarCode", "CalendarDate_Date", - "CalendarDate_SchoolId", - "CalendarDate_SchoolYear", + "SchoolId_Unified", + "SchoolYear_Unified", "Section_LocalCourseCode", - "Section_SchoolId", - "Section_SchoolYear", "Section_SectionIdentifier", "Section_SessionName" + ], + "resource_key_id": 253, + "project_name": "Ed-Fi", + "resource_name": "SectionAttendanceTakenEvent", + "identity_elements": [ + { + "column": "CalendarDate_CalendarCode", + "identity_json_path": "$.calendarDateReference.calendarCode" + }, + { + "column": "CalendarDate_Date", + "identity_json_path": "$.calendarDateReference.date" + }, + { + "column": "CalendarDate_SchoolId", + "identity_json_path": "$.calendarDateReference.schoolId" + }, + { + "column": "CalendarDate_SchoolYear", + "identity_json_path": "$.calendarDateReference.schoolYear" + }, + { + "column": "Section_LocalCourseCode", + "identity_json_path": "$.sectionReference.localCourseCode" + }, + { + "column": "Section_SchoolId", + "identity_json_path": "$.sectionReference.schoolId" + }, + { + "column": "Section_SchoolYear", + "identity_json_path": "$.sectionReference.schoolYear" + }, + { + "column": "Section_SectionIdentifier", + "identity_json_path": "$.sectionReference.sectionIdentifier" + }, + { + "column": "Section_SessionName", + "identity_json_path": "$.sectionReference.sessionName" + } ] }, { @@ -34282,11 +35717,9 @@ "identity_projection_columns": [ "CalendarDate_CalendarCode", "CalendarDate_Date", - "CalendarDate_SchoolId", - "CalendarDate_SchoolYear", + "SchoolId_Unified", + "SchoolYear_Unified", "Section_LocalCourseCode", - "Section_SchoolId", - "Section_SchoolYear", "Section_SectionIdentifier", "Section_SessionName" ] @@ -34365,6 +35798,23 @@ "School_SchoolId", "SchoolYear_SchoolYear", "SessionName" + ], + "resource_key_id": 259, + "project_name": "Ed-Fi", + "resource_name": "Session", + "identity_elements": [ + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "SchoolYear_SchoolYear", + "identity_json_path": "$.schoolYearTypeReference.schoolYear" + }, + { + "column": "SessionName", + "identity_json_path": "$.sessionName" + } ] }, { @@ -34420,6 +35870,19 @@ "identity_projection_columns": [ "Code", "FiscalYear" + ], + "resource_key_id": 261, + "project_name": "Ed-Fi", + "resource_name": "SourceDimension", + "identity_elements": [ + { + "column": "Code", + "identity_json_path": "$.code" + }, + { + "column": "FiscalYear", + "identity_json_path": "$.fiscalYear" + } ] }, { @@ -34461,6 +35924,15 @@ ], "identity_projection_columns": [ "StaffUniqueId" + ], + "resource_key_id": 266, + "project_name": "Ed-Fi", + "resource_name": "Staff", + "identity_elements": [ + { + "column": "StaffUniqueId", + "identity_json_path": "$.staffUniqueId" + } ] }, { @@ -34491,6 +35963,23 @@ "AbsenceEventCategoryDescriptor_DescriptorId", "EventDate", "Staff_StaffUniqueId" + ], + "resource_key_id": 267, + "project_name": "Ed-Fi", + "resource_name": "StaffAbsenceEvent", + "identity_elements": [ + { + "column": "AbsenceEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.absenceEventCategoryDescriptor" + }, + { + "column": "EventDate", + "identity_json_path": "$.eventDate" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34560,6 +36049,27 @@ "Cohort_CohortIdentifier", "Cohort_EducationOrganizationId", "Staff_StaffUniqueId" + ], + "resource_key_id": 269, + "project_name": "Ed-Fi", + "resource_name": "StaffCohortAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "Cohort_CohortIdentifier", + "identity_json_path": "$.cohortReference.cohortIdentifier" + }, + { + "column": "Cohort_EducationOrganizationId", + "identity_json_path": "$.cohortReference.educationOrganizationId" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34605,6 +36115,23 @@ "DisciplineIncident_IncidentIdentifier", "DisciplineIncident_SchoolId", "Staff_StaffUniqueId" + ], + "resource_key_id": 270, + "project_name": "Ed-Fi", + "resource_name": "StaffDisciplineIncidentAssociation", + "identity_elements": [ + { + "column": "DisciplineIncident_IncidentIdentifier", + "identity_json_path": "$.disciplineIncidentReference.incidentIdentifier" + }, + { + "column": "DisciplineIncident_SchoolId", + "identity_json_path": "$.disciplineIncidentReference.schoolId" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34649,7 +36176,28 @@ "BeginDate", "EducationOrganization_EducationOrganizationId", "StaffClassificationDescriptor_DescriptorId", - "Staff_StaffUniqueId" + "StaffUniqueId_Unified" + ], + "resource_key_id": 271, + "project_name": "Ed-Fi", + "resource_name": "StaffEducationOrganizationAssignmentAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "StaffClassificationDescriptor_DescriptorId", + "identity_json_path": "$.staffClassificationDescriptor" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34666,7 +36214,7 @@ "BeginDate", "EducationOrganization_EducationOrganizationId", "StaffClassificationDescriptor_DescriptorId", - "Staff_StaffUniqueId" + "StaffUniqueId_Unified" ] }, { @@ -34683,6 +36231,23 @@ "ContactTitle", "EducationOrganization_EducationOrganizationId", "Staff_StaffUniqueId" + ], + "resource_key_id": 272, + "project_name": "Ed-Fi", + "resource_name": "StaffEducationOrganizationContactAssociation", + "identity_elements": [ + { + "column": "ContactTitle", + "identity_json_path": "$.contactTitle" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34740,6 +36305,27 @@ "EmploymentStatusDescriptor_DescriptorId", "HireDate", "Staff_StaffUniqueId" + ], + "resource_key_id": 273, + "project_name": "Ed-Fi", + "resource_name": "StaffEducationOrganizationEmploymentAssociation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "EmploymentStatusDescriptor_DescriptorId", + "identity_json_path": "$.employmentStatusDescriptor" + }, + { + "column": "HireDate", + "identity_json_path": "$.hireDate" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34845,6 +36431,23 @@ "BeginDate", "StaffLeaveEventCategoryDescriptor_DescriptorId", "Staff_StaffUniqueId" + ], + "resource_key_id": 275, + "project_name": "Ed-Fi", + "resource_name": "StaffLeave", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "StaffLeaveEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.staffLeaveEventCategoryDescriptor" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34903,6 +36506,31 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Staff_StaffUniqueId" + ], + "resource_key_id": 277, + "project_name": "Ed-Fi", + "resource_name": "StaffProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34959,8 +36587,25 @@ ], "identity_projection_columns": [ "ProgramAssignmentDescriptor_DescriptorId", - "School_SchoolId", + "SchoolId_Unified", "Staff_StaffUniqueId" + ], + "resource_key_id": 278, + "project_name": "Ed-Fi", + "resource_name": "StaffSchoolAssociation", + "identity_elements": [ + { + "column": "ProgramAssignmentDescriptor_DescriptorId", + "identity_json_path": "$.programAssignmentDescriptor" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -34975,7 +36620,7 @@ ], "identity_projection_columns": [ "ProgramAssignmentDescriptor_DescriptorId", - "School_SchoolId", + "SchoolId_Unified", "Staff_StaffUniqueId" ] }, @@ -35021,6 +36666,39 @@ "Section_SectionIdentifier", "Section_SessionName", "Staff_StaffUniqueId" + ], + "resource_key_id": 279, + "project_name": "Ed-Fi", + "resource_name": "StaffSectionAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "Section_LocalCourseCode", + "identity_json_path": "$.sectionReference.localCourseCode" + }, + { + "column": "Section_SchoolId", + "identity_json_path": "$.sectionReference.schoolId" + }, + { + "column": "Section_SchoolYear", + "identity_json_path": "$.sectionReference.schoolYear" + }, + { + "column": "Section_SectionIdentifier", + "identity_json_path": "$.sectionReference.sectionIdentifier" + }, + { + "column": "Section_SessionName", + "identity_json_path": "$.sectionReference.sessionName" + }, + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + } ] }, { @@ -35095,7 +36773,14 @@ "target_table": { "schema": "edfi", "name": "EducationOrganizationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "StateEducationAgencyId", + "target_column": "EducationOrganizationId" + } + ], + "discriminator_value": "Ed-Fi:StateEducationAgency" }, { "name": "TR_StateEducationAgency_ReferentialIdentity", @@ -35109,15 +36794,35 @@ ], "identity_projection_columns": [ "StateEducationAgencyId" - ] - }, - { - "name": "TR_StateEducationAgency_Stamp", - "table": { - "schema": "edfi", - "name": "StateEducationAgency" - }, - "kind": "DocumentStamping", + ], + "resource_key_id": 281, + "project_name": "Ed-Fi", + "resource_name": "StateEducationAgency", + "identity_elements": [ + { + "column": "StateEducationAgencyId", + "identity_json_path": "$.stateEducationAgencyId" + } + ], + "superclass_alias": { + "resource_key_id": 95, + "project_name": "Ed-Fi", + "resource_name": "EducationOrganization", + "identity_elements": [ + { + "column": "StateEducationAgencyId", + "identity_json_path": "$.educationOrganizationId" + } + ] + } + }, + { + "name": "TR_StateEducationAgency_Stamp", + "table": { + "schema": "edfi", + "name": "StateEducationAgency" + }, + "kind": "DocumentStamping", "key_columns": [ "DocumentId" ], @@ -35257,6 +36962,15 @@ ], "identity_projection_columns": [ "StudentUniqueId" + ], + "resource_key_id": 282, + "project_name": "Ed-Fi", + "resource_name": "Student", + "identity_elements": [ + { + "column": "StudentUniqueId", + "identity_json_path": "$.studentUniqueId" + } ] }, { @@ -35288,6 +37002,27 @@ "SchoolYear_SchoolYear", "Student_StudentUniqueId", "TermDescriptor_DescriptorId" + ], + "resource_key_id": 283, + "project_name": "Ed-Fi", + "resource_name": "StudentAcademicRecord", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "SchoolYear_SchoolYear", + "identity_json_path": "$.schoolYearTypeReference.schoolYear" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + }, + { + "column": "TermDescriptor_DescriptorId", + "identity_json_path": "$.termDescriptor" + } ] }, { @@ -35382,6 +37117,27 @@ "Assessment_Namespace", "StudentAssessmentIdentifier", "Student_StudentUniqueId" + ], + "resource_key_id": 284, + "project_name": "Ed-Fi", + "resource_name": "StudentAssessment", + "identity_elements": [ + { + "column": "Assessment_AssessmentIdentifier", + "identity_json_path": "$.assessmentReference.assessmentIdentifier" + }, + { + "column": "Assessment_Namespace", + "identity_json_path": "$.assessmentReference.namespace" + }, + { + "column": "StudentAssessmentIdentifier", + "identity_json_path": "$.studentAssessmentIdentifier" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -35430,6 +37186,35 @@ "StudentAssessment_Namespace", "StudentAssessment_StudentAssessmentIdentifier", "StudentAssessment_StudentUniqueId" + ], + "resource_key_id": 285, + "project_name": "Ed-Fi", + "resource_name": "StudentAssessmentEducationOrganizationAssociation", + "identity_elements": [ + { + "column": "EducationOrganizationAssociationTypeDescriptor_DescriptorId", + "identity_json_path": "$.educationOrganizationAssociationTypeDescriptor" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "StudentAssessment_AssessmentIdentifier", + "identity_json_path": "$.studentAssessmentReference.assessmentIdentifier" + }, + { + "column": "StudentAssessment_Namespace", + "identity_json_path": "$.studentAssessmentReference.namespace" + }, + { + "column": "StudentAssessment_StudentAssessmentIdentifier", + "identity_json_path": "$.studentAssessmentReference.studentAssessmentIdentifier" + }, + { + "column": "StudentAssessment_StudentUniqueId", + "identity_json_path": "$.studentAssessmentReference.studentUniqueId" + } ] }, { @@ -35491,7 +37276,36 @@ "AssessmentAdministration_AssigningEducationOrganizationId", "AssessmentAdministration_Namespace", "StudentEducationOrganizationAssociation_EducationOrganizationId", - "StudentEducationOrganizationAssociation_StudentUniqueId" + "StudentUniqueId_Unified" + ], + "resource_key_id": 286, + "project_name": "Ed-Fi", + "resource_name": "StudentAssessmentRegistration", + "identity_elements": [ + { + "column": "AssessmentAdministration_AdministrationIdentifier", + "identity_json_path": "$.assessmentAdministrationReference.administrationIdentifier" + }, + { + "column": "AssessmentAdministration_AssessmentIdentifier", + "identity_json_path": "$.assessmentAdministrationReference.assessmentIdentifier" + }, + { + "column": "AssessmentAdministration_AssigningEducationOrganizationId", + "identity_json_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId" + }, + { + "column": "AssessmentAdministration_Namespace", + "identity_json_path": "$.assessmentAdministrationReference.namespace" + }, + { + "column": "StudentEducationOrganizationAssociation_EducationOrganizationId", + "identity_json_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId" + }, + { + "column": "StudentEducationOrganizationAssociation_StudentUniqueId", + "identity_json_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId" + } ] }, { @@ -35510,7 +37324,7 @@ "AssessmentAdministration_AssigningEducationOrganizationId", "AssessmentAdministration_Namespace", "StudentEducationOrganizationAssociation_EducationOrganizationId", - "StudentEducationOrganizationAssociation_StudentUniqueId" + "StudentUniqueId_Unified" ] }, { @@ -35549,14 +37363,53 @@ ], "identity_projection_columns": [ "AssessmentBatteryPart_AssessmentBatteryPartName", - "AssessmentBatteryPart_AssessmentIdentifier", - "AssessmentBatteryPart_Namespace", + "AssessmentIdentifier_Unified", + "Namespace_Unified", "StudentAssessmentRegistration_AdministrationIdentifier", - "StudentAssessmentRegistration_AssessmentIdentifier", "StudentAssessmentRegistration_AssigningEducationOrganizationId", "StudentAssessmentRegistration_EducationOrganizationId", - "StudentAssessmentRegistration_Namespace", "StudentAssessmentRegistration_StudentUniqueId" + ], + "resource_key_id": 287, + "project_name": "Ed-Fi", + "resource_name": "StudentAssessmentRegistrationBatteryPartAssociation", + "identity_elements": [ + { + "column": "AssessmentBatteryPart_AssessmentBatteryPartName", + "identity_json_path": "$.assessmentBatteryPartReference.assessmentBatteryPartName" + }, + { + "column": "AssessmentBatteryPart_AssessmentIdentifier", + "identity_json_path": "$.assessmentBatteryPartReference.assessmentIdentifier" + }, + { + "column": "AssessmentBatteryPart_Namespace", + "identity_json_path": "$.assessmentBatteryPartReference.namespace" + }, + { + "column": "StudentAssessmentRegistration_AdministrationIdentifier", + "identity_json_path": "$.studentAssessmentRegistrationReference.administrationIdentifier" + }, + { + "column": "StudentAssessmentRegistration_AssessmentIdentifier", + "identity_json_path": "$.studentAssessmentRegistrationReference.assessmentIdentifier" + }, + { + "column": "StudentAssessmentRegistration_AssigningEducationOrganizationId", + "identity_json_path": "$.studentAssessmentRegistrationReference.assigningEducationOrganizationId" + }, + { + "column": "StudentAssessmentRegistration_EducationOrganizationId", + "identity_json_path": "$.studentAssessmentRegistrationReference.educationOrganizationId" + }, + { + "column": "StudentAssessmentRegistration_Namespace", + "identity_json_path": "$.studentAssessmentRegistrationReference.namespace" + }, + { + "column": "StudentAssessmentRegistration_StudentUniqueId", + "identity_json_path": "$.studentAssessmentRegistrationReference.studentUniqueId" + } ] }, { @@ -35571,13 +37424,11 @@ ], "identity_projection_columns": [ "AssessmentBatteryPart_AssessmentBatteryPartName", - "AssessmentBatteryPart_AssessmentIdentifier", - "AssessmentBatteryPart_Namespace", + "AssessmentIdentifier_Unified", + "Namespace_Unified", "StudentAssessmentRegistration_AdministrationIdentifier", - "StudentAssessmentRegistration_AssessmentIdentifier", "StudentAssessmentRegistration_AssigningEducationOrganizationId", "StudentAssessmentRegistration_EducationOrganizationId", - "StudentAssessmentRegistration_Namespace", "StudentAssessmentRegistration_StudentUniqueId" ] }, @@ -35662,7 +37513,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentCTEProgramAssociation" }, { "name": "TR_StudentCTEProgramAssociation_ReferentialIdentity", @@ -35681,7 +37559,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 288, + "project_name": "Ed-Fi", + "resource_name": "StudentCTEProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentCTEProgramAssociation_Stamp", @@ -35741,6 +37679,27 @@ "Cohort_CohortIdentifier", "Cohort_EducationOrganizationId", "Student_StudentUniqueId" + ], + "resource_key_id": 290, + "project_name": "Ed-Fi", + "resource_name": "StudentCohortAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "Cohort_CohortIdentifier", + "identity_json_path": "$.cohortReference.cohortIdentifier" + }, + { + "column": "Cohort_EducationOrganizationId", + "identity_json_path": "$.cohortReference.educationOrganizationId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -35791,6 +37750,43 @@ "ObjectiveCompetencyObjective_Objective", "ObjectiveCompetencyObjective_ObjectiveGradeLevelDesc_5b5c253e2e", "Student_StudentUniqueId" + ], + "resource_key_id": 291, + "project_name": "Ed-Fi", + "resource_name": "StudentCompetencyObjective", + "identity_elements": [ + { + "column": "GradingPeriodGradingPeriod_GradingPeriodDescriptor_DescriptorId", + "identity_json_path": "$.gradingPeriodReference.gradingPeriodDescriptor" + }, + { + "column": "GradingPeriodGradingPeriod_GradingPeriodName", + "identity_json_path": "$.gradingPeriodReference.gradingPeriodName" + }, + { + "column": "GradingPeriodGradingPeriod_SchoolId", + "identity_json_path": "$.gradingPeriodReference.schoolId" + }, + { + "column": "GradingPeriodGradingPeriod_SchoolYear", + "identity_json_path": "$.gradingPeriodReference.schoolYear" + }, + { + "column": "ObjectiveCompetencyObjective_EducationOrganizationId", + "identity_json_path": "$.objectiveCompetencyObjectiveReference.educationOrganizationId" + }, + { + "column": "ObjectiveCompetencyObjective_Objective", + "identity_json_path": "$.objectiveCompetencyObjectiveReference.objective" + }, + { + "column": "ObjectiveCompetencyObjective_ObjectiveGradeLevelDesc_5b5c253e2e", + "identity_json_path": "$.objectiveCompetencyObjectiveReference.objectiveGradeLevelDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -35851,6 +37847,19 @@ "identity_projection_columns": [ "Contact_ContactUniqueId", "Student_StudentUniqueId" + ], + "resource_key_id": 292, + "project_name": "Ed-Fi", + "resource_name": "StudentContactAssociation", + "identity_elements": [ + { + "column": "Contact_ContactUniqueId", + "identity_json_path": "$.contactReference.contactUniqueId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -35883,6 +37892,27 @@ "DisciplineIncident_IncidentIdentifier", "DisciplineIncident_SchoolId", "Student_StudentUniqueId" + ], + "resource_key_id": 293, + "project_name": "Ed-Fi", + "resource_name": "StudentDisciplineIncidentBehaviorAssociation", + "identity_elements": [ + { + "column": "BehaviorDescriptor_DescriptorId", + "identity_json_path": "$.behaviorDescriptor" + }, + { + "column": "DisciplineIncident_IncidentIdentifier", + "identity_json_path": "$.disciplineIncidentReference.incidentIdentifier" + }, + { + "column": "DisciplineIncident_SchoolId", + "identity_json_path": "$.disciplineIncidentReference.schoolId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -35940,6 +37970,23 @@ "DisciplineIncident_IncidentIdentifier", "DisciplineIncident_SchoolId", "Student_StudentUniqueId" + ], + "resource_key_id": 294, + "project_name": "Ed-Fi", + "resource_name": "StudentDisciplineIncidentNonOffenderAssociation", + "identity_elements": [ + { + "column": "DisciplineIncident_IncidentIdentifier", + "identity_json_path": "$.disciplineIncidentReference.incidentIdentifier" + }, + { + "column": "DisciplineIncident_SchoolId", + "identity_json_path": "$.disciplineIncidentReference.schoolId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -35983,6 +38030,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "Student_StudentUniqueId" + ], + "resource_key_id": 295, + "project_name": "Ed-Fi", + "resource_name": "StudentEducationOrganizationAssessmentAccommodation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36025,6 +38085,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "Student_StudentUniqueId" + ], + "resource_key_id": 296, + "project_name": "Ed-Fi", + "resource_name": "StudentEducationOrganizationAssociation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36285,6 +38358,27 @@ "EducationOrganization_EducationOrganizationId", "ResponsibilityDescriptor_DescriptorId", "Student_StudentUniqueId" + ], + "resource_key_id": 297, + "project_name": "Ed-Fi", + "resource_name": "StudentEducationOrganizationResponsibilityAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ResponsibilityDescriptor_DescriptorId", + "identity_json_path": "$.responsibilityDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36318,6 +38412,23 @@ "GradebookEntry_GradebookEntryIdentifier", "GradebookEntry_Namespace", "Student_StudentUniqueId" + ], + "resource_key_id": 298, + "project_name": "Ed-Fi", + "resource_name": "StudentGradebookEntry", + "identity_elements": [ + { + "column": "GradebookEntry_GradebookEntryIdentifier", + "identity_json_path": "$.gradebookEntryReference.gradebookEntryIdentifier" + }, + { + "column": "GradebookEntry_Namespace", + "identity_json_path": "$.gradebookEntryReference.namespace" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36349,6 +38460,19 @@ "identity_projection_columns": [ "EducationOrganization_EducationOrganizationId", "Student_StudentUniqueId" + ], + "resource_key_id": 299, + "project_name": "Ed-Fi", + "resource_name": "StudentHealth", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36435,12 +38559,39 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } - }, - { - "name": "TR_StudentHomelessProgramAssociation_ReferentialIdentity", - "table": { - "schema": "edfi", + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentHomelessProgramAssociation" + }, + { + "name": "TR_StudentHomelessProgramAssociation_ReferentialIdentity", + "table": { + "schema": "edfi", "name": "StudentHomelessProgramAssociation" }, "kind": "ReferentialIdentityMaintenance", @@ -36454,7 +38605,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 300, + "project_name": "Ed-Fi", + "resource_name": "StudentHomelessProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentHomelessProgramAssociation_Stamp", @@ -36525,6 +38736,23 @@ "Intervention_EducationOrganizationId", "Intervention_InterventionIdentificationCode", "Student_StudentUniqueId" + ], + "resource_key_id": 302, + "project_name": "Ed-Fi", + "resource_name": "StudentInterventionAssociation", + "identity_elements": [ + { + "column": "Intervention_EducationOrganizationId", + "identity_json_path": "$.interventionReference.educationOrganizationId" + }, + { + "column": "Intervention_InterventionIdentificationCode", + "identity_json_path": "$.interventionReference.interventionIdentificationCode" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36571,6 +38799,31 @@ "Intervention_EducationOrganizationId", "Intervention_InterventionIdentificationCode", "Student_StudentUniqueId" + ], + "resource_key_id": 303, + "project_name": "Ed-Fi", + "resource_name": "StudentInterventionAttendanceEvent", + "identity_elements": [ + { + "column": "AttendanceEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.attendanceEventCategoryDescriptor" + }, + { + "column": "EventDate", + "identity_json_path": "$.eventDate" + }, + { + "column": "Intervention_EducationOrganizationId", + "identity_json_path": "$.interventionReference.educationOrganizationId" + }, + { + "column": "Intervention_InterventionIdentificationCode", + "identity_json_path": "$.interventionReference.interventionIdentificationCode" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -36612,7 +38865,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentLanguageInstructionProgramAssociation" }, { "name": "TR_StudentLanguageInstructionProgramAssociation_Refe_8658d721a3", @@ -36631,7 +38911,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 304, + "project_name": "Ed-Fi", + "resource_name": "StudentLanguageInstructionProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentLanguageInstructionProgramAssociation_Stamp", @@ -36709,7 +39049,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentMigrantEducationProgramAssociation" }, { "name": "TR_StudentMigrantEducationProgramAssociation_Referen_654de036cb", @@ -36728,7 +39095,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 305, + "project_name": "Ed-Fi", + "resource_name": "StudentMigrantEducationProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentMigrantEducationProgramAssociation_Stamp", @@ -36794,7 +39221,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentNeglectedOrDelinquentProgramAssociation" }, { "name": "TR_StudentNeglectedOrDelinquentProgramAssociation_Re_699dcdd09c", @@ -36813,7 +39267,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 306, + "project_name": "Ed-Fi", + "resource_name": "StudentNeglectedOrDelinquentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentNeglectedOrDelinquentProgramAssociation_Stamp", @@ -36903,7 +39417,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentProgramAssociation" }, { "name": "TR_StudentProgramAssociation_ReferentialIdentity", @@ -36922,7 +39463,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 307, + "project_name": "Ed-Fi", + "resource_name": "StudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentProgramAssociation_Stamp", @@ -36985,6 +39586,39 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" + ], + "resource_key_id": 308, + "project_name": "Ed-Fi", + "resource_name": "StudentProgramAttendanceEvent", + "identity_elements": [ + { + "column": "AttendanceEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.attendanceEventCategoryDescriptor" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "EventDate", + "identity_json_path": "$.eventDate" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37026,6 +39660,43 @@ "ProgramEvaluation_ProgramName", "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" + ], + "resource_key_id": 309, + "project_name": "Ed-Fi", + "resource_name": "StudentProgramEvaluation", + "identity_elements": [ + { + "column": "EvaluationDate", + "identity_json_path": "$.evaluationDate" + }, + { + "column": "ProgramEvaluation_ProgramEducationOrganizationId", + "identity_json_path": "$.programEvaluationReference.programEducationOrganizationId" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationPeriodDescriptor__bd73e5d64e", + "identity_json_path": "$.programEvaluationReference.programEvaluationPeriodDescriptor" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationTitle", + "identity_json_path": "$.programEvaluationReference.programEvaluationTitle" + }, + { + "column": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationReference.programEvaluationTypeDescriptor" + }, + { + "column": "ProgramEvaluation_ProgramName", + "identity_json_path": "$.programEvaluationReference.programName" + }, + { + "column": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programEvaluationReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37097,8 +39768,25 @@ ], "identity_projection_columns": [ "EntryDate", - "School_SchoolId", + "SchoolId_Unified", "Student_StudentUniqueId" + ], + "resource_key_id": 310, + "project_name": "Ed-Fi", + "resource_name": "StudentSchoolAssociation", + "identity_elements": [ + { + "column": "EntryDate", + "identity_json_path": "$.entryDate" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37113,7 +39801,7 @@ ], "identity_projection_columns": [ "EntryDate", - "School_SchoolId", + "SchoolId_Unified", "Student_StudentUniqueId" ] }, @@ -37154,11 +39842,43 @@ "identity_projection_columns": [ "AttendanceEventCategoryDescriptor_DescriptorId", "EventDate", - "School_SchoolId", - "Session_SchoolId", + "SchoolId_Unified", "Session_SchoolYear", "Session_SessionName", "Student_StudentUniqueId" + ], + "resource_key_id": 311, + "project_name": "Ed-Fi", + "resource_name": "StudentSchoolAttendanceEvent", + "identity_elements": [ + { + "column": "AttendanceEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.attendanceEventCategoryDescriptor" + }, + { + "column": "EventDate", + "identity_json_path": "$.eventDate" + }, + { + "column": "School_SchoolId", + "identity_json_path": "$.schoolReference.schoolId" + }, + { + "column": "Session_SchoolId", + "identity_json_path": "$.sessionReference.schoolId" + }, + { + "column": "Session_SchoolYear", + "identity_json_path": "$.sessionReference.schoolYear" + }, + { + "column": "Session_SessionName", + "identity_json_path": "$.sessionReference.sessionName" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37174,8 +39894,7 @@ "identity_projection_columns": [ "AttendanceEventCategoryDescriptor_DescriptorId", "EventDate", - "School_SchoolId", - "Session_SchoolId", + "SchoolId_Unified", "Session_SchoolYear", "Session_SessionName", "Student_StudentUniqueId" @@ -37202,7 +39921,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentSchoolFoodServiceProgramAssociation" }, { "name": "TR_StudentSchoolFoodServiceProgramAssociation_Refere_e2f2b09b1b", @@ -37221,7 +39967,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 312, + "project_name": "Ed-Fi", + "resource_name": "StudentSchoolFoodServiceProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentSchoolFoodServiceProgramAssociation_Stamp", @@ -37287,7 +40093,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentSection504ProgramAssociation" }, { "name": "TR_StudentSection504ProgramAssociation_ReferentialIdentity", @@ -37306,7 +40139,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 313, + "project_name": "Ed-Fi", + "resource_name": "StudentSection504ProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentSection504ProgramAssociation_Stamp", @@ -37357,6 +40250,39 @@ "Section_SectionIdentifier", "Section_SessionName", "Student_StudentUniqueId" + ], + "resource_key_id": 314, + "project_name": "Ed-Fi", + "resource_name": "StudentSectionAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "Section_LocalCourseCode", + "identity_json_path": "$.sectionReference.localCourseCode" + }, + { + "column": "Section_SchoolId", + "identity_json_path": "$.sectionReference.schoolId" + }, + { + "column": "Section_SchoolYear", + "identity_json_path": "$.sectionReference.schoolYear" + }, + { + "column": "Section_SectionIdentifier", + "identity_json_path": "$.sectionReference.sectionIdentifier" + }, + { + "column": "Section_SessionName", + "identity_json_path": "$.sectionReference.sessionName" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37410,6 +40336,43 @@ "Section_SectionIdentifier", "Section_SessionName", "Student_StudentUniqueId" + ], + "resource_key_id": 315, + "project_name": "Ed-Fi", + "resource_name": "StudentSectionAttendanceEvent", + "identity_elements": [ + { + "column": "AttendanceEventCategoryDescriptor_DescriptorId", + "identity_json_path": "$.attendanceEventCategoryDescriptor" + }, + { + "column": "EventDate", + "identity_json_path": "$.eventDate" + }, + { + "column": "Section_LocalCourseCode", + "identity_json_path": "$.sectionReference.localCourseCode" + }, + { + "column": "Section_SchoolId", + "identity_json_path": "$.sectionReference.schoolId" + }, + { + "column": "Section_SchoolYear", + "identity_json_path": "$.sectionReference.schoolYear" + }, + { + "column": "Section_SectionIdentifier", + "identity_json_path": "$.sectionReference.sectionIdentifier" + }, + { + "column": "Section_SessionName", + "identity_json_path": "$.sectionReference.sessionName" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37466,7 +40429,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentSpecialEducationProgramAssociation" }, { "name": "TR_StudentSpecialEducationProgramAssociation_Referen_e816d5e0e9", @@ -37485,7 +40475,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 316, + "project_name": "Ed-Fi", + "resource_name": "StudentSpecialEducationProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentSpecialEducationProgramAssociation_Stamp", @@ -37595,6 +40645,35 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" + ], + "resource_key_id": 317, + "project_name": "Ed-Fi", + "resource_name": "StudentSpecialEducationProgramEligibilityAssociation", + "identity_elements": [ + { + "column": "ConsentToEvaluationReceivedDate", + "identity_json_path": "$.consentToEvaluationReceivedDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -37637,7 +40716,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Ed-Fi:StudentTitleIPartAProgramAssociation" }, { "name": "TR_StudentTitleIPartAProgramAssociation_ReferentialIdentity", @@ -37656,7 +40762,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 318, + "project_name": "Ed-Fi", + "resource_name": "StudentTitleIPartAProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentTitleIPartAProgramAssociation_Stamp", @@ -37714,6 +40880,19 @@ "identity_projection_columns": [ "Student_StudentUniqueId", "TransportationEducationOrganization_EducationOrganizationId" + ], + "resource_key_id": 319, + "project_name": "Ed-Fi", + "resource_name": "StudentTransportation", + "identity_elements": [ + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + }, + { + "column": "TransportationEducationOrganization_EducationOrganizationId", + "identity_json_path": "$.transportationEducationOrganizationReference.educationOrganizationId" + } ] }, { @@ -37780,6 +40959,19 @@ "identity_projection_columns": [ "Namespace", "SurveyIdentifier" + ], + "resource_key_id": 322, + "project_name": "Ed-Fi", + "resource_name": "Survey", + "identity_elements": [ + { + "column": "Namespace", + "identity_json_path": "$.namespace" + }, + { + "column": "SurveyIdentifier", + "identity_json_path": "$.surveyIdentifier" + } ] }, { @@ -37812,6 +41004,27 @@ "Course_EducationOrganizationId", "Survey_Namespace", "Survey_SurveyIdentifier" + ], + "resource_key_id": 324, + "project_name": "Ed-Fi", + "resource_name": "SurveyCourseAssociation", + "identity_elements": [ + { + "column": "Course_CourseCode", + "identity_json_path": "$.courseReference.courseCode" + }, + { + "column": "Course_EducationOrganizationId", + "identity_json_path": "$.courseReference.educationOrganizationId" + }, + { + "column": "Survey_Namespace", + "identity_json_path": "$.surveyReference.namespace" + }, + { + "column": "Survey_SurveyIdentifier", + "identity_json_path": "$.surveyReference.surveyIdentifier" + } ] }, { @@ -37847,6 +41060,31 @@ "Program_ProgramTypeDescriptor_DescriptorId", "Survey_Namespace", "Survey_SurveyIdentifier" + ], + "resource_key_id": 326, + "project_name": "Ed-Fi", + "resource_name": "SurveyProgramAssociation", + "identity_elements": [ + { + "column": "Program_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "Program_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "Program_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Survey_Namespace", + "identity_json_path": "$.surveyReference.namespace" + }, + { + "column": "Survey_SurveyIdentifier", + "identity_json_path": "$.surveyReference.surveyIdentifier" + } ] }, { @@ -37879,8 +41117,25 @@ ], "identity_projection_columns": [ "QuestionCode", - "Survey_Namespace", - "Survey_SurveyIdentifier" + "Namespace_Unified", + "SurveyIdentifier_Unified" + ], + "resource_key_id": 327, + "project_name": "Ed-Fi", + "resource_name": "SurveyQuestion", + "identity_elements": [ + { + "column": "QuestionCode", + "identity_json_path": "$.questionCode" + }, + { + "column": "Survey_Namespace", + "identity_json_path": "$.surveyReference.namespace" + }, + { + "column": "Survey_SurveyIdentifier", + "identity_json_path": "$.surveyReference.surveyIdentifier" + } ] }, { @@ -37895,8 +41150,8 @@ ], "identity_projection_columns": [ "QuestionCode", - "Survey_Namespace", - "Survey_SurveyIdentifier" + "Namespace_Unified", + "SurveyIdentifier_Unified" ] }, { @@ -37922,12 +41177,39 @@ "DocumentId" ], "identity_projection_columns": [ - "SurveyQuestion_Namespace", + "Namespace_Unified", "SurveyQuestion_QuestionCode", - "SurveyQuestion_SurveyIdentifier", - "SurveyResponse_Namespace", - "SurveyResponse_SurveyIdentifier", + "SurveyIdentifier_Unified", "SurveyResponse_SurveyResponseIdentifier" + ], + "resource_key_id": 328, + "project_name": "Ed-Fi", + "resource_name": "SurveyQuestionResponse", + "identity_elements": [ + { + "column": "SurveyQuestion_Namespace", + "identity_json_path": "$.surveyQuestionReference.namespace" + }, + { + "column": "SurveyQuestion_QuestionCode", + "identity_json_path": "$.surveyQuestionReference.questionCode" + }, + { + "column": "SurveyQuestion_SurveyIdentifier", + "identity_json_path": "$.surveyQuestionReference.surveyIdentifier" + }, + { + "column": "SurveyResponse_Namespace", + "identity_json_path": "$.surveyResponseReference.namespace" + }, + { + "column": "SurveyResponse_SurveyIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyIdentifier" + }, + { + "column": "SurveyResponse_SurveyResponseIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyResponseIdentifier" + } ] }, { @@ -37941,11 +41223,9 @@ "DocumentId" ], "identity_projection_columns": [ - "SurveyQuestion_Namespace", + "Namespace_Unified", "SurveyQuestion_QuestionCode", - "SurveyQuestion_SurveyIdentifier", - "SurveyResponse_Namespace", - "SurveyResponse_SurveyIdentifier", + "SurveyIdentifier_Unified", "SurveyResponse_SurveyResponseIdentifier" ] }, @@ -37999,6 +41279,23 @@ "Survey_Namespace", "Survey_SurveyIdentifier", "SurveyResponseIdentifier" + ], + "resource_key_id": 329, + "project_name": "Ed-Fi", + "resource_name": "SurveyResponse", + "identity_elements": [ + { + "column": "Survey_Namespace", + "identity_json_path": "$.surveyReference.namespace" + }, + { + "column": "Survey_SurveyIdentifier", + "identity_json_path": "$.surveyReference.surveyIdentifier" + }, + { + "column": "SurveyResponseIdentifier", + "identity_json_path": "$.surveyResponseIdentifier" + } ] }, { @@ -38032,6 +41329,27 @@ "SurveyResponse_Namespace", "SurveyResponse_SurveyIdentifier", "SurveyResponse_SurveyResponseIdentifier" + ], + "resource_key_id": 330, + "project_name": "Ed-Fi", + "resource_name": "SurveyResponseEducationOrganizationTargetAssociation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "SurveyResponse_Namespace", + "identity_json_path": "$.surveyResponseReference.namespace" + }, + { + "column": "SurveyResponse_SurveyIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyIdentifier" + }, + { + "column": "SurveyResponse_SurveyResponseIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyResponseIdentifier" + } ] }, { @@ -38066,6 +41384,27 @@ "SurveyResponse_Namespace", "SurveyResponse_SurveyIdentifier", "SurveyResponse_SurveyResponseIdentifier" + ], + "resource_key_id": 331, + "project_name": "Ed-Fi", + "resource_name": "SurveyResponseStaffTargetAssociation", + "identity_elements": [ + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + }, + { + "column": "SurveyResponse_Namespace", + "identity_json_path": "$.surveyResponseReference.namespace" + }, + { + "column": "SurveyResponse_SurveyIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyIdentifier" + }, + { + "column": "SurveyResponse_SurveyResponseIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyResponseIdentifier" + } ] }, { @@ -38111,6 +41450,23 @@ "Survey_Namespace", "Survey_SurveyIdentifier", "SurveySectionTitle" + ], + "resource_key_id": 332, + "project_name": "Ed-Fi", + "resource_name": "SurveySection", + "identity_elements": [ + { + "column": "Survey_Namespace", + "identity_json_path": "$.surveyReference.namespace" + }, + { + "column": "Survey_SurveyIdentifier", + "identity_json_path": "$.surveyReference.surveyIdentifier" + }, + { + "column": "SurveySectionTitle", + "identity_json_path": "$.surveySectionTitle" + } ] }, { @@ -38147,6 +41503,39 @@ "Section_SessionName", "Survey_Namespace", "Survey_SurveyIdentifier" + ], + "resource_key_id": 333, + "project_name": "Ed-Fi", + "resource_name": "SurveySectionAssociation", + "identity_elements": [ + { + "column": "Section_LocalCourseCode", + "identity_json_path": "$.sectionReference.localCourseCode" + }, + { + "column": "Section_SchoolId", + "identity_json_path": "$.sectionReference.schoolId" + }, + { + "column": "Section_SchoolYear", + "identity_json_path": "$.sectionReference.schoolYear" + }, + { + "column": "Section_SectionIdentifier", + "identity_json_path": "$.sectionReference.sectionIdentifier" + }, + { + "column": "Section_SessionName", + "identity_json_path": "$.sectionReference.sessionName" + }, + { + "column": "Survey_Namespace", + "identity_json_path": "$.surveyReference.namespace" + }, + { + "column": "Survey_SurveyIdentifier", + "identity_json_path": "$.surveyReference.surveyIdentifier" + } ] }, { @@ -38180,12 +41569,39 @@ "DocumentId" ], "identity_projection_columns": [ - "SurveyResponse_Namespace", - "SurveyResponse_SurveyIdentifier", + "Namespace_Unified", + "SurveyIdentifier_Unified", "SurveyResponse_SurveyResponseIdentifier", - "SurveySection_Namespace", - "SurveySection_SurveyIdentifier", "SurveySection_SurveySectionTitle" + ], + "resource_key_id": 334, + "project_name": "Ed-Fi", + "resource_name": "SurveySectionResponse", + "identity_elements": [ + { + "column": "SurveyResponse_Namespace", + "identity_json_path": "$.surveyResponseReference.namespace" + }, + { + "column": "SurveyResponse_SurveyIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyIdentifier" + }, + { + "column": "SurveyResponse_SurveyResponseIdentifier", + "identity_json_path": "$.surveyResponseReference.surveyResponseIdentifier" + }, + { + "column": "SurveySection_Namespace", + "identity_json_path": "$.surveySectionReference.namespace" + }, + { + "column": "SurveySection_SurveyIdentifier", + "identity_json_path": "$.surveySectionReference.surveyIdentifier" + }, + { + "column": "SurveySection_SurveySectionTitle", + "identity_json_path": "$.surveySectionReference.surveySectionTitle" + } ] }, { @@ -38199,11 +41615,9 @@ "DocumentId" ], "identity_projection_columns": [ - "SurveyResponse_Namespace", - "SurveyResponse_SurveyIdentifier", + "Namespace_Unified", + "SurveyIdentifier_Unified", "SurveyResponse_SurveyResponseIdentifier", - "SurveySection_Namespace", - "SurveySection_SurveyIdentifier", "SurveySection_SurveySectionTitle" ] }, @@ -38245,6 +41659,39 @@ "SurveySectionResponse_SurveySectionReferenceSurveyIdentifier", "SurveySectionResponse_SurveyResponseIdentifier", "SurveySectionResponse_SurveySectionTitle" + ], + "resource_key_id": 335, + "project_name": "Ed-Fi", + "resource_name": "SurveySectionResponseEducationOrganizationTargetAssociation", + "identity_elements": [ + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "SurveySectionResponse_SurveyResponseReferenceNamespace", + "identity_json_path": "$.surveySectionResponseReference.namespace" + }, + { + "column": "SurveySectionResponse_SurveySectionReferenceNamespace", + "identity_json_path": "$.surveySectionResponseReference.namespace" + }, + { + "column": "SurveySectionResponse_SurveyResponseReferenceSurveyIdentifier", + "identity_json_path": "$.surveySectionResponseReference.surveyIdentifier" + }, + { + "column": "SurveySectionResponse_SurveySectionReferenceSurveyIdentifier", + "identity_json_path": "$.surveySectionResponseReference.surveyIdentifier" + }, + { + "column": "SurveySectionResponse_SurveyResponseIdentifier", + "identity_json_path": "$.surveySectionResponseReference.surveyResponseIdentifier" + }, + { + "column": "SurveySectionResponse_SurveySectionTitle", + "identity_json_path": "$.surveySectionResponseReference.surveySectionTitle" + } ] }, { @@ -38265,6 +41712,39 @@ "SurveySectionResponse_SurveySectionReferenceSurveyIdentifier", "SurveySectionResponse_SurveyResponseIdentifier", "SurveySectionResponse_SurveySectionTitle" + ], + "resource_key_id": 336, + "project_name": "Ed-Fi", + "resource_name": "SurveySectionResponseStaffTargetAssociation", + "identity_elements": [ + { + "column": "Staff_StaffUniqueId", + "identity_json_path": "$.staffReference.staffUniqueId" + }, + { + "column": "SurveySectionResponse_SurveyResponseReferenceNamespace", + "identity_json_path": "$.surveySectionResponseReference.namespace" + }, + { + "column": "SurveySectionResponse_SurveySectionReferenceNamespace", + "identity_json_path": "$.surveySectionResponseReference.namespace" + }, + { + "column": "SurveySectionResponse_SurveyResponseReferenceSurveyIdentifier", + "identity_json_path": "$.surveySectionResponseReference.surveyIdentifier" + }, + { + "column": "SurveySectionResponse_SurveySectionReferenceSurveyIdentifier", + "identity_json_path": "$.surveySectionResponseReference.surveyIdentifier" + }, + { + "column": "SurveySectionResponse_SurveyResponseIdentifier", + "identity_json_path": "$.surveySectionResponseReference.surveyResponseIdentifier" + }, + { + "column": "SurveySectionResponse_SurveySectionTitle", + "identity_json_path": "$.surveySectionResponseReference.surveySectionTitle" + } ] }, { @@ -38299,6 +41779,15 @@ ], "identity_projection_columns": [ "BusId" + ], + "resource_key_id": 353, + "project_name": "Sample", + "resource_name": "Bus", + "identity_elements": [ + { + "column": "BusId", + "identity_json_path": "$.busId" + } ] }, { @@ -38328,6 +41817,19 @@ "identity_projection_columns": [ "Bus_BusId", "BusRouteNumber" + ], + "resource_key_id": 354, + "project_name": "Sample", + "resource_name": "BusRoute", + "identity_elements": [ + { + "column": "Bus_BusId", + "identity_json_path": "$.busReference.busId" + }, + { + "column": "BusRouteNumber", + "identity_json_path": "$.busRouteNumber" + } ] }, { @@ -38582,7 +42084,34 @@ "target_table": { "schema": "edfi", "name": "GeneralStudentProgramAssociationIdentity" - } + }, + "target_column_mappings": [ + { + "source_column": "BeginDate", + "target_column": "BeginDate" + }, + { + "source_column": "EducationOrganization_EducationOrganizationId", + "target_column": "EducationOrganizationReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_EducationOrganizationId", + "target_column": "ProgramReferenceEducationOrganizationId" + }, + { + "source_column": "ProgramProgram_ProgramName", + "target_column": "ProgramReferenceProgramName" + }, + { + "source_column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "target_column": "ProgramReferenceProgramTypeDescriptor" + }, + { + "source_column": "Student_StudentUniqueId", + "target_column": "StudentReferenceStudentUniqueId" + } + ], + "discriminator_value": "Sample:StudentArtProgramAssociation" }, { "name": "TR_StudentArtProgramAssociation_ReferentialIdentity", @@ -38601,7 +42130,67 @@ "ProgramProgram_ProgramName", "ProgramProgram_ProgramTypeDescriptor_DescriptorId", "Student_StudentUniqueId" - ] + ], + "resource_key_id": 361, + "project_name": "Sample", + "resource_name": "StudentArtProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ], + "superclass_alias": { + "resource_key_id": 121, + "project_name": "Ed-Fi", + "resource_name": "GeneralStudentProgramAssociation", + "identity_elements": [ + { + "column": "BeginDate", + "identity_json_path": "$.beginDate" + }, + { + "column": "EducationOrganization_EducationOrganizationId", + "identity_json_path": "$.educationOrganizationReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_EducationOrganizationId", + "identity_json_path": "$.programReference.educationOrganizationId" + }, + { + "column": "ProgramProgram_ProgramName", + "identity_json_path": "$.programReference.programName" + }, + { + "column": "ProgramProgram_ProgramTypeDescriptor_DescriptorId", + "identity_json_path": "$.programReference.programTypeDescriptor" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } + ] + } }, { "name": "TR_StudentArtProgramAssociation_Stamp", @@ -38925,6 +42514,27 @@ "GraduationPlan_GraduationPlanTypeDescriptor_DescriptorId", "GraduationPlan_GraduationSchoolYear", "Student_StudentUniqueId" + ], + "resource_key_id": 365, + "project_name": "Sample", + "resource_name": "StudentGraduationPlanAssociation", + "identity_elements": [ + { + "column": "GraduationPlan_EducationOrganizationId", + "identity_json_path": "$.graduationPlanReference.educationOrganizationId" + }, + { + "column": "GraduationPlan_GraduationPlanTypeDescriptor_DescriptorId", + "identity_json_path": "$.graduationPlanReference.graduationPlanTypeDescriptor" + }, + { + "column": "GraduationPlan_GraduationSchoolYear", + "identity_json_path": "$.graduationPlanReference.graduationSchoolYear" + }, + { + "column": "Student_StudentUniqueId", + "identity_json_path": "$.studentReference.studentUniqueId" + } ] }, { @@ -39098,14 +42708,13 @@ } }, { - "name": "AdministrationIdentifier", - "kind": "Scalar", + "name": "Assessment_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.administrationIdentifier", + "source_path": "$.assessmentReference", "storage": { "kind": "Stored" } @@ -39137,37 +42746,38 @@ } }, { - "name": "AssigningEducationOrganization_EducationOrganizationId", - "kind": "Scalar", + "name": "AssigningEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.assigningEducationOrganizationReference.educationOrganizationId", + "source_path": "$.assigningEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "Assessment_DocumentId", - "kind": "DocumentFk", + "name": "AssigningEducationOrganization_EducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.assessmentReference", + "source_path": "$.assigningEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssigningEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "AdministrationIdentifier", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 255 }, "is_nullable": false, - "source_path": "$.assigningEducationOrganizationReference", + "source_path": "$.administrationIdentifier", "storage": { "kind": "Stored" } @@ -39307,6 +42917,18 @@ "kind": "Stored" } }, + { + "name": "AssessmentBatteryPart_DocumentId", + "kind": "DocumentFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.assessmentBatteryParts[*].assessmentBatteryPartReference", + "storage": { + "kind": "Stored" + } + }, { "name": "AssessmentBatteryPart_AssessmentBatteryPartName", "kind": "Scalar", @@ -39345,18 +42967,6 @@ "storage": { "kind": "Stored" } - }, - { - "name": "AssessmentBatteryPart_DocumentId", - "kind": "DocumentFk", - "type": { - "kind": "Int64" - }, - "is_nullable": true, - "source_path": "$.assessmentBatteryParts[*].assessmentBatteryPartReference", - "storage": { - "kind": "Stored" - } } ], "key_unification_classes": [], @@ -39583,104 +43193,28 @@ "project_name": "Ed-Fi", "resource_name": "ProgramEvaluationElement" }, - "physical_schema": "edfi", - "storage_kind": "RelationalTables", - "tables": [ - { - "schema": "edfi", - "name": "ProgramEvaluationElement", - "scope": "$", - "key_columns": [ - { - "name": "DocumentId", - "kind": "ParentKeyPart" - } - ], - "columns": [ - { - "name": "DocumentId", - "kind": "ParentKeyPart", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ProgramTypeDescriptor_Unified_DescriptorId", - "kind": "DescriptorFk", - "type": { - "kind": "Int64" - }, - "is_nullable": false, - "source_path": null, - "storage": { - "kind": "Stored" - } - }, - { - "name": "ElementMaxNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.elementMaxNumericRating", - "storage": { - "kind": "Stored" - } - }, + "physical_schema": "edfi", + "storage_kind": "RelationalTables", + "tables": [ + { + "schema": "edfi", + "name": "ProgramEvaluationElement", + "scope": "$", + "key_columns": [ { - "name": "ElementMinNumericRating", - "kind": "Scalar", - "type": { - "kind": "Decimal", - "precision": 6, - "scale": 3 - }, - "is_nullable": true, - "source_path": "$.elementMinNumericRating", - "storage": { - "kind": "Stored" - } - }, + "name": "DocumentId", + "kind": "ParentKeyPart" + } + ], + "columns": [ { - "name": "ElementSortOrder", - "kind": "Scalar", + "name": "DocumentId", + "kind": "ParentKeyPart", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.elementSortOrder", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } @@ -39698,50 +43232,48 @@ } }, { - "name": "ProgramEvaluationElementDescription", - "kind": "Scalar", + "name": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 255 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.programEvaluationElementDescription", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationElementTitle", + "name": "ProgramEvaluationTitle_Unified", "kind": "Scalar", "type": { "kind": "String", "max_length": 50 }, "is_nullable": false, - "source_path": "$.programEvaluationElementTitle", + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationObjectiveTitle", - "kind": "Scalar", + "name": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationObjectiveTitle", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "ProgramEvaluationTitle_Unified", + "name": "ProgramName_Unified", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, "source_path": null, @@ -39750,11 +43282,10 @@ } }, { - "name": "ProgramName_Unified", - "kind": "Scalar", + "name": "ProgramTypeDescriptor_Unified_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, "source_path": null, @@ -39775,73 +43306,72 @@ } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationPeriodDe_0fde0c9fcc", - "kind": "DescriptorFk", + "name": "ProgramEvaluationObjective_ProgramEvaluationObjectiveTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationPeriodDescriptor", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationObjectiveTitle", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", - "presence_column": "ProgramEvaluationObjective_DocumentId" + "kind": "Stored" } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationTypeDesc_513b5067cb", - "kind": "DescriptorFk", + "name": "ProgramEvaluationObjective_ProgramEducationOrganizationId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationObjectiveReference.programEducationOrganizationId", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEducationOrganizationId_Unified", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluationObjective_ProgramEvaluationPeriodDe_0fde0c9fcc", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programTypeDescriptor", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationPeriodDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationPeriodDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramEducationOrganizationId", + "name": "ProgramEvaluationObjective_ProgramEvaluationTitle", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 50 }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEducationOrganizationId", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationTitle", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEducationOrganizationId_Unified", + "canonical_column": "ProgramEvaluationTitle_Unified", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, { - "name": "ProgramEvaluationObjective_ProgramEvaluationTitle", - "kind": "Scalar", + "name": "ProgramEvaluationObjective_ProgramEvaluationTypeDesc_513b5067cb", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 50 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.programEvaluationObjectiveReference.programEvaluationTitle", + "source_path": "$.programEvaluationObjectiveReference.programEvaluationTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTitle_Unified", + "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluationObjective_DocumentId" } }, @@ -39860,6 +43390,20 @@ "presence_column": "ProgramEvaluationObjective_DocumentId" } }, + { + "name": "ProgramEvaluationObjective_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.programEvaluationObjectiveReference.programTypeDescriptor", + "storage": { + "kind": "UnifiedAlias", + "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", + "presence_column": "ProgramEvaluationObjective_DocumentId" + } + }, { "name": "ProgramEvaluation_DocumentId", "kind": "DocumentFk", @@ -39887,30 +43431,31 @@ } }, { - "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ProgramEvaluation_ProgramEvaluationTitle", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 50 }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTypeDescriptor", + "source_path": "$.programEvaluationReference.programEvaluationTitle", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTitle_Unified", "presence_column": "ProgramEvaluation_DocumentId" } }, { - "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "name": "ProgramEvaluation_ProgramEvaluationTypeDescriptor_DescriptorId", "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programTypeDescriptor", + "source_path": "$.programEvaluationReference.programEvaluationTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", + "canonical_column": "ProgramEvaluationTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluation_DocumentId" } }, @@ -39929,34 +43474,99 @@ } }, { - "name": "ProgramEvaluation_ProgramEvaluationTitle", + "name": "ProgramEvaluation_ProgramName", "kind": "Scalar", "type": { "kind": "String", - "max_length": 50 + "max_length": 60 }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programEvaluationTitle", + "source_path": "$.programEvaluationReference.programName", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramEvaluationTitle_Unified", + "canonical_column": "ProgramName_Unified", "presence_column": "ProgramEvaluation_DocumentId" } }, { - "name": "ProgramEvaluation_ProgramName", - "kind": "Scalar", + "name": "ProgramEvaluation_ProgramTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int64" }, "is_nullable": false, - "source_path": "$.programEvaluationReference.programName", + "source_path": "$.programEvaluationReference.programTypeDescriptor", "storage": { "kind": "UnifiedAlias", - "canonical_column": "ProgramName_Unified", + "canonical_column": "ProgramTypeDescriptor_Unified_DescriptorId", "presence_column": "ProgramEvaluation_DocumentId" } + }, + { + "name": "ElementMaxNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.elementMaxNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ElementMinNumericRating", + "kind": "Scalar", + "type": { + "kind": "Decimal", + "precision": 6, + "scale": 3 + }, + "is_nullable": true, + "source_path": "$.elementMinNumericRating", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ElementSortOrder", + "kind": "Scalar", + "type": { + "kind": "Int32" + }, + "is_nullable": true, + "source_path": "$.elementSortOrder", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationElementDescription", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 255 + }, + "is_nullable": true, + "source_path": "$.programEvaluationElementDescription", + "storage": { + "kind": "Stored" + } + }, + { + "name": "ProgramEvaluationElementTitle", + "kind": "Scalar", + "type": { + "kind": "String", + "max_length": 50 + }, + "is_nullable": false, + "source_path": "$.programEvaluationElementTitle", + "storage": { + "kind": "Stored" + } } ], "key_unification_classes": [ @@ -40513,25 +44123,26 @@ } }, { - "name": "AssessmentGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "StudentUniqueId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.assessmentGradeLevelDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "PlatformTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "AssessmentAdministration_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.platformTypeDescriptor", + "is_nullable": false, + "source_path": "$.assessmentAdministrationReference", "storage": { "kind": "Stored" } @@ -40562,18 +44173,6 @@ "kind": "Stored" } }, - { - "name": "AssessmentAdministration_AssigningEducationOrganizationId", - "kind": "Scalar", - "type": { - "kind": "Int32" - }, - "is_nullable": false, - "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", - "storage": { - "kind": "Stored" - } - }, { "name": "AssessmentAdministration_Namespace", "kind": "Scalar", @@ -40588,201 +44187,212 @@ } }, { - "name": "ReportingEducationOrganization_EducationOrganizationId", + "name": "AssessmentAdministration_AssigningEducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.reportingEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.assessmentAdministrationReference.assigningEducationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_42c01c7c2c", - "kind": "Scalar", + "name": "ReportingEducationOrganization_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", + "source_path": "$.reportingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_44578471b1", + "name": "ReportingEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", + "source_path": "$.reportingEducationOrganizationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_EducationOrganizationId", - "kind": "Scalar", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_8a1ccd30ea", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_EntryDate", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_42c01c7c2c", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.entryDate", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_SchoolId", + "name": "ScheduledStudentEducationOrganizationAssessmentAccom_44578471b1", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "String", + "max_length": 32 }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.schoolId", + "is_nullable": true, + "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "StudentUniqueId_Unified", - "kind": "Scalar", + "name": "StudentEducationOrganizationAssociation_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, "is_nullable": false, - "source_path": null, + "source_path": "$.studentEducationOrganizationAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "TestingEducationOrganization_EducationOrganizationId", + "name": "StudentEducationOrganizationAssociation_EducationOrganizationId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.testingEducationOrganizationReference.educationOrganizationId", + "is_nullable": false, + "source_path": "$.studentEducationOrganizationAssociationReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "AssessmentAdministration_DocumentId", - "kind": "DocumentFk", + "name": "StudentEducationOrganizationAssociation_StudentUniqueId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 32 }, "is_nullable": false, - "source_path": "$.assessmentAdministrationReference", + "source_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "StudentUniqueId_Unified", + "presence_column": "StudentEducationOrganizationAssociation_DocumentId" } }, { - "name": "ReportingEducationOrganization_DocumentId", + "name": "StudentSchoolAssociation_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.reportingEducationOrganizationReference", + "is_nullable": false, + "source_path": "$.studentSchoolAssociationReference", "storage": { "kind": "Stored" } }, { - "name": "ScheduledStudentEducationOrganizationAssessmentAccom_8a1ccd30ea", - "kind": "DocumentFk", + "name": "StudentSchoolAssociation_EntryDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.scheduledStudentEducationOrganizationAssessmentAccommodationReference", + "is_nullable": false, + "source_path": "$.studentSchoolAssociationReference.entryDate", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_DocumentId", - "kind": "DocumentFk", + "name": "StudentSchoolAssociation_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference", + "source_path": "$.studentSchoolAssociationReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "StudentEducationOrganizationAssociation_StudentUniqueId", + "name": "StudentSchoolAssociation_StudentUniqueId", "kind": "Scalar", "type": { "kind": "String", "max_length": 32 }, "is_nullable": false, - "source_path": "$.studentEducationOrganizationAssociationReference.studentUniqueId", + "source_path": "$.studentSchoolAssociationReference.studentUniqueId", "storage": { "kind": "UnifiedAlias", "canonical_column": "StudentUniqueId_Unified", - "presence_column": "StudentEducationOrganizationAssociation_DocumentId" + "presence_column": "StudentSchoolAssociation_DocumentId" } }, { - "name": "StudentSchoolAssociation_DocumentId", + "name": "TestingEducationOrganization_DocumentId", "kind": "DocumentFk", "type": { "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference", + "is_nullable": true, + "source_path": "$.testingEducationOrganizationReference", "storage": { "kind": "Stored" } }, { - "name": "StudentSchoolAssociation_StudentUniqueId", + "name": "TestingEducationOrganization_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.studentSchoolAssociationReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.testingEducationOrganizationReference.educationOrganizationId", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "StudentUniqueId_Unified", - "presence_column": "StudentSchoolAssociation_DocumentId" + "kind": "Stored" } }, { - "name": "TestingEducationOrganization_DocumentId", - "kind": "DocumentFk", + "name": "AssessmentGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.testingEducationOrganizationReference", + "source_path": "$.assessmentGradeLevelDescriptor", + "storage": { + "kind": "Stored" + } + }, + { + "name": "PlatformTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", + "type": { + "kind": "Int64" + }, + "is_nullable": true, + "source_path": "$.platformTypeDescriptor", "storage": { "kind": "Stored" } @@ -41456,457 +45066,457 @@ } }, { - "name": "EnrollmentTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolId_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.enrollmentTypeDescriptor", + "is_nullable": false, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EntryGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "SchoolYear_Unified", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, - "is_nullable": false, - "source_path": "$.entryGradeLevelDescriptor", + "is_nullable": true, + "source_path": null, "storage": { "kind": "Stored" } }, { - "name": "EntryGradeLevelReasonDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.entryGradeLevelReasonDescriptor", + "source_path": "$.calendarReference", "storage": { "kind": "Stored" } }, { - "name": "EntryTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_CalendarCode", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "String", + "max_length": 60 }, "is_nullable": true, - "source_path": "$.entryTypeDescriptor", + "source_path": "$.calendarReference.calendarCode", "storage": { "kind": "Stored" } }, { - "name": "ExitWithdrawTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_SchoolId", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.exitWithdrawTypeDescriptor", + "source_path": "$.calendarReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "Calendar_DocumentId" } }, { - "name": "GraduationPlan_GraduationPlanTypeDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "Calendar_SchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.graduationPlanReference.graduationPlanTypeDescriptor", + "source_path": "$.calendarReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "Calendar_DocumentId" } }, { - "name": "NextYearGradeLevelDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ClassOfSchoolYear_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.nextYearGradeLevelDescriptor", + "source_path": "$.classOfSchoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "ResidencyStatusDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "ClassOfSchoolYear_ClassOfSchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.residencyStatusDescriptor", + "source_path": "$.classOfSchoolYearTypeReference.schoolYear", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoiceBasisDescriptor_DescriptorId", - "kind": "DescriptorFk", + "name": "GraduationPlan_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.schoolChoiceBasisDescriptor", + "source_path": "$.graduationPlanReference", "storage": { "kind": "Stored" } }, { - "name": "Calendar_CalendarCode", + "name": "GraduationPlan_EducationOrganizationId", "kind": "Scalar", "type": { - "kind": "String", - "max_length": 60 + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.calendarReference.calendarCode", + "source_path": "$.graduationPlanReference.educationOrganizationId", "storage": { "kind": "Stored" } }, { - "name": "ClassOfSchoolYear_ClassOfSchoolYear", - "kind": "Scalar", + "name": "GraduationPlan_GraduationPlanTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.classOfSchoolYearTypeReference.schoolYear", + "source_path": "$.graduationPlanReference.graduationPlanTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "EmployedWhileEnrolled", + "name": "GraduationPlan_GraduationSchoolYear", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.employedWhileEnrolled", + "source_path": "$.graduationPlanReference.graduationSchoolYear", "storage": { "kind": "Stored" } }, { - "name": "EntryDate", - "kind": "Scalar", + "name": "NextYearSchool_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Date" + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.entryDate", + "is_nullable": true, + "source_path": "$.nextYearSchoolReference", "storage": { "kind": "Stored" } }, { - "name": "ExitWithdrawDate", + "name": "NextYearSchool_SchoolId", "kind": "Scalar", "type": { - "kind": "Date" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.exitWithdrawDate", + "source_path": "$.nextYearSchoolReference.schoolId", "storage": { "kind": "Stored" } }, { - "name": "FullTimeEquivalency", - "kind": "Scalar", + "name": "SchoolYear_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Decimal", - "precision": 5, - "scale": 4 + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.fullTimeEquivalency", + "source_path": "$.schoolYearTypeReference", "storage": { "kind": "Stored" } }, { - "name": "GraduationPlan_EducationOrganizationId", + "name": "SchoolYear_SchoolYear", "kind": "Scalar", "type": { "kind": "Int32" }, "is_nullable": true, - "source_path": "$.graduationPlanReference.educationOrganizationId", + "source_path": "$.schoolYearTypeReference.schoolYear", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolYear_Unified", + "presence_column": "SchoolYear_DocumentId" } }, { - "name": "GraduationPlan_GraduationSchoolYear", - "kind": "Scalar", + "name": "School_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.graduationPlanReference.graduationSchoolYear", + "is_nullable": false, + "source_path": "$.schoolReference", "storage": { "kind": "Stored" } }, { - "name": "NextYearSchool_SchoolId", + "name": "School_SchoolId", "kind": "Scalar", "type": { "kind": "Int32" }, - "is_nullable": true, - "source_path": "$.nextYearSchoolReference.schoolId", + "is_nullable": false, + "source_path": "$.schoolReference.schoolId", "storage": { - "kind": "Stored" + "kind": "UnifiedAlias", + "canonical_column": "SchoolId_Unified", + "presence_column": "School_DocumentId" } }, { - "name": "PrimarySchool", - "kind": "Scalar", + "name": "Student_DocumentId", + "kind": "DocumentFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.primarySchool", + "is_nullable": false, + "source_path": "$.studentReference", "storage": { "kind": "Stored" } }, { - "name": "RepeatGradeIndicator", + "name": "Student_StudentUniqueId", "kind": "Scalar", "type": { - "kind": "Boolean" + "kind": "String", + "max_length": 32 }, - "is_nullable": true, - "source_path": "$.repeatGradeIndicator", + "is_nullable": false, + "source_path": "$.studentReference.studentUniqueId", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoice", - "kind": "Scalar", + "name": "EnrollmentTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.schoolChoice", + "source_path": "$.enrollmentTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolChoiceTransfer", - "kind": "Scalar", + "name": "EntryGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, - "is_nullable": true, - "source_path": "$.schoolChoiceTransfer", + "is_nullable": false, + "source_path": "$.entryGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolId_Unified", - "kind": "Scalar", + "name": "EntryGradeLevelReasonDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, - "is_nullable": false, - "source_path": null, + "is_nullable": true, + "source_path": "$.entryGradeLevelReasonDescriptor", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_Unified", - "kind": "Scalar", + "name": "EntryTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": null, + "source_path": "$.entryTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Student_StudentUniqueId", - "kind": "Scalar", + "name": "ExitWithdrawTypeDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "String", - "max_length": 32 + "kind": "Int64" }, - "is_nullable": false, - "source_path": "$.studentReference.studentUniqueId", + "is_nullable": true, + "source_path": "$.exitWithdrawTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "TermCompletionIndicator", - "kind": "Scalar", + "name": "NextYearGradeLevelDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Boolean" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.termCompletionIndicator", + "source_path": "$.nextYearGradeLevelDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Calendar_DocumentId", - "kind": "DocumentFk", + "name": "ResidencyStatusDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.calendarReference", + "source_path": "$.residencyStatusDescriptor", "storage": { "kind": "Stored" } }, { - "name": "Calendar_SchoolId", - "kind": "Scalar", + "name": "SchoolChoiceBasisDescriptor_DescriptorId", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.calendarReference.schoolId", + "source_path": "$.schoolChoiceBasisDescriptor", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "Calendar_DocumentId" + "kind": "Stored" } }, { - "name": "Calendar_SchoolYear", + "name": "EmployedWhileEnrolled", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.calendarReference.schoolYear", + "source_path": "$.employedWhileEnrolled", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "Calendar_DocumentId" + "kind": "Stored" } }, { - "name": "ClassOfSchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "EntryDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, - "is_nullable": true, - "source_path": "$.classOfSchoolYearTypeReference", + "is_nullable": false, + "source_path": "$.entryDate", "storage": { "kind": "Stored" } }, { - "name": "GraduationPlan_DocumentId", - "kind": "DocumentFk", + "name": "ExitWithdrawDate", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Date" }, "is_nullable": true, - "source_path": "$.graduationPlanReference", + "source_path": "$.exitWithdrawDate", "storage": { "kind": "Stored" } }, { - "name": "NextYearSchool_DocumentId", - "kind": "DocumentFk", + "name": "FullTimeEquivalency", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Decimal", + "precision": 5, + "scale": 4 }, "is_nullable": true, - "source_path": "$.nextYearSchoolReference", + "source_path": "$.fullTimeEquivalency", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_DocumentId", - "kind": "DocumentFk", + "name": "PrimarySchool", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.schoolYearTypeReference", + "source_path": "$.primarySchool", "storage": { "kind": "Stored" } }, { - "name": "SchoolYear_SchoolYear", + "name": "RepeatGradeIndicator", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Boolean" }, "is_nullable": true, - "source_path": "$.schoolYearTypeReference.schoolYear", + "source_path": "$.repeatGradeIndicator", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolYear_Unified", - "presence_column": "SchoolYear_DocumentId" + "kind": "Stored" } }, { - "name": "School_DocumentId", - "kind": "DocumentFk", + "name": "SchoolChoice", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.schoolReference", + "is_nullable": true, + "source_path": "$.schoolChoice", "storage": { "kind": "Stored" } }, { - "name": "School_SchoolId", + "name": "SchoolChoiceTransfer", "kind": "Scalar", "type": { - "kind": "Int32" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.schoolReference.schoolId", + "is_nullable": true, + "source_path": "$.schoolChoiceTransfer", "storage": { - "kind": "UnifiedAlias", - "canonical_column": "SchoolId_Unified", - "presence_column": "School_DocumentId" + "kind": "Stored" } }, { - "name": "Student_DocumentId", - "kind": "DocumentFk", + "name": "TermCompletionIndicator", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Boolean" }, - "is_nullable": false, - "source_path": "$.studentReference", + "is_nullable": true, + "source_path": "$.termCompletionIndicator", "storage": { "kind": "Stored" } @@ -42416,13 +46026,13 @@ } }, { - "name": "AlternativeGraduationPlan_GraduationPlanTypeDescript_0b71806181", - "kind": "DescriptorFk", + "name": "AlternativeGraduationPlan_DocumentId", + "kind": "DocumentFk", "type": { "kind": "Int64" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationPlanTypeDescriptor", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference", "storage": { "kind": "Stored" } @@ -42440,25 +46050,25 @@ } }, { - "name": "AlternativeGraduationPlan_GraduationSchoolYear", - "kind": "Scalar", + "name": "AlternativeGraduationPlan_GraduationPlanTypeDescript_0b71806181", + "kind": "DescriptorFk", "type": { - "kind": "Int32" + "kind": "Int64" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationSchoolYear", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationPlanTypeDescriptor", "storage": { "kind": "Stored" } }, { - "name": "AlternativeGraduationPlan_DocumentId", - "kind": "DocumentFk", + "name": "AlternativeGraduationPlan_GraduationSchoolYear", + "kind": "Scalar", "type": { - "kind": "Int64" + "kind": "Int32" }, "is_nullable": true, - "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference", + "source_path": "$.alternativeGraduationPlans[*].alternativeGraduationPlanReference.graduationSchoolYear", "storage": { "kind": "Stored" } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/IdentifierShorteningScopeTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/IdentifierShorteningScopeTests.cs index 770019560..09e18382c 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/IdentifierShorteningScopeTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/IdentifierShorteningScopeTests.cs @@ -258,18 +258,18 @@ public void Execute(RelationalModelSetBuilderContext context) new DbTriggerInfo( new DbTriggerName("TR_LongAlpha"), tableAlpha, - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName("TR_LongBeta"), tableBeta, - DbTriggerKind.DocumentStamping, [], - [] + [], + new TriggerKindParameters.DocumentStamping() ) ); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/KeyUnificationPassTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/KeyUnificationPassTests.cs index b49990c23..f4f02b6d2 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/KeyUnificationPassTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/KeyUnificationPassTests.cs @@ -33,7 +33,9 @@ public void Setup() isExtensionProject: false ); var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([project]); - var builder = new DerivedRelationalModelSetBuilder(RelationalModelSetPasses.CreateDefault()); + var builder = new DerivedRelationalModelSetBuilder( + KeyUnificationPassTestSchemaBuilder.BuildPassesThroughKeyUnification() + ); var result = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); _rootTable = result @@ -131,7 +133,9 @@ public void Setup() isExtensionProject: false ); var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([project]); - var builder = new DerivedRelationalModelSetBuilder(RelationalModelSetPasses.CreateDefault()); + var builder = new DerivedRelationalModelSetBuilder( + KeyUnificationPassTestSchemaBuilder.BuildPassesThroughKeyUnification() + ); var result = builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); _rootTable = result @@ -1238,6 +1242,32 @@ public void Execute(RelationalModelSetBuilderContext context) /// file static class KeyUnificationPassTestSchemaBuilder { + /// + /// Build the default pass list through key unification, excluding index and trigger derivation + /// passes that require non-nullable identity paths (which these test schemas intentionally omit). + /// + internal static IRelationalModelSetPass[] BuildPassesThroughKeyUnification() + { + return + [ + new BaseTraversalAndDescriptorBindingPass(), + new DescriptorResourceMappingPass(), + new ExtensionTableDerivationPass(), + new ReferenceBindingPass(), + new KeyUnificationPass(), + new AbstractIdentityTableAndUnionViewDerivationPass(), + new ValidateUnifiedAliasMetadataPass(), + new RootIdentityConstraintPass(), + new ReferenceConstraintPass(), + new ArrayUniquenessConstraintPass(), + new DescriptorForeignKeyConstraintPass(), + new ApplyConstraintDialectHashingPass(), + new ValidateForeignKeyStorageInvariantPass(), + new ApplyDialectIdentifierShorteningPass(), + new CanonicalizeOrderingPass(), + ]; + } + /// /// Build a derived relational model set from one in-memory project schema. /// @@ -1270,7 +1300,9 @@ internal static DerivedRelationalModelSet BuildDerivedSet( ) .ToArray(); var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet(projects); - var builder = new DerivedRelationalModelSetBuilder(RelationalModelSetPasses.CreateDefault()); + var builder = new DerivedRelationalModelSetBuilder( + KeyUnificationPassTestSchemaBuilder.BuildPassesThroughKeyUnification() + ); return builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/RelationalModelManifestEmitterTests.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/RelationalModelManifestEmitterTests.cs index c740622ce..c3e050cb6 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/RelationalModelManifestEmitterTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/RelationalModelManifestEmitterTests.cs @@ -755,6 +755,8 @@ private static JsonObject CreateExtensionSchema() /// /// Build a derived relational-model set from one in-memory project schema. + /// Uses a pass list that excludes index and trigger derivation since manifest emitter tests + /// use schemas with intentionally empty identity paths. /// private static DerivedRelationalModelSet BuildDerivedSet(JsonObject projectSchema) { @@ -763,7 +765,25 @@ private static DerivedRelationalModelSet BuildDerivedSet(JsonObject projectSchem isExtensionProject: false ); var schemaSet = EffectiveSchemaSetFixtureBuilder.CreateEffectiveSchemaSet([project]); - var builder = new DerivedRelationalModelSetBuilder(RelationalModelSetPasses.CreateDefault()); + IRelationalModelSetPass[] passes = + [ + new BaseTraversalAndDescriptorBindingPass(), + new DescriptorResourceMappingPass(), + new ExtensionTableDerivationPass(), + new ReferenceBindingPass(), + new KeyUnificationPass(), + new AbstractIdentityTableAndUnionViewDerivationPass(), + new ValidateUnifiedAliasMetadataPass(), + new RootIdentityConstraintPass(), + new ReferenceConstraintPass(), + new ArrayUniquenessConstraintPass(), + new DescriptorForeignKeyConstraintPass(), + new ApplyConstraintDialectHashingPass(), + new ValidateForeignKeyStorageInvariantPass(), + new ApplyDialectIdentifierShorteningPass(), + new CanonicalizeOrderingPass(), + ]; + var builder = new DerivedRelationalModelSetBuilder(passes); return builder.Build(schemaSet, SqlDialect.Pgsql, new PgsqlDialectRules()); } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelCanonicalization.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelCanonicalization.cs index 4c72ebe14..1fbfc9f5c 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelCanonicalization.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelCanonicalization.cs @@ -3,6 +3,8 @@ // The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. // See the LICENSE and NOTICES files in the project root for more information. +using EdFi.DataManagementService.Backend.RelationalModel.SetPasses; + namespace EdFi.DataManagementService.Backend.RelationalModel.Build; /// @@ -19,8 +21,15 @@ internal static RelationalResourceModel CanonicalizeResourceModel(RelationalReso ArgumentNullException.ThrowIfNull(resourceModel); var canonicalTables = resourceModel - .TablesInDependencyOrder.Select(RelationalModelOrdering.CanonicalizeTable) - .OrderBy(table => CountArrayDepth(table.JsonScope)) + .TablesInDependencyOrder.Select(table => + { + var referenceGroups = BuildReferenceGroupLookup( + table.Table, + resourceModel.DocumentReferenceBindings + ); + return RelationalModelOrdering.CanonicalizeTable(table, referenceGroups); + }) + .OrderBy(table => SetPassHelpers.CountArrayDepth(table.JsonScope)) .ThenBy(table => table.JsonScope.Canonical, StringComparer.Ordinal) .ThenBy(table => table.Table.Schema.Value, StringComparer.Ordinal) .ThenBy(table => table.Table.Name, StringComparer.Ordinal) @@ -85,6 +94,39 @@ entry with }; } + /// + /// Builds a lookup mapping column names to their reference group membership for the given table. + /// Returns null when no bindings match the table (avoids allocations). + /// + private static Dictionary? BuildReferenceGroupLookup( + DbTableName table, + IReadOnlyList bindings + ) + { + Dictionary? result = null; + + foreach (var binding in bindings) + { + if (!binding.Table.Equals(table)) + { + continue; + } + + var groupKey = binding.FkColumn.Value; + + result ??= new Dictionary(StringComparer.Ordinal); + result.TryAdd(groupKey, new ReferenceGroupMembership(groupKey, 0)); + + for (var i = 0; i < binding.IdentityBindings.Count; i++) + { + var identityColumnName = binding.IdentityBindings[i].Column.Value; + result.TryAdd(identityColumnName, new ReferenceGroupMembership(groupKey, i + 1)); + } + } + + return result; + } + /// /// Returns a copy of the extension sites list ordered canonically. /// @@ -109,22 +151,4 @@ site with .ThenBy(site => string.Join("|", site.ProjectKeys), StringComparer.Ordinal) .ToArray(); } - - /// - /// Counts the number of array wildcard segments in the scope, used for depth-first ordering. - /// - private static int CountArrayDepth(JsonPathExpression scope) - { - var depth = 0; - - foreach (var segment in scope.Segments) - { - if (segment is JsonPathSegment.AnyArrayElement) - { - depth++; - } - } - - return depth; - } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelManifestEmitter.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelManifestEmitter.cs index dbe96446d..782e5c660 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelManifestEmitter.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelManifestEmitter.cs @@ -6,6 +6,7 @@ using System.Buffers; using System.Text; using System.Text.Json; +using static EdFi.DataManagementService.Backend.RelationalModel.Manifest.ManifestWriterHelpers; namespace EdFi.DataManagementService.Backend.RelationalModel.Build; @@ -15,7 +16,7 @@ namespace EdFi.DataManagementService.Backend.RelationalModel.Build; /// public static class RelationalModelManifestEmitter { - private static readonly JsonWriterOptions _writerOptions = new() { Indented = true }; + private static readonly JsonWriterOptions _writerOptions = new() { Indented = true, NewLine = "\n" }; private static readonly DbTableName _descriptorTableName = new(new DbSchemaName("dms"), "Descriptor"); /// @@ -25,10 +26,7 @@ public static class RelationalModelManifestEmitter /// The JSON manifest. public static string Emit(RelationalModelBuildResult buildResult) { - if (buildResult is null) - { - throw new ArgumentNullException(nameof(buildResult)); - } + ArgumentNullException.ThrowIfNull(buildResult); return Emit(buildResult.ResourceModel, buildResult.ExtensionSites); } @@ -117,20 +115,6 @@ IReadOnlyList extensionSites writer.WriteEndObject(); } - /// - /// Writes the resource identity portion of the manifest. - /// - /// The JSON writer to write to. - /// The resource identity to write. - private static void WriteResource(Utf8JsonWriter writer, QualifiedResourceName resource) - { - writer.WritePropertyName("resource"); - writer.WriteStartObject(); - writer.WriteString("project_name", resource.ProjectName); - writer.WriteString("resource_name", resource.ResourceName); - writer.WriteEndObject(); - } - /// /// Writes a table model entry, including key columns, columns, and constraints. /// @@ -407,259 +391,4 @@ private static string ToManifestIgnoredReason(KeyUnificationIgnoredReason reason ), }; } - - /// - /// Writes a key column entry. - /// - /// The JSON writer to write to. - /// The key column to write. - private static void WriteKeyColumn(Utf8JsonWriter writer, DbKeyColumn keyColumn) - { - writer.WriteStartObject(); - writer.WriteString("name", keyColumn.ColumnName.Value); - writer.WriteString("kind", keyColumn.Kind.ToString()); - writer.WriteEndObject(); - } - - /// - /// Writes a table column entry, including kind, scalar type, nullability, and source JSON path. - /// - /// The JSON writer to write to. - /// The column model to write. - private static void WriteColumn(Utf8JsonWriter writer, DbColumnModel column) - { - writer.WriteStartObject(); - writer.WriteString("name", column.ColumnName.Value); - writer.WriteString("kind", column.Kind.ToString()); - writer.WritePropertyName("type"); - WriteScalarType(writer, column.ScalarType); - writer.WriteBoolean("is_nullable", column.IsNullable); - writer.WritePropertyName("source_path"); - if (column.SourceJsonPath is { } sourcePath) - { - writer.WriteStringValue(sourcePath.Canonical); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("storage"); - WriteColumnStorage(writer, column.Storage); - writer.WriteEndObject(); - } - - /// - /// Writes key-unification class metadata. - /// - /// The JSON writer to write to. - /// The key-unification class to write. - private static void WriteKeyUnificationClass( - Utf8JsonWriter writer, - KeyUnificationClass keyUnificationClass - ) - { - writer.WriteStartObject(); - writer.WriteString("canonical_column", keyUnificationClass.CanonicalColumn.Value); - writer.WritePropertyName("member_path_columns"); - WriteColumnNameList(writer, keyUnificationClass.MemberPathColumns); - writer.WriteEndObject(); - } - - /// - /// Writes column storage metadata. - /// - /// The JSON writer to write to. - /// The storage metadata to write. - private static void WriteColumnStorage(Utf8JsonWriter writer, ColumnStorage storage) - { - writer.WriteStartObject(); - - switch (storage) - { - case ColumnStorage.Stored: - writer.WriteString("kind", nameof(ColumnStorage.Stored)); - break; - case ColumnStorage.UnifiedAlias unifiedAlias: - writer.WriteString("kind", nameof(ColumnStorage.UnifiedAlias)); - writer.WriteString("canonical_column", unifiedAlias.CanonicalColumn.Value); - if (unifiedAlias.PresenceColumn is { } presenceColumn) - { - writer.WriteString("presence_column", presenceColumn.Value); - } - else - { - writer.WriteNull("presence_column"); - } - break; - default: - throw new ArgumentOutOfRangeException( - nameof(storage), - storage, - "Unknown column storage type." - ); - } - - writer.WriteEndObject(); - } - - /// - /// Writes a scalar type entry, including optional max length and decimal precision/scale metadata. - /// - /// The JSON writer to write to. - /// The scalar type to write. - private static void WriteScalarType(Utf8JsonWriter writer, RelationalScalarType? scalarType) - { - if (scalarType is null) - { - writer.WriteNullValue(); - return; - } - - writer.WriteStartObject(); - writer.WriteString("kind", scalarType.Kind.ToString()); - - if (scalarType.MaxLength is not null) - { - writer.WriteNumber("max_length", scalarType.MaxLength.Value); - } - - if (scalarType.Decimal is not null) - { - writer.WriteNumber("precision", scalarType.Decimal.Value.Precision); - writer.WriteNumber("scale", scalarType.Decimal.Value.Scale); - } - - writer.WriteEndObject(); - } - - /// - /// Writes a table constraint entry, using a constraint-type specific shape. - /// - /// The JSON writer to write to. - /// The constraint to write. - private static void WriteConstraint(Utf8JsonWriter writer, TableConstraint constraint) - { - writer.WriteStartObject(); - - switch (constraint) - { - case TableConstraint.Unique unique: - writer.WriteString("kind", "Unique"); - writer.WriteString("name", unique.Name); - writer.WritePropertyName("columns"); - WriteColumnNameList(writer, unique.Columns); - break; - case TableConstraint.ForeignKey foreignKey: - writer.WriteString("kind", "ForeignKey"); - writer.WriteString("name", foreignKey.Name); - writer.WritePropertyName("columns"); - WriteColumnNameList(writer, foreignKey.Columns); - writer.WritePropertyName("target_table"); - WriteTableReference(writer, foreignKey.TargetTable); - writer.WritePropertyName("target_columns"); - WriteColumnNameList(writer, foreignKey.TargetColumns); - writer.WriteString("on_delete", foreignKey.OnDelete.ToString()); - writer.WriteString("on_update", foreignKey.OnUpdate.ToString()); - break; - case TableConstraint.AllOrNoneNullability allOrNone: - writer.WriteString("kind", "AllOrNoneNullability"); - writer.WriteString("name", allOrNone.Name); - writer.WriteString("fk_column", allOrNone.FkColumn.Value); - writer.WritePropertyName("dependent_columns"); - WriteColumnNameList(writer, allOrNone.DependentColumns); - break; - case TableConstraint.NullOrTrue nullOrTrue: - writer.WriteString("kind", "NullOrTrue"); - writer.WriteString("name", nullOrTrue.Name); - writer.WriteString("column", nullOrTrue.Column.Value); - break; - default: - throw new ArgumentOutOfRangeException( - nameof(constraint), - constraint, - "Unknown table constraint type." - ); - } - - writer.WriteEndObject(); - } - - /// - /// Writes an array of column names. - /// - /// The JSON writer to write to. - /// The column names to write. - private static void WriteColumnNameList(Utf8JsonWriter writer, IReadOnlyList columns) - { - writer.WriteStartArray(); - foreach (var column in columns) - { - writer.WriteStringValue(column.Value); - } - writer.WriteEndArray(); - } - - /// - /// Writes a descriptor edge source entry. - /// - /// The JSON writer to write to. - /// The descriptor edge source to write. - private static void WriteDescriptorEdge(Utf8JsonWriter writer, DescriptorEdgeSource edge) - { - writer.WriteStartObject(); - writer.WriteBoolean("is_identity_component", edge.IsIdentityComponent); - writer.WriteString("descriptor_value_path", edge.DescriptorValuePath.Canonical); - writer.WritePropertyName("table"); - WriteTableReference(writer, edge.Table); - writer.WriteString("fk_column", edge.FkColumn.Value); - writer.WritePropertyName("descriptor_resource"); - WriteResourceReference(writer, edge.DescriptorResource); - writer.WriteEndObject(); - } - - /// - /// Writes an extension site entry. - /// - /// The JSON writer to write to. - /// The extension site to write. - private static void WriteExtensionSite(Utf8JsonWriter writer, ExtensionSite site) - { - writer.WriteStartObject(); - writer.WriteString("owning_scope", site.OwningScope.Canonical); - writer.WriteString("extension_path", site.ExtensionPath.Canonical); - writer.WritePropertyName("project_keys"); - writer.WriteStartArray(); - foreach (var projectKey in site.ProjectKeys) - { - writer.WriteStringValue(projectKey); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - - /// - /// Writes a table reference object containing schema and name. - /// - /// The JSON writer to write to. - /// The referenced table name. - private static void WriteTableReference(Utf8JsonWriter writer, DbTableName tableName) - { - writer.WriteStartObject(); - writer.WriteString("schema", tableName.Schema.Value); - writer.WriteString("name", tableName.Name); - writer.WriteEndObject(); - } - - /// - /// Writes a resource reference object containing project name and resource name. - /// - /// The JSON writer to write to. - /// The referenced resource identity. - private static void WriteResourceReference(Utf8JsonWriter writer, QualifiedResourceName resource) - { - writer.WriteStartObject(); - writer.WriteString("project_name", resource.ProjectName); - writer.WriteString("resource_name", resource.ResourceName); - writer.WriteEndObject(); - } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelOrdering.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelOrdering.cs index a601c6a5b..cf9575a65 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelOrdering.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelOrdering.cs @@ -5,6 +5,13 @@ namespace EdFi.DataManagementService.Backend.RelationalModel.Build; +/// +/// Identifies a column's membership in a reference group for ordering purposes. +/// +/// The FK column name anchoring the group (for inter-group sort). +/// 0 = the FK itself, 1+ = identity parts in binding order. +internal readonly record struct ReferenceGroupMembership(string GroupKey, int Position); + /// /// Provides canonical ordering rules for columns and constraints within derived relational tables. /// @@ -13,10 +20,13 @@ internal static class RelationalModelOrdering /// /// Returns a copy of the table with columns and constraints ordered deterministically. /// - public static DbTableModel CanonicalizeTable(DbTableModel table) + public static DbTableModel CanonicalizeTable( + DbTableModel table, + IReadOnlyDictionary? referenceGroups = null + ) { var keyColumnOrder = BuildKeyColumnOrder(table.Key.Columns); - var orderedColumns = OrderColumns(table, keyColumnOrder); + var orderedColumns = OrderColumns(table, keyColumnOrder, referenceGroups); var orderedConstraints = table .Constraints.OrderBy(GetConstraintGroup) @@ -36,7 +46,8 @@ public static DbTableModel CanonicalizeTable(DbTableModel table) /// private static DbColumnModel[] OrderColumns( DbTableModel table, - IReadOnlyDictionary keyColumnOrder + IReadOnlyDictionary keyColumnOrder, + IReadOnlyDictionary? referenceGroups ) { Dictionary columnsByName = new(StringComparer.Ordinal); @@ -95,7 +106,9 @@ IReadOnlyDictionary keyColumnOrder ); } - SortedSet availableColumns = new(GetColumnOrderingComparer(columnsByName, keyColumnOrder)); + SortedSet availableColumns = new( + GetColumnOrderingComparer(columnsByName, keyColumnOrder, referenceGroups) + ); foreach (var columnName in columnsByName.Keys) { @@ -198,7 +211,8 @@ private static void AddAliasDependency( /// private static IComparer GetColumnOrderingComparer( IReadOnlyDictionary columnsByName, - IReadOnlyDictionary keyColumnOrder + IReadOnlyDictionary keyColumnOrder, + IReadOnlyDictionary? referenceGroups ) { return Comparer.Create( @@ -207,8 +221,8 @@ IReadOnlyDictionary keyColumnOrder var leftColumn = columnsByName[left]; var rightColumn = columnsByName[right]; - var groupComparison = GetColumnGroup(leftColumn, keyColumnOrder) - .CompareTo(GetColumnGroup(rightColumn, keyColumnOrder)); + var groupComparison = GetColumnGroup(leftColumn, keyColumnOrder, referenceGroups) + .CompareTo(GetColumnGroup(rightColumn, keyColumnOrder, referenceGroups)); if (groupComparison != 0) { @@ -223,6 +237,34 @@ IReadOnlyDictionary keyColumnOrder return keyIndexComparison; } + // Sub-sort within reference groups: order by GroupKey then Position. + if (referenceGroups is not null) + { + var leftInGroup = referenceGroups.TryGetValue(left, out var leftMembership); + var rightInGroup = referenceGroups.TryGetValue(right, out var rightMembership); + + if (leftInGroup && rightInGroup) + { + var groupKeyComparison = string.Compare( + leftMembership.GroupKey, + rightMembership.GroupKey, + StringComparison.Ordinal + ); + + if (groupKeyComparison != 0) + { + return groupKeyComparison; + } + + var positionComparison = leftMembership.Position.CompareTo(rightMembership.Position); + + if (positionComparison != 0) + { + return positionComparison; + } + } + } + return string.Compare(left, right, StringComparison.Ordinal); } ); @@ -244,20 +286,46 @@ private static Dictionary BuildKeyColumnOrder(IReadOnlyList - /// Returns a grouping value used to order columns by key columns first, then descriptor FKs, then scalars. + /// Returns a grouping value to order columns per spec: key → unification support → + /// reference groups → descriptor FK → scalar → other. /// - private static int GetColumnGroup(DbColumnModel column, IReadOnlyDictionary keyColumnOrder) + private static int GetColumnGroup( + DbColumnModel column, + IReadOnlyDictionary keyColumnOrder, + IReadOnlyDictionary? referenceGroups = null + ) { + // Group 0: Key columns if (keyColumnOrder.ContainsKey(column.ColumnName.Value)) { return 0; } + // Group 1: Unification support columns (canonical storage + presence flags). + // These are Stored columns with no SourceJsonPath — they hold the canonical unified + // value or act as presence indicators for key unification. + if (column.Storage is ColumnStorage.Stored && column.SourceJsonPath is null) + { + return 1; + } + + // Reference group members (identity-part columns) are promoted to group 2 + // so they stay adjacent to their DocumentFk column. + if (referenceGroups is not null && referenceGroups.ContainsKey(column.ColumnName.Value)) + { + return 2; + } + return column.Kind switch { - ColumnKind.DescriptorFk => 1, - ColumnKind.Scalar => 2, - _ => 3, + // Group 2: Reference groups (DocumentFk + related identity parts) + ColumnKind.DocumentFk => 2, + // Group 3: Descriptor FKs + ColumnKind.DescriptorFk => 3, + // Group 4: Scalar columns + ColumnKind.Scalar => 4, + // Group 5: Other (Ordinal, ParentKeyPart, etc.) + _ => 5, }; } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelSetBuilderContext.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelSetBuilderContext.cs index b599b7541..e2fd9a535 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelSetBuilderContext.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelSetBuilderContext.cs @@ -585,8 +585,8 @@ public DerivedRelationalModelSet BuildResult() .ToArray(); var canonicalTriggers = TriggerInventory - .OrderBy(trigger => trigger.TriggerTable.Schema.Value, StringComparer.Ordinal) - .ThenBy(trigger => trigger.TriggerTable.Name, StringComparer.Ordinal) + .OrderBy(trigger => trigger.Table.Schema.Value, StringComparer.Ordinal) + .ThenBy(trigger => trigger.Table.Name, StringComparer.Ordinal) .ThenBy(trigger => trigger.Name.Value, StringComparer.Ordinal) .ToArray(); @@ -790,12 +790,12 @@ private NamedObjectKey BuildIndexUniquenessKey(DbIndexInfo index) /// private NamedObjectKey BuildTriggerUniquenessKey(DbTriggerInfo trigger) { - var schema = trigger.TriggerTable.Schema.Value; + var schema = trigger.Table.Schema.Value; var name = trigger.Name.Value; return Dialect switch { - SqlDialect.Pgsql => NamedObjectKey.ForTable(schema, trigger.TriggerTable.Name, name), + SqlDialect.Pgsql => NamedObjectKey.ForTable(schema, trigger.Table.Name, name), SqlDialect.Mssql => NamedObjectKey.ForSchema(schema, name), _ => NamedObjectKey.ForSchema(schema, name), }; @@ -1014,7 +1014,7 @@ private static string FormatExtensionSiteContext( QualifiedResourceName? resource ) { - List contextParts = new(); + List contextParts = []; if (resource is { } resourceValue) { diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintDerivationHelpers.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintDerivationHelpers.cs index 7ef954355..e8f72ccce 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintDerivationHelpers.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintDerivationHelpers.cs @@ -130,6 +130,12 @@ QualifiedResourceName resource /// Builds a lookup from source JSONPath canonical string to physical column name, throwing when a single /// source path maps to multiple column kinds. /// + /// + /// Same-kind duplicates (multiple columns with the same SourceJsonPath and same ColumnKind) are expected + /// and intentional — they arise from key unification, where a canonical column and its unified alias(es) + /// share the same source JSON path. The first column in alphabetical order wins, which is the canonical + /// stored column. + /// internal static IReadOnlyDictionary BuildColumnNameLookupBySourceJsonPath( DbTableModel table, QualifiedResourceName resource @@ -194,7 +200,7 @@ ResourceMutation mutation var updatedTables = resourceModel .TablesInDependencyOrder.Select(table => mutation.BuildTable(table)) .ToArray(); - var updatedRoot = updatedTables.Single(table => table.Table.Equals(resourceModel.Root.Table)); + var updatedRoot = updatedTables.Single(table => table.JsonScope.Equals(resourceModel.Root.JsonScope)); return resourceModel with { diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintNaming.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintNaming.cs index 35d87cabc..2678f187b 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintNaming.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Constraints/ConstraintNaming.cs @@ -53,6 +53,17 @@ internal static string BuildPrimaryKeyName(DbTableName table) return BuildName("PK", table, []); } + /// + /// Resolves the primary key constraint name, falling back to the conventional default when unset. + /// Shared by DDL emission, index inventory derivation, and identifier shortening. + /// + internal static string ResolvePrimaryKeyConstraintName(DbTableName table, TableKey key) + { + return string.IsNullOrWhiteSpace(key.ConstraintName) + ? BuildPrimaryKeyName(table) + : key.ConstraintName; + } + /// /// Builds a foreign key constraint name using the supplied tokens. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/EdFi.DataManagementService.Backend.RelationalModel.csproj b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/EdFi.DataManagementService.Backend.RelationalModel.csproj index cd0900cb2..c20d7ee83 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/EdFi.DataManagementService.Backend.RelationalModel.csproj +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/EdFi.DataManagementService.Backend.RelationalModel.csproj @@ -1,11 +1,11 @@ - - net10.0 - enable - enable - true - - - - + + net10.0 + enable + enable + true + + + + diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/DerivedModelSetManifestEmitter.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/DerivedModelSetManifestEmitter.cs index 52079c0f3..1d1d53dfe 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/DerivedModelSetManifestEmitter.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/DerivedModelSetManifestEmitter.cs @@ -7,6 +7,7 @@ using System.Text; using System.Text.Json; using EdFi.DataManagementService.Backend.External; +using static EdFi.DataManagementService.Backend.RelationalModel.Manifest.ManifestWriterHelpers; namespace EdFi.DataManagementService.Backend.RelationalModel.Manifest; @@ -310,23 +311,89 @@ private static void WriteTriggers(Utf8JsonWriter writer, IReadOnlyList "DocumentStamping", + TriggerKindParameters.ReferentialIdentityMaintenance => "ReferentialIdentityMaintenance", + TriggerKindParameters.AbstractIdentityMaintenance => "AbstractIdentityMaintenance", + TriggerKindParameters.IdentityPropagationFallback => "IdentityPropagationFallback", + _ => throw new ArgumentOutOfRangeException( + nameof(trigger), + "Unsupported trigger kind parameters type." + ), + } + ); writer.WritePropertyName("key_columns"); WriteColumnNameList(writer, trigger.KeyColumns); writer.WritePropertyName("identity_projection_columns"); WriteColumnNameList(writer, trigger.IdentityProjectionColumns); - if (trigger.MaintenanceTargetTable is { } maintenanceTargetTable) - { - writer.WritePropertyName("target_table"); - WriteTableReference(writer, maintenanceTargetTable); - } - - if (trigger.PropagationFallback is { } propagationFallback) + switch (trigger.Parameters) { - writer.WritePropertyName("propagation_fallback"); - WritePropagationFallback(writer, propagationFallback); + case TriggerKindParameters.AbstractIdentityMaintenance abstractId: + writer.WritePropertyName("target_table"); + WriteTableReference(writer, abstractId.TargetTable); + WriteTargetColumnMappings(writer, abstractId.TargetColumnMappings); + writer.WriteString("discriminator_value", abstractId.DiscriminatorValue); + break; + + case TriggerKindParameters.IdentityPropagationFallback propagation: + writer.WritePropertyName("referrer_updates"); + writer.WriteStartArray(); + foreach (var referrer in propagation.ReferrerUpdates) + { + writer.WriteStartObject(); + writer.WritePropertyName("referrer_table"); + WriteTableReference(writer, referrer.ReferrerTable); + writer.WriteString("referrer_fk_column", referrer.ReferrerFkColumn.Value); + WriteTargetColumnMappings(writer, referrer.ColumnMappings); + writer.WriteEndObject(); + } + writer.WriteEndArray(); + break; + + case TriggerKindParameters.ReferentialIdentityMaintenance refId: + writer.WriteNumber("resource_key_id", refId.ResourceKeyId); + writer.WriteString("project_name", refId.ProjectName); + writer.WriteString("resource_name", refId.ResourceName); + writer.WritePropertyName("identity_elements"); + writer.WriteStartArray(); + foreach (var element in refId.IdentityElements) + { + writer.WriteStartObject(); + writer.WriteString("column", element.Column.Value); + writer.WriteString("identity_json_path", element.IdentityJsonPath); + writer.WriteEndObject(); + } + writer.WriteEndArray(); + + if (refId.SuperclassAlias is { } alias) + { + writer.WritePropertyName("superclass_alias"); + writer.WriteStartObject(); + writer.WriteNumber("resource_key_id", alias.ResourceKeyId); + writer.WriteString("project_name", alias.ProjectName); + writer.WriteString("resource_name", alias.ResourceName); + writer.WritePropertyName("identity_elements"); + writer.WriteStartArray(); + foreach (var element in alias.IdentityElements) + { + writer.WriteStartObject(); + writer.WriteString("column", element.Column.Value); + writer.WriteString("identity_json_path", element.IdentityJsonPath); + writer.WriteEndObject(); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + break; + + case TriggerKindParameters.DocumentStamping: + // DocumentStamping has no additional properties + break; } writer.WriteEndObject(); @@ -335,6 +402,26 @@ private static void WriteTriggers(Utf8JsonWriter writer, IReadOnlyList + /// Writes a target_column_mappings array of source/target column pairs. + /// + private static void WriteTargetColumnMappings( + Utf8JsonWriter writer, + IReadOnlyList mappings + ) + { + writer.WritePropertyName("target_column_mappings"); + writer.WriteStartArray(); + foreach (var mapping in mappings) + { + writer.WriteStartObject(); + writer.WriteString("source_column", mapping.SourceColumn.Value); + writer.WriteString("target_column", mapping.TargetColumn.Value); + writer.WriteEndObject(); + } + writer.WriteEndArray(); + } + /// /// Writes the optional resource_details array for the requested resources. /// @@ -416,18 +503,6 @@ IReadOnlyList extensionSites writer.WriteEndObject(); } - /// - /// Writes a resource property containing project and resource name. - /// - private static void WriteResource(Utf8JsonWriter writer, QualifiedResourceName resource) - { - writer.WritePropertyName("resource"); - writer.WriteStartObject(); - writer.WriteString("project_name", resource.ProjectName); - writer.WriteString("resource_name", resource.ResourceName); - writer.WriteEndObject(); - } - /// /// Writes a table object with its key columns, columns, and constraints. /// @@ -473,226 +548,6 @@ private static void WriteTable(Utf8JsonWriter writer, DbTableModel table) writer.WriteEndObject(); } - /// - /// Writes a single key column object. - /// - private static void WriteKeyColumn(Utf8JsonWriter writer, DbKeyColumn keyColumn) - { - writer.WriteStartObject(); - writer.WriteString("name", keyColumn.ColumnName.Value); - writer.WriteString("kind", keyColumn.Kind.ToString()); - writer.WriteEndObject(); - } - - /// - /// Writes a single column object with its type and source path. - /// - private static void WriteColumn(Utf8JsonWriter writer, DbColumnModel column) - { - writer.WriteStartObject(); - writer.WriteString("name", column.ColumnName.Value); - writer.WriteString("kind", column.Kind.ToString()); - writer.WritePropertyName("type"); - WriteScalarType(writer, column.ScalarType); - writer.WriteBoolean("is_nullable", column.IsNullable); - writer.WritePropertyName("source_path"); - if (column.SourceJsonPath is { } sourcePath) - { - writer.WriteStringValue(sourcePath.Canonical); - } - else - { - writer.WriteNullValue(); - } - - writer.WritePropertyName("storage"); - WriteColumnStorage(writer, column.Storage); - - writer.WriteEndObject(); - } - - /// - /// Writes a key unification class entry. - /// - private static void WriteKeyUnificationClass( - Utf8JsonWriter writer, - KeyUnificationClass keyUnificationClass - ) - { - writer.WriteStartObject(); - writer.WriteString("canonical_column", keyUnificationClass.CanonicalColumn.Value); - writer.WritePropertyName("member_path_columns"); - WriteColumnNameList(writer, keyUnificationClass.MemberPathColumns); - writer.WriteEndObject(); - } - - /// - /// Writes column storage metadata. - /// - private static void WriteColumnStorage(Utf8JsonWriter writer, ColumnStorage storage) - { - writer.WriteStartObject(); - - switch (storage) - { - case ColumnStorage.Stored: - writer.WriteString("kind", nameof(ColumnStorage.Stored)); - break; - case ColumnStorage.UnifiedAlias unifiedAlias: - writer.WriteString("kind", nameof(ColumnStorage.UnifiedAlias)); - writer.WriteString("canonical_column", unifiedAlias.CanonicalColumn.Value); - - if (unifiedAlias.PresenceColumn is { } presenceColumn) - { - writer.WriteString("presence_column", presenceColumn.Value); - } - else - { - writer.WriteNull("presence_column"); - } - break; - default: - throw new ArgumentOutOfRangeException( - nameof(storage), - storage, - "Unknown column storage type." - ); - } - - writer.WriteEndObject(); - } - - /// - /// Writes a scalar type object or null value. - /// - private static void WriteScalarType(Utf8JsonWriter writer, RelationalScalarType? scalarType) - { - if (scalarType is null) - { - writer.WriteNullValue(); - return; - } - - writer.WriteStartObject(); - writer.WriteString("kind", scalarType.Kind.ToString()); - - if (scalarType.MaxLength is not null) - { - writer.WriteNumber("max_length", scalarType.MaxLength.Value); - } - - if (scalarType.Decimal is not null) - { - writer.WriteNumber("precision", scalarType.Decimal.Value.Precision); - writer.WriteNumber("scale", scalarType.Decimal.Value.Scale); - } - - writer.WriteEndObject(); - } - - /// - /// Writes a single table constraint (Unique, ForeignKey, AllOrNoneNullability, or NullOrTrue). - /// - private static void WriteConstraint(Utf8JsonWriter writer, TableConstraint constraint) - { - writer.WriteStartObject(); - - switch (constraint) - { - case TableConstraint.Unique unique: - writer.WriteString("kind", "Unique"); - writer.WriteString("name", unique.Name); - writer.WritePropertyName("columns"); - WriteColumnNameList(writer, unique.Columns); - break; - case TableConstraint.ForeignKey foreignKey: - writer.WriteString("kind", "ForeignKey"); - writer.WriteString("name", foreignKey.Name); - writer.WritePropertyName("columns"); - WriteColumnNameList(writer, foreignKey.Columns); - writer.WritePropertyName("target_table"); - WriteTableReference(writer, foreignKey.TargetTable); - writer.WritePropertyName("target_columns"); - WriteColumnNameList(writer, foreignKey.TargetColumns); - writer.WriteString("on_delete", foreignKey.OnDelete.ToString()); - writer.WriteString("on_update", foreignKey.OnUpdate.ToString()); - break; - case TableConstraint.AllOrNoneNullability allOrNone: - writer.WriteString("kind", "AllOrNoneNullability"); - writer.WriteString("name", allOrNone.Name); - writer.WriteString("fk_column", allOrNone.FkColumn.Value); - writer.WritePropertyName("dependent_columns"); - WriteColumnNameList(writer, allOrNone.DependentColumns); - break; - case TableConstraint.NullOrTrue nullOrTrue: - writer.WriteString("kind", "NullOrTrue"); - writer.WriteString("name", nullOrTrue.Name); - writer.WriteString("column", nullOrTrue.Column.Value); - break; - default: - throw new ArgumentOutOfRangeException( - nameof(constraint), - constraint, - "Unknown table constraint type." - ); - } - - writer.WriteEndObject(); - } - - /// - /// Writes an array of column name strings. - /// - private static void WriteColumnNameList(Utf8JsonWriter writer, IReadOnlyList columns) - { - writer.WriteStartArray(); - foreach (var column in columns) - { - writer.WriteStringValue(column.Value); - } - writer.WriteEndArray(); - } - - /// - /// Writes identity-propagation fallback payload details. - /// - private static void WritePropagationFallback( - Utf8JsonWriter writer, - DbIdentityPropagationFallbackInfo propagationFallback - ) - { - writer.WriteStartObject(); - writer.WritePropertyName("referrer_actions"); - writer.WriteStartArray(); - - foreach (var referrerAction in propagationFallback.ReferrerActions) - { - writer.WriteStartObject(); - writer.WritePropertyName("referrer_table"); - WriteTableReference(writer, referrerAction.ReferrerTable); - writer.WriteString("referrer_document_id_column", referrerAction.ReferrerDocumentIdColumn.Value); - writer.WriteString( - "referenced_document_id_column", - referrerAction.ReferencedDocumentIdColumn.Value - ); - - writer.WritePropertyName("identity_column_pairs"); - writer.WriteStartArray(); - foreach (var columnPair in referrerAction.IdentityColumnPairs) - { - writer.WriteStartObject(); - writer.WriteString("referrer_storage_column", columnPair.ReferrerStorageColumn.Value); - writer.WriteString("referenced_storage_column", columnPair.ReferencedStorageColumn.Value); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteEndObject(); - } - /// /// Writes a single document reference binding with its identity bindings. /// @@ -729,60 +584,4 @@ ReferenceIdentityBinding identityBinding writer.WriteString("column", identityBinding.Column.Value); writer.WriteEndObject(); } - - /// - /// Writes a single descriptor edge source. - /// - private static void WriteDescriptorEdge(Utf8JsonWriter writer, DescriptorEdgeSource edge) - { - writer.WriteStartObject(); - writer.WriteBoolean("is_identity_component", edge.IsIdentityComponent); - writer.WriteString("descriptor_value_path", edge.DescriptorValuePath.Canonical); - writer.WritePropertyName("table"); - WriteTableReference(writer, edge.Table); - writer.WriteString("fk_column", edge.FkColumn.Value); - writer.WritePropertyName("descriptor_resource"); - WriteResourceReference(writer, edge.DescriptorResource); - writer.WriteEndObject(); - } - - /// - /// Writes a single extension site with its project keys. - /// - private static void WriteExtensionSite(Utf8JsonWriter writer, ExtensionSite site) - { - writer.WriteStartObject(); - writer.WriteString("owning_scope", site.OwningScope.Canonical); - writer.WriteString("extension_path", site.ExtensionPath.Canonical); - writer.WritePropertyName("project_keys"); - writer.WriteStartArray(); - foreach (var projectKey in site.ProjectKeys) - { - writer.WriteStringValue(projectKey); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - - /// - /// Writes a table reference object with schema and name. - /// - private static void WriteTableReference(Utf8JsonWriter writer, DbTableName tableName) - { - writer.WriteStartObject(); - writer.WriteString("schema", tableName.Schema.Value); - writer.WriteString("name", tableName.Name); - writer.WriteEndObject(); - } - - /// - /// Writes a resource reference object with project and resource name. - /// - private static void WriteResourceReference(Utf8JsonWriter writer, QualifiedResourceName resource) - { - writer.WriteStartObject(); - writer.WriteString("project_name", resource.ProjectName); - writer.WriteString("resource_name", resource.ResourceName); - writer.WriteEndObject(); - } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/ManifestWriterHelpers.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/ManifestWriterHelpers.cs new file mode 100644 index 000000000..2eddbe279 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Manifest/ManifestWriterHelpers.cs @@ -0,0 +1,262 @@ +// SPDX-License-Identifier: Apache-2.0 +// Licensed to the Ed-Fi Alliance under one or more agreements. +// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +// See the LICENSE and NOTICES files in the project root for more information. + +using System.Text.Json; + +namespace EdFi.DataManagementService.Backend.RelationalModel.Manifest; + +/// +/// Shared JSON manifest writing helpers used by both +/// and . +/// +internal static class ManifestWriterHelpers +{ + /// + /// Writes a key column entry. + /// + internal static void WriteKeyColumn(Utf8JsonWriter writer, DbKeyColumn keyColumn) + { + writer.WriteStartObject(); + writer.WriteString("name", keyColumn.ColumnName.Value); + writer.WriteString("kind", keyColumn.Kind.ToString()); + writer.WriteEndObject(); + } + + /// + /// Writes a table column entry, including kind, scalar type, nullability, and source JSON path. + /// + internal static void WriteColumn(Utf8JsonWriter writer, DbColumnModel column) + { + writer.WriteStartObject(); + writer.WriteString("name", column.ColumnName.Value); + writer.WriteString("kind", column.Kind.ToString()); + writer.WritePropertyName("type"); + WriteScalarType(writer, column.ScalarType); + writer.WriteBoolean("is_nullable", column.IsNullable); + writer.WritePropertyName("source_path"); + if (column.SourceJsonPath is { } sourcePath) + { + writer.WriteStringValue(sourcePath.Canonical); + } + else + { + writer.WriteNullValue(); + } + writer.WritePropertyName("storage"); + WriteColumnStorage(writer, column.Storage); + writer.WriteEndObject(); + } + + /// + /// Writes key-unification class metadata. + /// + internal static void WriteKeyUnificationClass( + Utf8JsonWriter writer, + KeyUnificationClass keyUnificationClass + ) + { + writer.WriteStartObject(); + writer.WriteString("canonical_column", keyUnificationClass.CanonicalColumn.Value); + writer.WritePropertyName("member_path_columns"); + WriteColumnNameList(writer, keyUnificationClass.MemberPathColumns); + writer.WriteEndObject(); + } + + /// + /// Writes column storage metadata. + /// + internal static void WriteColumnStorage(Utf8JsonWriter writer, ColumnStorage storage) + { + ArgumentNullException.ThrowIfNull(storage); + + writer.WriteStartObject(); + + switch (storage) + { + case ColumnStorage.Stored: + writer.WriteString("kind", nameof(ColumnStorage.Stored)); + break; + case ColumnStorage.UnifiedAlias unifiedAlias: + writer.WriteString("kind", nameof(ColumnStorage.UnifiedAlias)); + writer.WriteString("canonical_column", unifiedAlias.CanonicalColumn.Value); + if (unifiedAlias.PresenceColumn is { } presenceColumn) + { + writer.WriteString("presence_column", presenceColumn.Value); + } + else + { + writer.WriteNull("presence_column"); + } + break; + default: + throw new ArgumentOutOfRangeException( + nameof(storage), + storage, + "Unknown column storage type." + ); + } + + writer.WriteEndObject(); + } + + /// + /// Writes a scalar type entry, including optional max length and decimal precision/scale metadata. + /// + internal static void WriteScalarType(Utf8JsonWriter writer, RelationalScalarType? scalarType) + { + if (scalarType is null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + writer.WriteString("kind", scalarType.Kind.ToString()); + + if (scalarType.MaxLength is not null) + { + writer.WriteNumber("max_length", scalarType.MaxLength.Value); + } + + if (scalarType.Decimal is not null) + { + writer.WriteNumber("precision", scalarType.Decimal.Value.Precision); + writer.WriteNumber("scale", scalarType.Decimal.Value.Scale); + } + + writer.WriteEndObject(); + } + + /// + /// Writes a table constraint entry, using a constraint-type specific shape. + /// + internal static void WriteConstraint(Utf8JsonWriter writer, TableConstraint constraint) + { + writer.WriteStartObject(); + + switch (constraint) + { + case TableConstraint.Unique unique: + writer.WriteString("kind", "Unique"); + writer.WriteString("name", unique.Name); + writer.WritePropertyName("columns"); + WriteColumnNameList(writer, unique.Columns); + break; + case TableConstraint.ForeignKey foreignKey: + writer.WriteString("kind", "ForeignKey"); + writer.WriteString("name", foreignKey.Name); + writer.WritePropertyName("columns"); + WriteColumnNameList(writer, foreignKey.Columns); + writer.WritePropertyName("target_table"); + WriteTableReference(writer, foreignKey.TargetTable); + writer.WritePropertyName("target_columns"); + WriteColumnNameList(writer, foreignKey.TargetColumns); + writer.WriteString("on_delete", foreignKey.OnDelete.ToString()); + writer.WriteString("on_update", foreignKey.OnUpdate.ToString()); + break; + case TableConstraint.AllOrNoneNullability allOrNone: + writer.WriteString("kind", "AllOrNoneNullability"); + writer.WriteString("name", allOrNone.Name); + writer.WriteString("fk_column", allOrNone.FkColumn.Value); + writer.WritePropertyName("dependent_columns"); + WriteColumnNameList(writer, allOrNone.DependentColumns); + break; + case TableConstraint.NullOrTrue nullOrTrue: + writer.WriteString("kind", "NullOrTrue"); + writer.WriteString("name", nullOrTrue.Name); + writer.WriteString("column", nullOrTrue.Column.Value); + break; + default: + throw new ArgumentOutOfRangeException( + nameof(constraint), + constraint, + "Unknown table constraint type." + ); + } + + writer.WriteEndObject(); + } + + /// + /// Writes an array of column names. + /// + internal static void WriteColumnNameList(Utf8JsonWriter writer, IReadOnlyList columns) + { + writer.WriteStartArray(); + foreach (var column in columns) + { + writer.WriteStringValue(column.Value); + } + writer.WriteEndArray(); + } + + /// + /// Writes a descriptor edge source entry. + /// + internal static void WriteDescriptorEdge(Utf8JsonWriter writer, DescriptorEdgeSource edge) + { + writer.WriteStartObject(); + writer.WriteBoolean("is_identity_component", edge.IsIdentityComponent); + writer.WriteString("descriptor_value_path", edge.DescriptorValuePath.Canonical); + writer.WritePropertyName("table"); + WriteTableReference(writer, edge.Table); + writer.WriteString("fk_column", edge.FkColumn.Value); + writer.WritePropertyName("descriptor_resource"); + WriteResourceReference(writer, edge.DescriptorResource); + writer.WriteEndObject(); + } + + /// + /// Writes an extension site entry. + /// + internal static void WriteExtensionSite(Utf8JsonWriter writer, ExtensionSite site) + { + writer.WriteStartObject(); + writer.WriteString("owning_scope", site.OwningScope.Canonical); + writer.WriteString("extension_path", site.ExtensionPath.Canonical); + writer.WritePropertyName("project_keys"); + writer.WriteStartArray(); + foreach (var projectKey in site.ProjectKeys) + { + writer.WriteStringValue(projectKey); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + /// + /// Writes a table reference object containing schema and name. + /// + internal static void WriteTableReference(Utf8JsonWriter writer, DbTableName tableName) + { + writer.WriteStartObject(); + writer.WriteString("schema", tableName.Schema.Value); + writer.WriteString("name", tableName.Name); + writer.WriteEndObject(); + } + + /// + /// Writes a resource reference object containing project name and resource name. + /// + internal static void WriteResourceReference(Utf8JsonWriter writer, QualifiedResourceName resource) + { + writer.WriteStartObject(); + writer.WriteString("project_name", resource.ProjectName); + writer.WriteString("resource_name", resource.ResourceName); + writer.WriteEndObject(); + } + + /// + /// Writes the resource identity portion of the manifest as a named property. + /// + internal static void WriteResource(Utf8JsonWriter writer, QualifiedResourceName resource) + { + writer.WritePropertyName("resource"); + writer.WriteStartObject(); + writer.WriteString("project_name", resource.ProjectName); + writer.WriteString("resource_name", resource.ResourceName); + writer.WriteEndObject(); + } +} diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/AbstractIdentityTableAndUnionViewDerivationPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/AbstractIdentityTableAndUnionViewDerivationPass.cs index 270a967de..80c2c2730 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/AbstractIdentityTableAndUnionViewDerivationPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/AbstractIdentityTableAndUnionViewDerivationPass.cs @@ -68,8 +68,6 @@ var abstractEntry in OrderResourceSchemas( ); } - ThrowIfDuplicateMemberResourceNames(members, abstractResource); - var identityDerivations = BuildIdentityColumnDerivations( identityJsonPaths, abstractResource, @@ -220,6 +218,7 @@ IReadOnlyDictionary concreteModels (IReadOnlyList) pair .Value.OrderBy(metadata => metadata.Resource.ResourceName, StringComparer.Ordinal) + .ThenBy(metadata => metadata.Resource.ProjectName, StringComparer.Ordinal) .ToArray() ); } @@ -484,15 +483,6 @@ QualifiedResourceName abstractResource var canonicalScale = Math.Max(currentDecimal.Scale, memberDecimal.Scale); var canonicalPrecision = canonicalIntegerDigits + canonicalScale; - if (canonicalScale > canonicalPrecision) - { - throw new InvalidOperationException( - $"Canonical decimal type is invalid for abstract identity path '{identityPath.Canonical}' on " - + $"resource '{FormatResource(abstractResource)}'. Precision {canonicalPrecision} must be " - + $"greater than or equal to scale {canonicalScale}." - ); - } - return new RelationalScalarType(ScalarKind.Decimal, Decimal: (canonicalPrecision, canonicalScale)); } @@ -565,7 +555,7 @@ IReadOnlyList identityDerivations } /// - /// Builds deterministic union-view arms ordered by member ResourceName using ordinal comparison. + /// Builds deterministic union-view arms ordered by member (ResourceName, ProjectName) using ordinal comparison. /// private static IReadOnlyList BuildUnionArms( IReadOnlyList identityDerivations, @@ -598,9 +588,21 @@ RelationalModelSetBuilderContext context foreach (var derivation in identityDerivations) { + var sourceColumnName = derivation.MemberSourceColumnsInMemberOrder[memberIndex]; + + // Look up the source column's scalar type from the concrete member table + // so the emitter can emit an explicit CAST when it differs from the canonical type. + var sourceColumnModel = + member.Model.Root.Columns.FirstOrDefault(c => c.ColumnName == sourceColumnName) + ?? throw new InvalidOperationException( + $"Column '{sourceColumnName}' not found in root table of member " + + $"'{FormatResource(member.Resource)}' during abstract union view derivation." + ); + projections.Add( new AbstractUnionViewProjectionExpression.SourceColumn( - derivation.MemberSourceColumnsInMemberOrder[memberIndex] + sourceColumnName, + sourceColumnModel.ScalarType ) ); } @@ -619,46 +621,6 @@ RelationalModelSetBuilderContext context return arms; } - /// - /// Fails fast when multiple concrete members of the same abstract resource share a ResourceName - /// across different projects. - /// - private static void ThrowIfDuplicateMemberResourceNames( - IReadOnlyList members, - QualifiedResourceName abstractResource - ) - { - var duplicates = members - .GroupBy(member => member.Resource.ResourceName, StringComparer.Ordinal) - .Where(group => group.Count() > 1) - .OrderBy(group => group.Key, StringComparer.Ordinal) - .ToArray(); - - if (duplicates.Length == 0) - { - return; - } - - var details = string.Join( - "; ", - duplicates.Select(group => - { - var membersWithName = string.Join( - ", ", - group - .Select(member => FormatResource(member.Resource)) - .OrderBy(label => label, StringComparer.Ordinal) - ); - return $"'{group.Key}' ({membersWithName})"; - }) - ); - - throw new InvalidOperationException( - $"Abstract resource '{FormatResource(abstractResource)}' has duplicate member " - + $"ResourceName values across projects: {details}." - ); - } - /// /// Maps an abstract identity path to the corresponding identity path on a concrete member, honoring /// superclassIdentityJsonPath when present. @@ -671,6 +633,13 @@ QualifiedResourceName abstractResource { if (member.SuperclassIdentityJsonPath is not null) { + if (member.IdentityJsonPaths.Count != 1) + { + throw new InvalidOperationException( + $"Member '{FormatResource(member.Resource)}' has SuperclassIdentityJsonPath set " + + $"but {member.IdentityJsonPaths.Count} identity paths (expected exactly 1)." + ); + } return member.IdentityJsonPaths[0]; } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ApplyDialectIdentifierShorteningPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ApplyDialectIdentifierShorteningPass.cs index ef188539b..a072e0eb0 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ApplyDialectIdentifierShorteningPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ApplyDialectIdentifierShorteningPass.cs @@ -33,69 +33,76 @@ ISqlDialectRules dialectRules { UpdateProjectSchemas(context, dialectRules); - for (var index = 0; index < context.ConcreteResourcesInNameOrder.Count; index++) - { - var entry = context.ConcreteResourcesInNameOrder[index]; - var updatedModel = ApplyToResource(entry.RelationalModel, dialectRules, out var changed); - - if (!changed) + ApplyInPlace( + context.ConcreteResourcesInNameOrder, + (entry, rules) => { - continue; - } - - context.ConcreteResourcesInNameOrder[index] = entry with { RelationalModel = updatedModel }; - } - - for (var index = 0; index < context.AbstractIdentityTablesInNameOrder.Count; index++) - { - var entry = context.AbstractIdentityTablesInNameOrder[index]; - var updatedTable = ApplyToTable(entry.TableModel, dialectRules, out var changed); + var updated = ApplyToResource(entry.RelationalModel, rules, out var changed); + return changed ? entry with { RelationalModel = updated } : null; + }, + dialectRules + ); - if (!changed) + ApplyInPlace( + context.AbstractIdentityTablesInNameOrder, + (entry, rules) => { - continue; - } - - context.AbstractIdentityTablesInNameOrder[index] = entry with { TableModel = updatedTable }; - } - - for (var index = 0; index < context.AbstractUnionViewsInNameOrder.Count; index++) - { - var entry = context.AbstractUnionViewsInNameOrder[index]; - var updatedView = ApplyToUnionView(entry, dialectRules, out var changed); + var updated = ApplyToTable(entry.TableModel, rules, out var changed); + return changed ? entry with { TableModel = updated } : null; + }, + dialectRules + ); - if (!changed) + ApplyInPlace( + context.AbstractUnionViewsInNameOrder, + (entry, rules) => { - continue; - } - - context.AbstractUnionViewsInNameOrder[index] = updatedView; - } - - for (var index = 0; index < context.IndexInventory.Count; index++) - { - var entry = context.IndexInventory[index]; - var updatedIndex = ApplyToIndex(entry, dialectRules, out var changed); + var updated = ApplyToUnionView(entry, rules, out var changed); + return changed ? updated : null; + }, + dialectRules + ); - if (!changed) + ApplyInPlace( + context.IndexInventory, + (entry, rules) => { - continue; - } + var updated = ApplyToIndex(entry, rules, out var changed); + return changed ? updated : null; + }, + dialectRules + ); - context.IndexInventory[index] = updatedIndex; - } + ApplyInPlace( + context.TriggerInventory, + (entry, rules) => + { + var updated = ApplyToTrigger(entry, rules, out var changed); + return changed ? updated : null; + }, + dialectRules + ); + } - for (var index = 0; index < context.TriggerInventory.Count; index++) + /// + /// Applies a transformation to each element of a list in-place, replacing only + /// those elements for which the transform returns a non-null result. + /// + private static void ApplyInPlace( + IList list, + Func transform, + ISqlDialectRules dialectRules + ) + where T : class + { + for (var index = 0; index < list.Count; index++) { - var entry = context.TriggerInventory[index]; - var updatedTrigger = ApplyToTrigger(entry, dialectRules, out var changed); + var updated = transform(list[index], dialectRules); - if (!changed) + if (updated is not null) { - continue; + list[index] = updated; } - - context.TriggerInventory[index] = updatedTrigger; } } @@ -325,9 +332,7 @@ out bool changed ) { changed = false; - var keyName = string.IsNullOrWhiteSpace(key.ConstraintName) - ? ConstraintNaming.BuildPrimaryKeyName(table) - : key.ConstraintName; + var keyName = ConstraintNaming.ResolvePrimaryKeyConstraintName(table, key); var updatedConstraintName = dialectRules.ShortenIdentifier(keyName); if (!string.Equals(updatedConstraintName, key.ConstraintName, StringComparison.Ordinal)) @@ -1102,31 +1107,24 @@ out bool changed ) { var updatedName = new DbTriggerName(dialectRules.ShortenIdentifier(trigger.Name.Value)); - var updatedTriggerTable = ShortenTable(trigger.TriggerTable, dialectRules); + var updatedTable = ShortenTable(trigger.Table, dialectRules); var updatedColumns = ShortenColumns(trigger.KeyColumns, dialectRules, out var columnsChanged); var updatedIdentityColumns = ShortenColumns( trigger.IdentityProjectionColumns, dialectRules, out var identityColumnsChanged ); - var updatedMaintenanceTargetTable = trigger.MaintenanceTargetTable is { } target - ? ShortenTable(target, dialectRules) - : trigger.MaintenanceTargetTable; - var maintenanceTargetChanged = - updatedMaintenanceTargetTable is not null - && trigger.MaintenanceTargetTable is not null - && !updatedMaintenanceTargetTable.Value.Equals(trigger.MaintenanceTargetTable.Value); - var propagationChanged = false; - var updatedPropagationFallback = trigger.PropagationFallback is { } fallback - ? ApplyToPropagationFallback(fallback, dialectRules, out propagationChanged) - : trigger.PropagationFallback; + var updatedParameters = ApplyToTriggerParameters( + trigger.Parameters, + dialectRules, + out var parametersChanged + ); changed = columnsChanged || identityColumnsChanged - || maintenanceTargetChanged - || propagationChanged - || !updatedTriggerTable.Equals(trigger.TriggerTable) + || parametersChanged + || !updatedTable.Equals(trigger.Table) || !updatedName.Equals(trigger.Name); if (!changed) @@ -1137,99 +1135,202 @@ updatedMaintenanceTargetTable is not null return trigger with { Name = updatedName, - TriggerTable = updatedTriggerTable, + Table = updatedTable, KeyColumns = updatedColumns, IdentityProjectionColumns = updatedIdentityColumns, - MaintenanceTargetTable = updatedMaintenanceTargetTable, - PropagationFallback = updatedPropagationFallback, + Parameters = updatedParameters, }; } /// - /// Applies dialect shortening to identity-propagation fallback payload and reports whether it changed. + /// Applies dialect shortening to trigger-kind-specific parameters and reports whether they changed. /// - private static DbIdentityPropagationFallbackInfo ApplyToPropagationFallback( - DbIdentityPropagationFallbackInfo fallback, + private static TriggerKindParameters ApplyToTriggerParameters( + TriggerKindParameters parameters, + ISqlDialectRules dialectRules, + out bool changed + ) + { + switch (parameters) + { + case TriggerKindParameters.ReferentialIdentityMaintenance refId: + { + var updatedElements = ShortenIdentityElementMappings( + refId.IdentityElements, + dialectRules, + out var elementsChanged + ); + var updatedAlias = ShortenSuperclassAlias( + refId.SuperclassAlias, + dialectRules, + out var aliasChanged + ); + changed = elementsChanged || aliasChanged; + return changed + ? refId with + { + IdentityElements = updatedElements, + SuperclassAlias = updatedAlias, + } + : parameters; + } + case TriggerKindParameters.AbstractIdentityMaintenance abstractId: + { + var updatedTargetTable = ShortenTable(abstractId.TargetTable, dialectRules); + var updatedMappings = ShortenTriggerColumnMappings( + abstractId.TargetColumnMappings, + dialectRules, + out var mappingsChanged + ); + changed = mappingsChanged || !updatedTargetTable.Equals(abstractId.TargetTable); + return changed + ? abstractId with + { + TargetTable = updatedTargetTable, + TargetColumnMappings = updatedMappings, + } + : parameters; + } + case TriggerKindParameters.IdentityPropagationFallback propagation: + { + var updatedReferrers = ShortenPropagationReferrerTargets( + propagation.ReferrerUpdates, + dialectRules, + out var referrersChanged + ); + changed = referrersChanged; + return changed ? propagation with { ReferrerUpdates = updatedReferrers } : parameters; + } + case TriggerKindParameters.DocumentStamping: + changed = false; + return parameters; + default: + throw new InvalidOperationException( + $"Unsupported trigger kind parameters type '{parameters.GetType().Name}'." + ); + } + } + + /// + /// Shortens column names in trigger column mappings using dialect rules. + /// + private static IReadOnlyList ShortenTriggerColumnMappings( + IReadOnlyList mappings, ISqlDialectRules dialectRules, out bool changed ) { changed = false; + var updated = new TriggerColumnMapping[mappings.Count]; - if (fallback.ReferrerActions.Count == 0) + for (var i = 0; i < mappings.Count; i++) { - return fallback; + var mapping = mappings[i]; + var updatedSource = ShortenColumn(mapping.SourceColumn, dialectRules); + var updatedTarget = ShortenColumn(mapping.TargetColumn, dialectRules); + + if (!updatedSource.Equals(mapping.SourceColumn) || !updatedTarget.Equals(mapping.TargetColumn)) + { + changed = true; + } + + updated[i] = new TriggerColumnMapping(updatedSource, updatedTarget); } - var updatedActions = new DbIdentityPropagationReferrerAction[fallback.ReferrerActions.Count]; + return changed ? updated : mappings; + } + + /// + /// Shortens identifiers in propagation referrer targets using dialect rules. + /// + private static IReadOnlyList ShortenPropagationReferrerTargets( + IReadOnlyList referrers, + ISqlDialectRules dialectRules, + out bool changed + ) + { + changed = false; + var updated = new PropagationReferrerTarget[referrers.Count]; - for (var actionIndex = 0; actionIndex < fallback.ReferrerActions.Count; actionIndex++) + for (var i = 0; i < referrers.Count; i++) { - var action = fallback.ReferrerActions[actionIndex]; - var updatedReferrerTable = ShortenTable(action.ReferrerTable, dialectRules); - var updatedReferrerDocumentIdColumn = ShortenColumn( - action.ReferrerDocumentIdColumn, - dialectRules - ); - var updatedReferencedDocumentIdColumn = ShortenColumn( - action.ReferencedDocumentIdColumn, - dialectRules + var referrer = referrers[i]; + var updatedReferrerTable = ShortenTable(referrer.ReferrerTable, dialectRules); + var updatedFkColumn = ShortenColumn(referrer.ReferrerFkColumn, dialectRules); + var updatedMappings = ShortenTriggerColumnMappings( + referrer.ColumnMappings, + dialectRules, + out var mappingsChanged ); - var pairCount = action.IdentityColumnPairs.Count; - var updatedPairs = new DbIdentityPropagationColumnPair[pairCount]; - var pairsChanged = false; - for (var pairIndex = 0; pairIndex < pairCount; pairIndex++) - { - var pair = action.IdentityColumnPairs[pairIndex]; - var updatedReferrerStorageColumn = ShortenColumn(pair.ReferrerStorageColumn, dialectRules); - var updatedReferencedStorageColumn = ShortenColumn( - pair.ReferencedStorageColumn, - dialectRules - ); - var pairChanged = - !updatedReferrerStorageColumn.Equals(pair.ReferrerStorageColumn) - || !updatedReferencedStorageColumn.Equals(pair.ReferencedStorageColumn); + var referrerChanged = + mappingsChanged + || !updatedReferrerTable.Equals(referrer.ReferrerTable) + || !updatedFkColumn.Equals(referrer.ReferrerFkColumn); - if (pairChanged) - { - pairsChanged = true; - updatedPairs[pairIndex] = new DbIdentityPropagationColumnPair( - updatedReferrerStorageColumn, - updatedReferencedStorageColumn - ); - } - else - { - updatedPairs[pairIndex] = pair; - } + if (referrerChanged) + { + changed = true; } - var actionChanged = - !updatedReferrerTable.Equals(action.ReferrerTable) - || !updatedReferrerDocumentIdColumn.Equals(action.ReferrerDocumentIdColumn) - || !updatedReferencedDocumentIdColumn.Equals(action.ReferencedDocumentIdColumn) - || pairsChanged; + updated[i] = referrerChanged + ? new PropagationReferrerTarget(updatedReferrerTable, updatedFkColumn, updatedMappings) + : referrer; + } - if (actionChanged) - { - changed = true; + return changed ? updated : referrers; + } - updatedActions[actionIndex] = action with - { - ReferrerTable = updatedReferrerTable, - ReferrerDocumentIdColumn = updatedReferrerDocumentIdColumn, - ReferencedDocumentIdColumn = updatedReferencedDocumentIdColumn, - IdentityColumnPairs = updatedPairs, - }; - } - else + /// + /// Shortens column names in identity element mappings using dialect rules. + /// + private static IReadOnlyList ShortenIdentityElementMappings( + IReadOnlyList elements, + ISqlDialectRules dialectRules, + out bool changed + ) + { + changed = false; + var updated = new IdentityElementMapping[elements.Count]; + + for (var i = 0; i < elements.Count; i++) + { + var element = elements[i]; + var updatedColumn = ShortenColumn(element.Column, dialectRules); + + if (!updatedColumn.Equals(element.Column)) { - updatedActions[actionIndex] = action; + changed = true; } + + updated[i] = element with { Column = updatedColumn }; } - return changed ? fallback with { ReferrerActions = updatedActions } : fallback; + return changed ? updated : elements; + } + + /// + /// Shortens column names in a superclass alias's identity elements using dialect rules. + /// + private static SuperclassAliasInfo? ShortenSuperclassAlias( + SuperclassAliasInfo? alias, + ISqlDialectRules dialectRules, + out bool changed + ) + { + if (alias is null) + { + changed = false; + return null; + } + + var updatedElements = ShortenIdentityElementMappings( + alias.IdentityElements, + dialectRules, + out changed + ); + + return changed ? alias with { IdentityElements = updatedElements } : alias; } /// @@ -1296,8 +1397,8 @@ private static void ValidateIdentifierShorteningCollisions(RelationalModelSetBui .ToArray(); var canonicalTriggers = context - .TriggerInventory.OrderBy(trigger => trigger.TriggerTable.Schema.Value, StringComparer.Ordinal) - .ThenBy(trigger => trigger.TriggerTable.Name, StringComparer.Ordinal) + .TriggerInventory.OrderBy(trigger => trigger.Table.Schema.Value, StringComparer.Ordinal) + .ThenBy(trigger => trigger.Table.Name, StringComparer.Ordinal) .ThenBy(trigger => trigger.Name.Value, StringComparer.Ordinal) .ToArray(); var registeredTables = new HashSet(); @@ -1330,7 +1431,10 @@ private static void ValidateIdentifierShorteningCollisions(RelationalModelSetBui registeredColumns.Add((table.Table, column.ColumnName)); } - var primaryKeyConstraintName = ResolvePrimaryKeyConstraintName(table.Table, table.Key); + var primaryKeyConstraintName = ConstraintNaming.ResolvePrimaryKeyConstraintName( + table.Table, + table.Key + ); detector.RegisterConstraint( table.Table, @@ -1390,7 +1494,10 @@ private static void ValidateIdentifierShorteningCollisions(RelationalModelSetBui registeredColumns.Add((tableModel.Table, column.ColumnName)); } - var primaryKeyConstraintName = ResolvePrimaryKeyConstraintName(tableModel.Table, tableModel.Key); + var primaryKeyConstraintName = ConstraintNaming.ResolvePrimaryKeyConstraintName( + tableModel.Table, + tableModel.Key + ); detector.RegisterConstraint( tableModel.Table, @@ -1466,13 +1573,9 @@ private static void ValidateIdentifierShorteningCollisions(RelationalModelSetBui foreach (var trigger in canonicalTriggers) { detector.RegisterTrigger( - trigger.TriggerTable, + trigger.Table, trigger.Name, - BuildOrigin( - $"trigger {trigger.Name.Value} on {FormatTable(trigger.TriggerTable)}", - null, - null - ) + BuildOrigin($"trigger {trigger.Name.Value} on {FormatTable(trigger.Table)}", null, null) ); } @@ -1638,16 +1741,6 @@ private static string FormatColumn(DbTableName table, DbColumnName column) return $"{FormatTable(table)}.{column.Value}"; } - /// - /// Resolves a primary key constraint name for collision registration. - /// - private static string ResolvePrimaryKeyConstraintName(DbTableName table, TableKey key) - { - return string.IsNullOrWhiteSpace(key.ConstraintName) - ? ConstraintNaming.BuildPrimaryKeyName(table) - : key.ConstraintName; - } - /// /// Extracts a name from the constraint for collision registration. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveIndexInventoryPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveIndexInventoryPass.cs index 072b6213f..9f1bc0fcc 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveIndexInventoryPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveIndexInventoryPass.cs @@ -50,9 +50,7 @@ private static void DeriveIndexesForTable(DbTableModel table, List List tableIndexes = []; // PK-implied index: one per table, reuses PK constraint name, unique. - var pkIndexName = string.IsNullOrWhiteSpace(table.Key.ConstraintName) - ? ConstraintNaming.BuildPrimaryKeyName(table.Table) - : table.Key.ConstraintName; + var pkIndexName = ConstraintNaming.ResolvePrimaryKeyConstraintName(table.Table, table.Key); tableIndexes.Add( new DbIndexInfo( @@ -82,7 +80,14 @@ [.. table.Key.Columns.Select(c => c.ColumnName)], // a leftmost prefix of any existing PK/UK/earlier-index key columns. // ValidateForeignKeyStorageInvariantPass runs earlier in the default pass order and // guarantees FK endpoints map to direct stored columns before index derivation. - foreach (var fk in table.Constraints.OfType()) + // Process longer FKs first so that shorter prefixes are suppressed by the longer + // index rather than the other way around. + var orderedFks = table + .Constraints.OfType() + .OrderByDescending(fk => fk.Columns.Count) + .ThenBy(fk => fk.Name, StringComparer.Ordinal); + + foreach (var fk in orderedFks) { if (IsLeftmostPrefixCovered(fk.Columns, tableIndexes)) { diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs index 0e05d3188..4a1687185 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs @@ -14,6 +14,17 @@ namespace EdFi.DataManagementService.Backend.RelationalModel.SetPasses; /// Derives the trigger inventory for all schema-derived tables (concrete resources with /// storage). Descriptor resources are skipped. /// +/// +/// +/// MSSQL trigger ordering: Multiple AFTER triggers may be emitted for the same table +/// (e.g., DocumentStamping, AbstractIdentityMaintenance, ReferentialIdentityMaintenance). SQL Server +/// does not guarantee a deterministic firing order for multiple AFTER triggers unless +/// sp_settriggerorder is used. The current triggers are designed to be order-independent: +/// each writes to a different target table and has no dependency on another trigger's side effects. +/// If a future trigger introduces such a dependency, explicit ordering via sp_settriggerorder +/// must be emitted. +/// +/// public sealed class DeriveTriggerInventoryPass : IRelationalModelSetPass { private const string StampToken = "Stamp"; @@ -34,21 +45,11 @@ public void Execute(RelationalModelSetBuilderContext context) var resourcesByKey = context.ConcreteResourcesInNameOrder.ToDictionary(model => model.ResourceKey.Resource ); - Dictionary< - DbTableName, - List - > propagationFallbackActionsByTriggerTable = new(); - Dictionary< - DbTableName, - HashSet - > propagationFallbackSeenActionsByTriggerTable = new(); var abstractTablesByResource = context.AbstractIdentityTablesInNameOrder.ToDictionary(table => table.AbstractResourceKey.Resource ); - var resourceContextsByResource = BuildResourceContextLookup(context); - foreach (var resourceContext in context.EnumerateConcreteResourceSchemasInNameOrder()) { if (IsResourceExtension(resourceContext)) @@ -77,10 +78,14 @@ public void Execute(RelationalModelSetBuilderContext context) var rootTable = resourceModel.Root; var builderContext = context.GetOrCreateResourceBuilderContext(resourceContext); + // Build identity element mappings once — shared by both identity projection columns + // and the referential identity trigger below. + var identityElements = BuildIdentityElementMappings(resourceModel, builderContext, resource); + // Resolve identity projection columns for the root table. var identityProjectionColumns = BuildRootIdentityProjectionColumns( resourceModel, - builderContext, + identityElements, resource ); @@ -108,23 +113,25 @@ public void Execute(RelationalModelSetBuilderContext context) new DbTriggerInfo( new DbTriggerName(BuildTriggerName(table.Table, StampToken)), table.Table, - DbTriggerKind.DocumentStamping, keyColumns, - isRootTable ? identityProjectionColumns : [] + isRootTable ? identityProjectionColumns : [], + new TriggerKindParameters.DocumentStamping() ) ); } - // ReferentialIdentityMaintenance trigger on the root table. - context.TriggerInventory.Add( - new DbTriggerInfo( - new DbTriggerName(BuildTriggerName(rootTable.Table, ReferentialIdentityToken)), - rootTable.Table, - DbTriggerKind.ReferentialIdentityMaintenance, - [RelationalNameConventions.DocumentIdColumnName], - identityProjectionColumns - ) - ); + // Every concrete resource must have at least one identity element for referential identity computation. + // Empty identity elements would produce a degenerate UUIDv5 hash with no identity data. + if (identityElements.Count == 0) + { + throw new InvalidOperationException( + $"Resource '{FormatResource(resource)}' requires at least one identity element " + + "for referential identity computation, but none were derived." + ); + } + + // Resolve the resource key entry for referential identity metadata. + var resourceKeyEntry = context.GetResourceKeyEntry(resource); // AbstractIdentityMaintenance triggers — one per abstract identity table this // resource contributes to (discovered via subclass metadata). @@ -134,6 +141,8 @@ public void Execute(RelationalModelSetBuilderContext context) defaultValue: false ); + SuperclassAliasInfo? superclassAlias = null; + if (isSubclass) { var superclassProjectName = RequireString( @@ -149,514 +158,678 @@ public void Execute(RelationalModelSetBuilderContext context) superclassResourceName ); + var superclassResourceKeyEntry = context.GetResourceKeyEntry(superclassResource); + + // Build superclass identity element mappings, handling superclassIdentityJsonPath remapping. + var superclassIdentityJsonPath = TryGetOptionalString( + resourceContext.ResourceSchema, + "superclassIdentityJsonPath" + ); + + IReadOnlyList superclassIdentityElements; + if (superclassIdentityJsonPath is not null) + { + // When superclassIdentityJsonPath is set, the subclass has exactly one identity path + // that maps to the superclass's single identity path. + // This invariant is validated here at trigger derivation time rather than during schema + // loading because superclassIdentityJsonPath is resolved from the ApiSchema JSON and the + // identity element count is derived from the relational model building process. + if (identityElements.Count != 1) + { + throw new InvalidOperationException( + $"Subclass resource '{FormatResource(resource)}' with superclassIdentityJsonPath " + + $"must have exactly one identity element, but found {identityElements.Count}." + ); + } + + superclassIdentityElements = + [ + new IdentityElementMapping( + identityElements[0].Column, + superclassIdentityJsonPath, + identityElements[0].ScalarType + ), + ]; + } + else + { + // Same identity paths — reuse the concrete identity elements. + superclassIdentityElements = identityElements; + } + + superclassAlias = new SuperclassAliasInfo( + superclassResourceKeyEntry.ResourceKeyId, + superclassProjectName, + superclassResourceName, + superclassIdentityElements + ); + if (abstractTablesByResource.TryGetValue(superclassResource, out var abstractTable)) { + var targetColumnMappings = BuildAbstractIdentityColumnMappings( + abstractTable.TableModel, + resourceModel, + builderContext, + resource, + superclassIdentityJsonPath + ); + context.TriggerInventory.Add( new DbTriggerInfo( new DbTriggerName(BuildTriggerName(rootTable.Table, AbstractIdentityToken)), rootTable.Table, - DbTriggerKind.AbstractIdentityMaintenance, [RelationalNameConventions.DocumentIdColumnName], identityProjectionColumns, - MaintenanceTargetTable: abstractTable.TableModel.Table + new TriggerKindParameters.AbstractIdentityMaintenance( + abstractTable.TableModel.Table, + targetColumnMappings, + $"{resource.ProjectName}:{resource.ResourceName}" + ) ) ); } } - // IdentityPropagationFallback — MSSQL only: emits triggers for reference FKs that - // would use ON UPDATE CASCADE on PostgreSQL but must use NO ACTION on SQL Server. - if (context.Dialect == SqlDialect.Mssql && builderContext.DocumentReferenceMappings.Count > 0) - { - CollectPropagationFallbackActions( - context, - builderContext, - resourceModel, - resourcesByKey, - abstractTablesByResource, - resourceContextsByResource, - resource, - propagationFallbackActionsByTriggerTable, - propagationFallbackSeenActionsByTriggerTable - ); - } + // ReferentialIdentityMaintenance trigger on the root table. + context.TriggerInventory.Add( + new DbTriggerInfo( + new DbTriggerName(BuildTriggerName(rootTable.Table, ReferentialIdentityToken)), + rootTable.Table, + [RelationalNameConventions.DocumentIdColumnName], + identityProjectionColumns, + new TriggerKindParameters.ReferentialIdentityMaintenance( + resourceKeyEntry.ResourceKeyId, + resource.ProjectName, + resource.ResourceName, + identityElements, + superclassAlias + ) + ) + ); } + // IdentityPropagationFallback — MSSQL only: emits triggers on referenced entities to propagate + // identity updates to all referrers. This replaces ON UPDATE CASCADE which SQL Server rejects + // due to multiple cascade paths. if (context.Dialect == SqlDialect.Mssql) { - EmitPropagationFallbackTriggers(context, propagationFallbackActionsByTriggerTable); + var resourceContextsByResource = BuildResourceContextLookup(context); + + EmitPropagationFallbackTriggers( + context, + abstractTablesByResource, + resourceContextsByResource, + resourcesByKey + ); + } + } + + /// + /// Resolves a reference-bearing identity path to its locally stored identity-part columns + /// (from ). Returns null if the + /// path does not match a reference binding, allowing the caller to fall through to direct + /// column lookup. + /// + private static IReadOnlyList? ResolveReferenceIdentityPartColumns( + string canonicalPath, + IReadOnlyDictionary referenceBindingsByIdentityPath, + DbTableName rootTable, + QualifiedResourceName resource + ) + { + if (!referenceBindingsByIdentityPath.TryGetValue(canonicalPath, out var binding)) + { + return null; } + + if (binding.Table != rootTable) + { + throw new InvalidOperationException( + $"Identity path '{canonicalPath}' on resource '{FormatResource(resource)}' " + + "must bind to the root table when resolving reference identity-part columns." + ); + } + + if (!binding.IsIdentityComponent) + { + throw new InvalidOperationException( + $"Identity path '{canonicalPath}' on resource '{FormatResource(resource)}' " + + "mapped to a non-identity reference binding." + ); + } + + if (binding.IdentityBindings.Count == 0) + { + throw new InvalidOperationException( + $"Identity path '{canonicalPath}' on resource '{FormatResource(resource)}' " + + "mapped to a reference binding with no identity-part columns." + ); + } + + var identityBindingsForPath = binding + .IdentityBindings.Where(ib => ib.ReferenceJsonPath.Canonical == canonicalPath) + .ToArray(); + + if (identityBindingsForPath.Length == 0) + { + throw new InvalidOperationException( + $"Identity path '{canonicalPath}' on resource '{FormatResource(resource)}' " + + "did not resolve to a local identity-part column." + ); + } + + return identityBindingsForPath.Select(ib => ib.Column).ToArray(); } /// - /// Builds the ordered set of root identity projection columns by resolving - /// identityJsonPaths to physical column names. For identity-component references, this - /// projects locally stored identity-part columns (from - /// ) so trigger compare sets detect value - /// changes even when ..._DocumentId remains stable. + /// Builds the ordered set of root identity projection columns for MSSQL UPDATE() guards + /// and PostgreSQL IS DISTINCT FROM comparisons. These columns must be physically stored + /// (writable) columns because SQL Server rejects UPDATE(computedCol) at trigger creation + /// time (Msg 2114). Under key unification, identity binding columns may be persisted computed + /// aliases; this method resolves each to its canonical storage column and de-duplicates. /// private static IReadOnlyList BuildRootIdentityProjectionColumns( RelationalResourceModel resourceModel, - RelationalModelBuilderContext builderContext, + IReadOnlyList identityElements, QualifiedResourceName resource ) { - if (builderContext.IdentityJsonPaths.Count == 0) + if (identityElements.Count == 0) { return []; } var rootTable = resourceModel.Root; - var rootColumnsByPath = BuildColumnNameLookupBySourceJsonPath(rootTable, resource); - var referenceBindingsByIdentityPath = BuildReferenceIdentityBindings( - resourceModel.DocumentReferenceBindings, - resource - ); - HashSet seenColumns = new(StringComparer.Ordinal); - List uniqueColumns = new(builderContext.IdentityJsonPaths.Count); + // Resolve each identity element column to its canonical stored column. + // Under key unification, binding columns may be unified aliases (computed); + // UPDATE() guards and IS DISTINCT FROM comparisons must reference stored columns. + HashSet seen = new(StringComparer.Ordinal); + List storedColumns = new(identityElements.Count); - foreach (var identityPath in builderContext.IdentityJsonPaths) + foreach (var element in identityElements) { - if (referenceBindingsByIdentityPath.TryGetValue(identityPath.Canonical, out var binding)) + var resolved = ResolveToStoredColumn(element.Column, rootTable, resource); + + if (seen.Add(resolved.Value)) { - if (binding.Table != rootTable.Table) - { - throw new InvalidOperationException( - $"Identity path '{identityPath.Canonical}' on resource '{FormatResource(resource)}' " - + "must bind to the root table when deriving trigger identity projections." - ); - } + storedColumns.Add(resolved); + } + } - if (!binding.IsIdentityComponent) - { - throw new InvalidOperationException( - $"Identity path '{identityPath.Canonical}' on resource '{FormatResource(resource)}' " - + "mapped to a non-identity reference binding during trigger derivation." - ); - } + return storedColumns.ToArray(); + } - if (binding.IdentityBindings.Count == 0) - { - throw new InvalidOperationException( - $"Identity path '{identityPath.Canonical}' on resource '{FormatResource(resource)}' " - + "mapped to a reference binding with no identity-part columns." - ); - } + /// + /// Helper record for reverse reference index entries. + /// + private sealed record ReverseReferenceEntry( + QualifiedResourceName ReferrerResource, + DbTableModel ReferrerRootTable, + DocumentReferenceBinding Binding, + DocumentReferenceMapping Mapping + ); - var identityBindingsForPath = binding - .IdentityBindings.Where(identityBinding => - identityBinding.ReferenceJsonPath.Canonical == identityPath.Canonical - ) - .ToArray(); + /// + /// Emits triggers on referenced + /// entities to propagate identity updates to all referrers. These replace the ON UPDATE CASCADE + /// that PostgreSQL handles natively but SQL Server rejects due to multiple cascade paths. + /// + private static void EmitPropagationFallbackTriggers( + RelationalModelSetBuilderContext context, + IReadOnlyDictionary abstractTablesByResource, + IReadOnlyDictionary resourceContextsByResource, + IReadOnlyDictionary concreteResourcesByName + ) + { + // Build reverse reference index: for each target resource, collect all referrer entries. + var reverseIndex = BuildReverseReferenceIndex( + context, + resourceContextsByResource, + concreteResourcesByName + ); - if (identityBindingsForPath.Length == 0) - { - throw new InvalidOperationException( - $"Identity path '{identityPath.Canonical}' on resource '{FormatResource(resource)}' " - + "did not resolve to a local identity-part column for trigger derivation." - ); - } + // For each target resource in the reverse index, emit a single trigger with all referrers. + foreach (var (targetResource, referrerEntries) in reverseIndex) + { + // Determine trigger table model: abstract identity table OR concrete root table. + // The table model is needed both for the trigger DDL and for resolving source + // column names from SourceJsonPath mappings in BuildPropagationColumnMappings. + DbTableModel triggerTableModel; + IReadOnlyList identityProjectionColumns; - foreach (var identityBinding in identityBindingsForPath) + if (abstractTablesByResource.TryGetValue(targetResource, out var abstractTableInfo)) + { + triggerTableModel = abstractTableInfo.TableModel; + + // Identity projection columns are all columns with SourceJsonPath (identity columns). + identityProjectionColumns = triggerTableModel + .Columns.Where(c => c.SourceJsonPath is not null) + .Select(c => c.ColumnName) + .ToArray(); + } + else if (concreteResourcesByName.TryGetValue(targetResource, out var concreteModel)) + { + // Concrete target must allow identity updates. + if ( + !resourceContextsByResource.TryGetValue(targetResource, out var targetContext) + || !context.GetOrCreateResourceBuilderContext(targetContext).AllowIdentityUpdates + ) { - AddUniqueColumn(identityBinding.Column, uniqueColumns, seenColumns); + continue; } + triggerTableModel = concreteModel.RelationalModel.Root; + + // Identity projection columns from the root table, resolved to stored columns. + // Under key unification, some identity columns may be unified aliases (computed); + // SQL Server rejects UPDATE() on computed columns (Msg 2114). + identityProjectionColumns = ResolveColumnsToStored( + triggerTableModel + .Columns.Where(c => c.SourceJsonPath is not null) + .Select(c => c.ColumnName), + triggerTableModel, + targetResource + ); + } + else + { continue; } - if (!rootColumnsByPath.TryGetValue(identityPath.Canonical, out var columnName)) + var triggerTable = triggerTableModel.Table; + + // Build referrer updates by mapping source identity columns to referrer stored columns. + var referrerUpdates = new List(); + + foreach (var entry in referrerEntries) { - throw new InvalidOperationException( - $"Identity path '{identityPath.Canonical}' on resource '{FormatResource(resource)}' " - + "did not map to a root table column during trigger derivation." + var columnMappings = BuildPropagationColumnMappings( + entry.Binding, + entry.Mapping, + entry.ReferrerResource, + entry.ReferrerRootTable, + triggerTableModel, + targetResource + ); + + referrerUpdates.Add( + new PropagationReferrerTarget( + entry.ReferrerRootTable.Table, + entry.Binding.FkColumn, + columnMappings + ) ); } - AddUniqueColumn(columnName, uniqueColumns, seenColumns); - } + // Skip trigger creation when no referrers need propagation updates. + // This can happen when all referrer bindings resolve to non-root tables. + if (referrerUpdates.Count == 0) + { + continue; + } - return uniqueColumns.ToArray(); + context.TriggerInventory.Add( + new DbTriggerInfo( + new DbTriggerName(BuildTriggerName(triggerTable, PropagationFallbackPrefix)), + triggerTable, + [RelationalNameConventions.DocumentIdColumnName], + identityProjectionColumns, + new TriggerKindParameters.IdentityPropagationFallback(referrerUpdates) + ) + ); + } } /// - /// Collects fan-out actions keyed by - /// referenced table. This replaces PostgreSQL ON UPDATE CASCADE behavior for SQL Server, - /// which must use NO ACTION due to multiple cascade path restrictions. + /// Builds a reverse reference index mapping target resources to their referrer entries. /// - private static void CollectPropagationFallbackActions( + private static Dictionary> BuildReverseReferenceIndex( RelationalModelSetBuilderContext context, - RelationalModelBuilderContext builderContext, - RelationalResourceModel resourceModel, - IReadOnlyDictionary resourcesByKey, - IReadOnlyDictionary abstractTablesByResource, IReadOnlyDictionary resourceContextsByResource, - QualifiedResourceName resource, - IDictionary> actionsByTriggerTable, - IDictionary> seenActionKeysByTriggerTable + IReadOnlyDictionary concreteResourcesByName ) { - var bindingByReferencePath = resourceModel.DocumentReferenceBindings.ToDictionary( - binding => binding.ReferenceObjectPath.Canonical, - StringComparer.Ordinal - ); + var reverseIndex = new Dictionary>(); - foreach (var mapping in builderContext.DocumentReferenceMappings) + foreach (var resourceContext in context.EnumerateConcreteResourceSchemasInNameOrder()) { - if (!bindingByReferencePath.TryGetValue(mapping.ReferenceObjectPath.Canonical, out var binding)) + if (IsResourceExtension(resourceContext)) { - throw new InvalidOperationException( - $"Reference mapping '{mapping.MappingKey}' on resource '{FormatResource(resource)}' " - + $"uses reference object path '{mapping.ReferenceObjectPath.Canonical}' that " - + "did not map to a derived document reference binding." - ); + continue; } - if ( - !TryResolvePropagationTargetTable( - context, - mapping.TargetResource, - resourcesByKey, - abstractTablesByResource, - resourceContextsByResource, - out var referencedTableModel - ) - ) + var referrerResource = new QualifiedResourceName( + resourceContext.Project.ProjectSchema.ProjectName, + resourceContext.ResourceName + ); + + // Continue intentionally filters abstract and unmodeled resources — they have + // schema entries but no concrete resource model (e.g., abstract base resources + // or resources that do not produce relational tables). + if (!concreteResourcesByName.TryGetValue(referrerResource, out var referrerModel)) { continue; } - var bindingTableCandidates = resourceModel - .TablesInDependencyOrder.Where(table => table.Table.Equals(binding.Table)) - .ToArray(); - - if (bindingTableCandidates.Length == 0) + if (referrerModel.StorageKind == ResourceStorageKind.SharedDescriptorTable) { - throw new InvalidOperationException( - $"Reference object path '{binding.ReferenceObjectPath.Canonical}' on resource " - + $"'{FormatResource(resource)}' did not map to table '{binding.Table}'." - ); + continue; } - var bindingTable = ReferenceObjectPathScopeResolver.ResolveOwningTableScope( - binding.ReferenceObjectPath, - bindingTableCandidates, - static table => table.JsonScope, - resource, - binding.Table.ToString() - ); - var referrerIdentityColumnsByReferencePath = binding.IdentityBindings.ToDictionary( - identityBinding => identityBinding.ReferenceJsonPath.Canonical, - identityBinding => identityBinding.Column, + var referrerBuilderContext = context.GetOrCreateResourceBuilderContext(resourceContext); + var referrerRootTable = referrerModel.RelationalModel.Root; + + var bindingByReferencePath = referrerModel.RelationalModel.DocumentReferenceBindings.ToDictionary( + binding => binding.ReferenceObjectPath.Canonical, StringComparer.Ordinal ); - var referencedColumnsByIdentityPath = BuildColumnNameLookupBySourceJsonPath( - referencedTableModel, - mapping.TargetResource - ); - var referrerTableMetadata = UnifiedAliasStrictMetadataCache.GetOrBuild(context, bindingTable); - var referencedTableMetadata = UnifiedAliasStrictMetadataCache.GetOrBuild( - context, - referencedTableModel - ); - var referrerMappingContext = ReferenceMappingContextFormatter.Build(mapping, resource); - var referencedMappingContext = ReferenceMappingContextFormatter.Build( - mapping, - mapping.TargetResource - ); - HashSet<( - DbColumnName ReferrerStorageColumn, - DbColumnName ReferencedStorageColumn - )> seenIdentityColumnPairs = []; - List identityColumnPairs = new(mapping.ReferenceJsonPaths.Count); - foreach (var identityPathBinding in mapping.ReferenceJsonPaths) + foreach (var mapping in referrerBuilderContext.DocumentReferenceMappings) { if ( - !referrerIdentityColumnsByReferencePath.TryGetValue( - identityPathBinding.ReferenceJsonPath.Canonical, - out var referrerIdentityColumn + !bindingByReferencePath.TryGetValue( + mapping.ReferenceObjectPath.Canonical, + out var binding ) ) { - throw new InvalidOperationException( - $"Reference identity path '{identityPathBinding.ReferenceJsonPath.Canonical}' on " - + $"resource '{FormatResource(resource)}' did not map to a referrer " - + $"identity column during trigger derivation." - ); + continue; } - if ( - !referencedColumnsByIdentityPath.TryGetValue( - identityPathBinding.IdentityJsonPath.Canonical, - out var referencedIdentityColumn - ) - ) + // Only consider root-table bindings (references from the root table). + if (!binding.Table.Equals(referrerRootTable.Table)) { - throw new InvalidOperationException( - $"Target identity path '{identityPathBinding.IdentityJsonPath.Canonical}' on " - + $"resource '{FormatResource(mapping.TargetResource)}' did not map to a " - + $"referenced table column during trigger derivation." - ); + continue; } - var referrerStorageColumn = UnifiedAliasStorageResolver.ResolveStorageColumn( - referrerIdentityColumn, - referrerTableMetadata, - UnifiedAliasStorageResolver.PresenceGateRejectionPolicy.RejectAllPresenceGates, - referrerMappingContext, - "referrer identity column", - "trigger identity propagation" - ); - var referencedStorageColumn = UnifiedAliasStorageResolver.ResolveStorageColumn( - referencedIdentityColumn, - referencedTableMetadata, - UnifiedAliasStorageResolver.PresenceGateRejectionPolicy.RejectAllPresenceGates, - referencedMappingContext, - "referenced identity column", - "trigger identity propagation" - ); - - AddIdentityColumnPair( - referrerStorageColumn, - referencedStorageColumn, - identityColumnPairs, - seenIdentityColumnPairs - ); - } - - var referrerDocumentIdColumn = UnifiedAliasStorageResolver.ResolveStorageColumn( - binding.FkColumn, - referrerTableMetadata, - UnifiedAliasStorageResolver.PresenceGateRejectionPolicy.RejectSyntheticScalarPresence, - referrerMappingContext, - "referrer document id column", - "trigger identity propagation" - ); + var targetResource = mapping.TargetResource; - var referrerAction = new DbIdentityPropagationReferrerAction( - bindingTable.Table, - referrerDocumentIdColumn, - RelationalNameConventions.DocumentIdColumnName, - identityColumnPairs.ToArray() - ); + if (!reverseIndex.TryGetValue(targetResource, out var entries)) + { + entries = []; + reverseIndex[targetResource] = entries; + } - if (!actionsByTriggerTable.TryGetValue(referencedTableModel.Table, out var referrerActions)) - { - referrerActions = []; - actionsByTriggerTable[referencedTableModel.Table] = referrerActions; + entries.Add(new ReverseReferenceEntry(referrerResource, referrerRootTable, binding, mapping)); } - - if ( - !seenActionKeysByTriggerTable.TryGetValue( - referencedTableModel.Table, - out var seenReferrerActions - ) - ) - { - seenReferrerActions = new HashSet(); - seenActionKeysByTriggerTable[referencedTableModel.Table] = seenReferrerActions; - } - - AddPropagationReferrerAction(referrerActions, seenReferrerActions, referrerAction); } + + return reverseIndex; } /// - /// Emits one trigger per referenced table. + /// Builds column mappings for identity propagation: source identity columns on the trigger + /// table to referrer stored columns. Resolves source columns from the trigger table model's + /// mapping instead of guessing from JSON path + /// segments, matching the approach used by . /// - private static void EmitPropagationFallbackTriggers( - RelationalModelSetBuilderContext context, - IReadOnlyDictionary> actionsByTriggerTable + /// + /// Under key unification, ib.Column from reference identity bindings may be a persisted + /// computed alias. SQL Server rejects SET r.[computedCol] = ... (Msg 271), so each + /// target column must be resolved to its canonical storage column via the referrer table model. + /// + private static IReadOnlyList BuildPropagationColumnMappings( + DocumentReferenceBinding binding, + DocumentReferenceMapping mapping, + QualifiedResourceName referrerResource, + DbTableModel referrerRootTable, + DbTableModel triggerTable, + QualifiedResourceName targetResource ) { - foreach ( - var (triggerTable, referrerActions) in actionsByTriggerTable - .OrderBy(entry => entry.Key.Schema.Value, StringComparer.Ordinal) - .ThenBy(entry => entry.Key.Name, StringComparer.Ordinal) - ) + // Build lookup: identity JSON path → source column on the trigger table. + var sourceColumnsByPath = BuildColumnNameLookupBySourceJsonPath(triggerTable, targetResource); + + // Build lookup: reference JSON path → identity JSON path. + var identityPathByReferencePath = new Dictionary(StringComparer.Ordinal); + foreach (var entry in mapping.ReferenceJsonPaths) { - var orderedReferrerActions = referrerActions - .OrderBy(action => action.ReferrerTable.Schema.Value, StringComparer.Ordinal) - .ThenBy(action => action.ReferrerTable.Name, StringComparer.Ordinal) - .ThenBy(action => action.ReferrerDocumentIdColumn.Value, StringComparer.Ordinal) - .ThenBy( - action => BuildIdentityColumnPairSignature(action.IdentityColumnPairs), - StringComparer.Ordinal - ) - .ToArray(); + identityPathByReferencePath[entry.ReferenceJsonPath.Canonical] = entry.IdentityJsonPath.Canonical; + } - context.TriggerInventory.Add( - new DbTriggerInfo( - new DbTriggerName(BuildTriggerName(triggerTable, PropagationFallbackPrefix)), - triggerTable, - DbTriggerKind.IdentityPropagationFallback, - [], - [], - PropagationFallback: new DbIdentityPropagationFallbackInfo(orderedReferrerActions) + // For each identity binding, map source identity column to referrer stored column. + // Direction: SourceColumn = trigger table identity column, TargetColumn = referrer stored column. + return binding + .IdentityBindings.Select(ib => + { + if ( + !identityPathByReferencePath.TryGetValue( + ib.ReferenceJsonPath.Canonical, + out var identityPath + ) ) - ); - } + { + throw new InvalidOperationException( + $"Propagation fallback trigger derivation for referrer '{FormatResource(referrerResource)}': " + + $"reference JSON path '{ib.ReferenceJsonPath.Canonical}' did not map to " + + "a target identity path." + ); + } + + // Resolve source column from the trigger table model's SourceJsonPath mapping. + if (!sourceColumnsByPath.TryGetValue(identityPath, out var sourceColumn)) + { + throw new InvalidOperationException( + $"Propagation fallback trigger derivation for target '{FormatResource(targetResource)}': " + + $"identity path '{identityPath}' did not map to a column on trigger table " + + $"'{triggerTable.Table.Schema.Value}.{triggerTable.Table.Name}'." + ); + } + + // Resolve through storage: ib.Column may be a unified alias (computed) after + // key unification. The propagation UPDATE must target the canonical stored column. + var targetColumn = ResolveToStoredColumn(ib.Column, referrerRootTable, referrerResource); + + return new TriggerColumnMapping(sourceColumn, targetColumn); + }) + .ToArray(); } /// - /// Resolves the propagation trigger target table for a reference mapping. + /// Builds identity element mappings for UUIDv5 computation by pairing each identity projection + /// column with its canonical JSON path. For identity-component references, this resolves to + /// locally stored identity-part columns (not the FK ..._DocumentId) so the computed + /// UUIDv5 hash matches Core's ReferentialIdCalculator. /// - private static bool TryResolvePropagationTargetTable( - RelationalModelSetBuilderContext context, - QualifiedResourceName targetResource, - IReadOnlyDictionary resourcesByKey, - IReadOnlyDictionary abstractTablesByResource, - IReadOnlyDictionary resourceContextsByResource, - out DbTableModel referencedTableModel + private static IReadOnlyList BuildIdentityElementMappings( + RelationalResourceModel resourceModel, + RelationalModelBuilderContext builderContext, + QualifiedResourceName resource ) { - if (abstractTablesByResource.TryGetValue(targetResource, out var abstractTable)) + if (builderContext.IdentityJsonPaths.Count == 0) { - referencedTableModel = abstractTable.TableModel; - return true; + return []; } - if (!resourceContextsByResource.TryGetValue(targetResource, out var targetResourceContext)) - { - referencedTableModel = default!; - return false; - } + var rootTable = resourceModel.Root; + var rootColumnsByPath = BuildColumnNameLookupBySourceJsonPath(rootTable, resource); + var referenceBindingsByIdentityPath = BuildReferenceIdentityBindings( + resourceModel.DocumentReferenceBindings, + resource + ); - var targetBuilderContext = context.GetOrCreateResourceBuilderContext(targetResourceContext); + // Build a column-name-to-scalar-type lookup for type-aware identity hash formatting. + var columnScalarTypes = rootTable + .Columns.Where(c => c.ScalarType is not null) + .ToDictionary(c => c.ColumnName.Value, c => c.ScalarType!, StringComparer.Ordinal); - if (!targetBuilderContext.AllowIdentityUpdates) - { - referencedTableModel = default!; - return false; - } + HashSet seenColumns = new(StringComparer.Ordinal); + List mappings = new(builderContext.IdentityJsonPaths.Count); - if (!resourcesByKey.TryGetValue(targetResource, out var targetModel)) + foreach (var identityPath in builderContext.IdentityJsonPaths) { - throw new InvalidOperationException( - $"Reference target resource '{FormatResource(targetResource)}' was not found " - + "for trigger propagation derivation." + var identityPartColumns = ResolveReferenceIdentityPartColumns( + identityPath.Canonical, + referenceBindingsByIdentityPath, + rootTable.Table, + resource ); + + if (identityPartColumns is not null) + { + foreach (var col in identityPartColumns) + { + if (seenColumns.Add(col.Value)) + { + mappings.Add( + new IdentityElementMapping( + col, + identityPath.Canonical, + LookupColumnScalarType( + columnScalarTypes, + col, + identityPath.Canonical, + resource + ) + ) + ); + } + } + continue; + } + + if (!rootColumnsByPath.TryGetValue(identityPath.Canonical, out var columnName)) + { + throw new InvalidOperationException( + $"Identity path '{identityPath.Canonical}' on resource '{FormatResource(resource)}' " + + "did not map to a root table column during identity element mapping." + ); + } + + if (seenColumns.Add(columnName.Value)) + { + mappings.Add( + new IdentityElementMapping( + columnName, + identityPath.Canonical, + LookupColumnScalarType( + columnScalarTypes, + columnName, + identityPath.Canonical, + resource + ) + ) + ); + } } - referencedTableModel = targetModel.RelationalModel.Root; - return true; + return mappings.ToArray(); } /// - /// Adds an identity column pair once, preserving first-seen ordering. + /// Resolves the for a given column from the pre-built lookup. /// - private static void AddIdentityColumnPair( - DbColumnName referrerStorageColumn, - DbColumnName referencedStorageColumn, - ICollection pairs, - ISet<(DbColumnName ReferrerStorageColumn, DbColumnName ReferencedStorageColumn)> seenPairs + private static RelationalScalarType LookupColumnScalarType( + Dictionary columnScalarTypes, + DbColumnName column, + string identityPath, + QualifiedResourceName resource ) { - var key = (referrerStorageColumn, referencedStorageColumn); - - if (!seenPairs.Add(key)) + if (!columnScalarTypes.TryGetValue(column.Value, out var scalarType)) { - return; + throw new InvalidOperationException( + $"Identity column '{column.Value}' for path '{identityPath}' on resource " + + $"'{FormatResource(resource)}' has no scalar type metadata." + ); } - - pairs.Add(new DbIdentityPropagationColumnPair(referrerStorageColumn, referencedStorageColumn)); + return scalarType; } /// - /// Adds a propagation action exactly once using semantic equality on referrer + identity mappings. + /// Builds column mappings from concrete root table columns to abstract identity table columns + /// for triggers. For + /// identity-component references, resolves to locally stored identity-part columns (not the FK + /// ..._DocumentId). /// - private readonly struct PropagationReferrerActionKey : IEquatable + private static IReadOnlyList BuildAbstractIdentityColumnMappings( + DbTableModel abstractTable, + RelationalResourceModel resourceModel, + RelationalModelBuilderContext builderContext, + QualifiedResourceName resource, + string? superclassIdentityJsonPath + ) { - private readonly int _hashCode; - - public PropagationReferrerActionKey(DbIdentityPropagationReferrerAction action) - { - ReferrerTable = action.ReferrerTable; - ReferrerDocumentIdColumn = action.ReferrerDocumentIdColumn; - ReferencedDocumentIdColumn = action.ReferencedDocumentIdColumn; - IdentityColumnPairs = action.IdentityColumnPairs; - - _hashCode = ComputeHashCode( - ReferrerTable, - ReferrerDocumentIdColumn, - ReferencedDocumentIdColumn, - IdentityColumnPairs - ); - } + var rootTable = resourceModel.Root; + var rootColumnsByPath = BuildColumnNameLookupBySourceJsonPath(rootTable, resource); + var referenceBindingsByIdentityPath = BuildReferenceIdentityBindings( + resourceModel.DocumentReferenceBindings, + resource + ); - public DbTableName ReferrerTable { get; } + List mappings = []; - public DbColumnName ReferrerDocumentIdColumn { get; } + // Iterate over abstract identity table columns that have a source JSON path + // (these are the identity columns, excluding DocumentId and Discriminator). + foreach (var abstractColumn in abstractTable.Columns) + { + if (abstractColumn.SourceJsonPath is null) + { + continue; + } - public DbColumnName ReferencedDocumentIdColumn { get; } + var abstractPath = abstractColumn.SourceJsonPath.Value.Canonical; - public IReadOnlyList IdentityColumnPairs { get; } + // Determine which concrete identity path maps to this abstract path. + string concretePath; + if ( + superclassIdentityJsonPath is not null + && string.Equals(abstractPath, superclassIdentityJsonPath, StringComparison.Ordinal) + ) + { + // When superclassIdentityJsonPath is set, the first concrete identity path + // maps to the superclass identity path. + if (builderContext.IdentityJsonPaths.Count == 0) + throw new InvalidOperationException( + $"Resource '{FormatResource(resource)}' has superclassIdentityJsonPath set but no identity JSON paths." + ); - public bool Equals(PropagationReferrerActionKey other) - { - return ReferrerTable.Equals(other.ReferrerTable) - && ReferrerDocumentIdColumn.Equals(other.ReferrerDocumentIdColumn) - && ReferencedDocumentIdColumn.Equals(other.ReferencedDocumentIdColumn) - && IdentityColumnPairs.SequenceEqual(other.IdentityColumnPairs); - } + concretePath = builderContext.IdentityJsonPaths[0].Canonical; + } + else + { + // Normal case: the concrete path is the same as the abstract path. + concretePath = abstractPath; + } - public override bool Equals(object? obj) - { - return obj is PropagationReferrerActionKey other && Equals(other); - } + // Resolve the concrete source column via identity-part columns for references. + var identityPartColumns = ResolveReferenceIdentityPartColumns( + concretePath, + referenceBindingsByIdentityPath, + rootTable.Table, + resource + ); - public override int GetHashCode() => _hashCode; + if (identityPartColumns is not null) + { + if (identityPartColumns.Count != 1) + { + throw new InvalidOperationException( + $"Abstract identity path '{abstractPath}' (concrete path '{concretePath}') " + + $"on resource '{FormatResource(resource)}' expected exactly one identity-part column " + + $"but found {identityPartColumns.Count}." + ); + } - private static int ComputeHashCode( - DbTableName referrerTable, - DbColumnName referrerDocumentIdColumn, - DbColumnName referencedDocumentIdColumn, - IReadOnlyList identityColumnPairs - ) - { - var hash = new HashCode(); - hash.Add(referrerTable); - hash.Add(referrerDocumentIdColumn); - hash.Add(referencedDocumentIdColumn); + mappings.Add(new TriggerColumnMapping(identityPartColumns[0], abstractColumn.ColumnName)); + continue; + } - foreach (var pair in identityColumnPairs) + if (!rootColumnsByPath.TryGetValue(concretePath, out var columnName)) { - hash.Add(pair); + throw new InvalidOperationException( + $"Abstract identity path '{abstractPath}' (concrete path '{concretePath}') " + + $"on resource '{FormatResource(resource)}' did not map to a root table column " + + "during abstract identity column mapping." + ); } - return hash.ToHashCode(); + mappings.Add(new TriggerColumnMapping(columnName, abstractColumn.ColumnName)); } - } - private static void AddPropagationReferrerAction( - ICollection referrerActions, - ISet seenReferrerActions, - DbIdentityPropagationReferrerAction candidate - ) - { - if (!seenReferrerActions.Add(new PropagationReferrerActionKey(candidate))) - { - return; - } - - referrerActions.Add(candidate); - } - - /// - /// Builds a deterministic signature for an ordered identity-column-pair sequence. - /// - private static string BuildIdentityColumnPairSignature( - IReadOnlyList identityColumnPairs - ) - { - return string.Join( - "|", - identityColumnPairs.Select(pair => - $"{pair.ReferrerStorageColumn.Value}>{pair.ReferencedStorageColumn.Value}" - ) - ); + return mappings.ToArray(); } /// @@ -694,4 +867,64 @@ private static string BuildTriggerName(DbTableName table, string purposeToken) { return $"TR_{table.Name}_{purposeToken}"; } + + /// + /// Resolves a sequence of column names to their canonical stored columns, de-duplicating + /// by canonical column name. Convenience wrapper around . + /// + private static IReadOnlyList ResolveColumnsToStored( + IEnumerable columns, + DbTableModel table, + QualifiedResourceName resource + ) + { + HashSet seen = new(StringComparer.Ordinal); + List result = []; + + foreach (var column in columns) + { + var resolved = ResolveToStoredColumn(column, table, resource); + + if (seen.Add(resolved.Value)) + { + result.Add(resolved); + } + } + + return result.ToArray(); + } + + /// + /// Resolves a column name to its canonical stored column. If the column is a unified alias + /// (persisted computed column), returns the canonical storage column; otherwise returns the + /// column itself. + /// + /// + /// This is required for MSSQL trigger guards (UPDATE()) and propagation targets + /// (SET r.[col]), which SQL Server rejects for computed columns + /// (Msg 2114 and Msg 271 respectively). + /// + private static DbColumnName ResolveToStoredColumn( + DbColumnName column, + DbTableModel table, + QualifiedResourceName resource + ) + { + var columnModel = table.Columns.FirstOrDefault(c => c.ColumnName == column); + + if (columnModel is null) + { + throw new InvalidOperationException( + $"Trigger derivation for resource '{FormatResource(resource)}': column " + + $"'{column.Value}' not found on table " + + $"'{table.Table.Schema.Value}.{table.Table.Name}'." + ); + } + + return columnModel.Storage switch + { + ColumnStorage.UnifiedAlias alias => alias.CanonicalColumn, + _ => columnModel.ColumnName, + }; + } } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ExtensionTableDerivationPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ExtensionTableDerivationPass.cs index cdfe26225..6f1fd0cf9 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ExtensionTableDerivationPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ExtensionTableDerivationPass.cs @@ -16,6 +16,26 @@ public sealed class ExtensionTableDerivationPass : IRelationalModelSetPass { private const string ExtensionPropertyName = "_ext"; + /// + /// Immutable context threaded through the recursive schema walk. Groups parameters that remain + /// constant for the lifetime of a single extension-table derivation. + /// + private sealed record ExtensionWalkContext( + RelationalModelBuilderContext BuilderContext, + INameOverrideProvider OverrideProvider, + string ResourceLabel, + ProjectSchemaInfo ExtensionProject, + string BaseRootBaseName, + string ExtensionRootBaseName, + IReadOnlyDictionary BaseTablesByScope, + Dictionary ExtensionTablesByScope, + HashSet IdentityPaths, + IReadOnlySet ReferenceIdentityPaths, + IReadOnlySet ReferenceObjectPaths, + HashSet UsedDescriptorPaths, + List DescriptorEdgeSources + ); + /// /// Executes extension table derivation across all resource-extension schemas. /// @@ -180,13 +200,7 @@ ProjectSchemaInfo extensionProject var usedDescriptorPaths = new HashSet(StringComparer.Ordinal); List descriptorEdgeSources = []; - WalkSchema( - rootSchema, - tableBuilder: null, - [], - [], - "$", - hasOptionalAncestor: false, + var walkContext = new ExtensionWalkContext( extensionContext, overrideProvider, resourceLabel, @@ -202,11 +216,13 @@ ProjectSchemaInfo extensionProject descriptorEdgeSources ); + WalkSchema(rootSchema, tableBuilder: null, [], [], "$", hasOptionalAncestor: false, walkContext); + EnsureAllDescriptorPathsUsed(extensionContext, usedDescriptorPaths); var orderedTables = extensionTablesByScope .Values.Select(builder => builder.Build()) - .OrderBy(table => CountArrayDepth(table.JsonScope)) + .OrderBy(table => SetPassHelpers.CountArrayDepth(table.JsonScope)) .ThenBy(table => table.JsonScope.Canonical, StringComparer.Ordinal) .ToArray(); @@ -244,19 +260,7 @@ private static void WalkSchema( List columnSegments, string schemaPath, bool hasOptionalAncestor, - RelationalModelBuilderContext context, - INameOverrideProvider overrideProvider, - string resourceLabel, - ProjectSchemaInfo extensionProject, - string baseRootBaseName, - string extensionRootBaseName, - IReadOnlyDictionary baseTablesByScope, - Dictionary extensionTablesByScope, - HashSet identityPaths, - IReadOnlySet referenceIdentityPaths, - IReadOnlySet referenceObjectPaths, - HashSet usedDescriptorPaths, - List descriptorEdgeSources + ExtensionWalkContext ctx ) { var schemaKind = JsonSchemaTraversalConventions.DetermineSchemaKind(schema); @@ -271,41 +275,11 @@ List descriptorEdgeSources columnSegments, schemaPath, hasOptionalAncestor, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); break; case SchemaKind.Array: - WalkArraySchema( - schema, - tableBuilder, - pathSegments, - schemaPath, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources - ); + WalkArraySchema(schema, tableBuilder, pathSegments, schemaPath, ctx); break; case SchemaKind.Scalar: var currentPath = JsonPathExpressionCompiler.FromSegments(pathSegments).Canonical; @@ -325,19 +299,7 @@ private static void WalkObjectSchema( List columnSegments, string schemaPath, bool hasOptionalAncestor, - RelationalModelBuilderContext context, - INameOverrideProvider overrideProvider, - string resourceLabel, - ProjectSchemaInfo extensionProject, - string baseRootBaseName, - string extensionRootBaseName, - IReadOnlyDictionary baseTablesByScope, - Dictionary extensionTablesByScope, - HashSet identityPaths, - IReadOnlySet referenceIdentityPaths, - IReadOnlySet referenceObjectPaths, - HashSet usedDescriptorPaths, - List descriptorEdgeSources + ExtensionWalkContext ctx ) { if (!schema.TryGetPropertyValue("properties", out var propertiesNode) || propertiesNode is null) @@ -353,7 +315,7 @@ List descriptorEdgeSources } var requiredProperties = GetRequiredProperties(schema, pathSegments); - var isReferenceScope = referenceObjectPaths.Contains(scopePath); + var isReferenceScope = ctx.ReferenceObjectPaths.Contains(scopePath); foreach (var property in propertiesObject.OrderBy(entry => entry.Key, StringComparer.Ordinal)) { @@ -374,19 +336,7 @@ List descriptorEdgeSources schemaPath, requiredProperties, hasOptionalAncestor, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); continue; } @@ -420,27 +370,15 @@ List descriptorEdgeSources propertyColumnSegments, propertySchemaPath, nextHasOptionalAncestor, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); break; case SchemaKind.Scalar: if (tableBuilder is null) { - if (context.TryGetDescriptorPath(propertyPath, out _)) + if (ctx.BuilderContext.TryGetDescriptorPath(propertyPath, out _)) { - usedDescriptorPaths.Add(propertyPath.Canonical); + ctx.UsedDescriptorPaths.Add(propertyPath.Canonical); } continue; @@ -452,13 +390,7 @@ List descriptorEdgeSources propertyColumnSegments, propertyPath, isNullable, - context, - overrideProvider, - resourceLabel, - identityPaths, - referenceIdentityPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); break; default: @@ -477,19 +409,7 @@ private static void HandleExtensionProperty( string schemaPath, HashSet requiredProperties, bool hasOptionalAncestor, - RelationalModelBuilderContext context, - INameOverrideProvider overrideProvider, - string resourceLabel, - ProjectSchemaInfo extensionProject, - string baseRootBaseName, - string extensionRootBaseName, - IReadOnlyDictionary baseTablesByScope, - Dictionary extensionTablesByScope, - HashSet identityPaths, - IReadOnlySet referenceIdentityPaths, - IReadOnlySet referenceObjectPaths, - HashSet usedDescriptorPaths, - List descriptorEdgeSources + ExtensionWalkContext ctx ) { if ( @@ -509,7 +429,7 @@ List descriptorEdgeSources ); } - var projectKey = ResolveExtensionProjectKey(projectKeysObject, extensionProject, schemaPath); + var projectKey = ResolveExtensionProjectKey(projectKeysObject, ctx.ExtensionProject, schemaPath); if (!projectKeysObject.TryGetPropertyValue(projectKey, out var projectSchemaNode)) { @@ -554,17 +474,17 @@ List descriptorEdgeSources owningScopeSegments, projectKey, projectPath, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - extensionProject, - overrideProvider, - resourceLabel, - context.OverrideCollisionDetector, - string.IsNullOrWhiteSpace(context.SuperclassResourceName) + ctx.BaseRootBaseName, + ctx.ExtensionRootBaseName, + ctx.BaseTablesByScope, + ctx.ExtensionTablesByScope, + ctx.ExtensionProject, + ctx.OverrideProvider, + ctx.ResourceLabel, + ctx.BuilderContext.OverrideCollisionDetector, + string.IsNullOrWhiteSpace(ctx.BuilderContext.SuperclassResourceName) ? null - : RelationalNameConventions.ToPascalCase(context.SuperclassResourceName) + : RelationalNameConventions.ToPascalCase(ctx.BuilderContext.SuperclassResourceName) ); WalkSchema( @@ -574,19 +494,7 @@ List descriptorEdgeSources [], projectSchemaPath, projectHasOptionalAncestor, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); } @@ -599,19 +507,7 @@ private static void WalkArraySchema( ExtensionTableBuilder? tableBuilder, List propertySegments, string schemaPath, - RelationalModelBuilderContext context, - INameOverrideProvider overrideProvider, - string resourceLabel, - ProjectSchemaInfo extensionProject, - string baseRootBaseName, - string extensionRootBaseName, - IReadOnlyDictionary baseTablesByScope, - Dictionary extensionTablesByScope, - HashSet identityPaths, - IReadOnlySet referenceIdentityPaths, - IReadOnlySet referenceObjectPaths, - HashSet usedDescriptorPaths, - List descriptorEdgeSources + ExtensionWalkContext ctx ) { var arrayPath = JsonPathExpressionCompiler.FromSegments(propertySegments).Canonical; @@ -642,7 +538,7 @@ List descriptorEdgeSources var parentSuffix = tableBuilder is null ? string.Empty : string.Concat(tableBuilder.CollectionBaseNames); - var hasOverride = overrideProvider.TryGetNameOverride( + var hasOverride = ctx.OverrideProvider.TryGetNameOverride( arrayPathExpression, NameOverrideKind.Collection, out var overrideName @@ -661,19 +557,7 @@ out var overrideName [], itemsSchemaPath, hasOptionalAncestor: false, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); return; } @@ -682,9 +566,9 @@ out var overrideName { var elementPath = JsonPathExpressionCompiler.FromSegments(arraySegments); - if (context.TryGetDescriptorPath(elementPath, out _)) + if (ctx.BuilderContext.TryGetDescriptorPath(elementPath, out _)) { - usedDescriptorPaths.Add(elementPath.Canonical); + ctx.UsedDescriptorPaths.Add(elementPath.Canonical); } } @@ -695,16 +579,16 @@ out var overrideName if (hasOverride) { - var superclassBaseName = string.IsNullOrWhiteSpace(context.SuperclassResourceName) + var superclassBaseName = string.IsNullOrWhiteSpace(ctx.BuilderContext.SuperclassResourceName) ? null - : RelationalNameConventions.ToPascalCase(context.SuperclassResourceName); + : RelationalNameConventions.ToPascalCase(ctx.BuilderContext.SuperclassResourceName); var includeSuperclass = !string.IsNullOrWhiteSpace(superclassBaseName) && !string.Equals(overrideName, defaultCollectionBaseName, StringComparison.Ordinal); var impliedPrefixes = RelationalModelSetSchemaHelpers.BuildCollectionOverridePrefixes( - extensionRootBaseName, + ctx.ExtensionRootBaseName, parentSuffix, - baseRootBaseName, + ctx.BaseRootBaseName, includeSuperclass ? superclassBaseName : null ); @@ -712,7 +596,7 @@ out var overrideName overrideName, impliedPrefixes, arrayPathExpression.Canonical, - resourceLabel + ctx.ResourceLabel ); } @@ -725,38 +609,26 @@ out var overrideName [], itemsSchemaPath, hasOptionalAncestor: false, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); return; } - if (!extensionTablesByScope.TryGetValue(arrayScope, out var childTable)) + if (!ctx.ExtensionTablesByScope.TryGetValue(arrayScope, out var childTable)) { childTable = CreateChildTableBuilder( tableBuilder, propertySegments, arraySegments, - baseRootBaseName, - extensionRootBaseName, - extensionProject, + ctx.BaseRootBaseName, + ctx.ExtensionRootBaseName, + ctx.ExtensionProject, collectionBaseName, defaultCollectionBaseName, - context.OverrideCollisionDetector, - resourceLabel + ctx.BuilderContext.OverrideCollisionDetector, + ctx.ResourceLabel ); - extensionTablesByScope[arrayScope] = childTable; + ctx.ExtensionTablesByScope[arrayScope] = childTable; } switch (itemsKind) @@ -769,35 +641,11 @@ out var overrideName [], itemsSchemaPath, hasOptionalAncestor: false, - context, - overrideProvider, - resourceLabel, - extensionProject, - baseRootBaseName, - extensionRootBaseName, - baseTablesByScope, - extensionTablesByScope, - identityPaths, - referenceIdentityPaths, - referenceObjectPaths, - usedDescriptorPaths, - descriptorEdgeSources + ctx ); break; case SchemaKind.Scalar: - AddDescriptorArrayColumn( - childTable, - itemsSchema, - propertySegments, - arraySegments, - context, - overrideProvider, - resourceLabel, - identityPaths, - referenceIdentityPaths, - usedDescriptorPaths, - descriptorEdgeSources - ); + AddDescriptorArrayColumn(childTable, itemsSchema, propertySegments, arraySegments, ctx); break; case SchemaKind.Array: throw new InvalidOperationException($"Array schema items must be an object at {arrayPath}."); @@ -1200,18 +1048,12 @@ private static void AddDescriptorArrayColumn( JsonObject itemsSchema, List propertySegments, List arraySegments, - RelationalModelBuilderContext context, - INameOverrideProvider overrideProvider, - string resourceLabel, - HashSet identityPaths, - IReadOnlySet referenceIdentityPaths, - HashSet usedDescriptorPaths, - List descriptorEdgeSources + ExtensionWalkContext ctx ) { var elementPath = JsonPathExpressionCompiler.FromSegments(arraySegments); - if (!context.TryGetDescriptorPath(elementPath, out _)) + if (!ctx.BuilderContext.TryGetDescriptorPath(elementPath, out _)) { var arrayPath = JsonPathExpressionCompiler.FromSegments(propertySegments).Canonical; @@ -1221,20 +1063,7 @@ List descriptorEdgeSources var columnSegments = BuildDescriptorArrayColumnSegments(propertySegments); var isNullable = IsXNullable(itemsSchema, elementPath.Canonical); - AddScalarOrDescriptorColumn( - tableBuilder, - itemsSchema, - columnSegments, - elementPath, - isNullable, - context, - overrideProvider, - resourceLabel, - identityPaths, - referenceIdentityPaths, - usedDescriptorPaths, - descriptorEdgeSources - ); + AddScalarOrDescriptorColumn(tableBuilder, itemsSchema, columnSegments, elementPath, isNullable, ctx); } /// @@ -1264,29 +1093,23 @@ private static void AddScalarOrDescriptorColumn( IReadOnlyList columnSegments, JsonPathExpression sourcePath, bool isNullable, - RelationalModelBuilderContext context, - INameOverrideProvider overrideProvider, - string resourceLabel, - HashSet identityPaths, - IReadOnlySet referenceIdentityPaths, - HashSet usedDescriptorPaths, - List descriptorEdgeSources + ExtensionWalkContext ctx ) { - if (referenceIdentityPaths.Contains(sourcePath.Canonical)) + if (ctx.ReferenceIdentityPaths.Contains(sourcePath.Canonical)) { - if (context.TryGetDescriptorPath(sourcePath, out _)) + if (ctx.BuilderContext.TryGetDescriptorPath(sourcePath, out _)) { - usedDescriptorPaths.Add(sourcePath.Canonical); + ctx.UsedDescriptorPaths.Add(sourcePath.Canonical); } return; } - if (context.TryGetDescriptorPath(sourcePath, out var descriptorPathInfo)) + if (ctx.BuilderContext.TryGetDescriptorPath(sourcePath, out var descriptorPathInfo)) { var descriptorBaseName = ResolveColumnBaseName( - overrideProvider, + ctx.OverrideProvider, sourcePath, columnSegments, out var originalDescriptorBaseName @@ -1311,12 +1134,12 @@ out var originalDescriptorBaseName tableBuilder.Definition.Table, columnName, descriptorPathInfo.DescriptorValuePath, - resourceLabel + ctx.ResourceLabel ) ); - var isIdentityComponent = identityPaths.Contains(sourcePath.Canonical); - descriptorEdgeSources.Add( + var isIdentityComponent = ctx.IdentityPaths.Contains(sourcePath.Canonical); + ctx.DescriptorEdgeSources.Add( new DescriptorEdgeSource( isIdentityComponent, descriptorPathInfo.DescriptorValuePath, @@ -1326,13 +1149,13 @@ out var originalDescriptorBaseName ) ); - usedDescriptorPaths.Add(sourcePath.Canonical); + ctx.UsedDescriptorPaths.Add(sourcePath.Canonical); return; } - var scalarType = ResolveScalarType(schema, sourcePath, context); + var scalarType = ResolveScalarType(schema, sourcePath, ctx.BuilderContext); var scalarBaseName = ResolveColumnBaseName( - overrideProvider, + ctx.OverrideProvider, sourcePath, columnSegments, out var originalBaseName @@ -1353,7 +1176,7 @@ out var originalBaseName tableBuilder.Definition.Table, scalarColumn.ColumnName, sourcePath, - resourceLabel + ctx.ResourceLabel ) ); } @@ -1765,14 +1588,6 @@ HashSet usedDescriptorPaths ); } - /// - /// Counts the number of wildcard array segments in a scope path. - /// - private static int CountArrayDepth(JsonPathExpression scope) - { - return scope.Segments.Count(segment => segment is JsonPathSegment.AnyArrayElement); - } - /// /// Builds the root table key for an extension table aligned to the base root scope. /// @@ -1880,11 +1695,6 @@ private static RelationalScalarType ResolveKeyColumnScalarType(DbKeyColumn keyCo }; } - /// - /// Captures the index and model for a base (non-extension) resource used when resolving extensions. - /// - private sealed record BaseResourceEntry(int Index, ConcreteResourceModel Model); - /// /// Captures the derived extension table models and descriptor edge sources for an extension resource. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/KeyUnificationPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/KeyUnificationPass.cs index e549eb918..0e73cc65b 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/KeyUnificationPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/KeyUnificationPass.cs @@ -124,12 +124,12 @@ private static IReadOnlyList ReadEqualityConstraints(Js { if (!resourceSchema.TryGetPropertyValue("equalityConstraints", out var equalityConstraintsNode)) { - return Array.Empty(); + return []; } if (equalityConstraintsNode is null) { - return Array.Empty(); + return []; } if (equalityConstraintsNode is not JsonArray equalityConstraintsArray) @@ -1307,11 +1307,6 @@ private static string ComputeHash8(string text) return Convert.ToHexString(hash.AsSpan(0, 4)).ToLowerInvariant(); } - /// - /// Base resource entry used when resolving extension schemas. - /// - private sealed record BaseResourceEntry(int Index, ConcreteResourceModel Model); - /// /// Parsed equality-constraint endpoints. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceBindingPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceBindingPass.cs index ad687acee..2b6fa6abc 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceBindingPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceBindingPass.cs @@ -368,11 +368,6 @@ private static bool IsDescriptorIdentityPath(JsonPathExpression identityJsonPath && property.Name.EndsWith("Descriptor", StringComparison.Ordinal); } - /// - /// Captures the index and model for a base (non-extension) resource used when resolving extensions. - /// - private sealed record BaseResourceEntry(int Index, ConcreteResourceModel Model); - /// /// Captures a table scope and its accumulator for prefix matching against reference object paths. /// diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceConstraintPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceConstraintPass.cs index 025449197..95bf66182 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceConstraintPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceConstraintPass.cs @@ -639,7 +639,7 @@ out ReferenceIdentityBinding? identityBinding return true; } - identityBinding = default!; + identityBinding = null; return false; } diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/SetPassHelpers.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/SetPassHelpers.cs new file mode 100644 index 000000000..46d1fe0e6 --- /dev/null +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/SetPassHelpers.cs @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: Apache-2.0 +// Licensed to the Ed-Fi Alliance under one or more agreements. +// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +// See the LICENSE and NOTICES files in the project root for more information. + +namespace EdFi.DataManagementService.Backend.RelationalModel.SetPasses; + +/// +/// Shared helper types and methods used across multiple set-level derivation passes. +/// +internal static class SetPassHelpers +{ + /// + /// Counts the number of array wildcard segments in the scope, used for depth-first ordering. + /// + internal static int CountArrayDepth(JsonPathExpression scope) + { + return scope.Segments.Count(segment => segment is JsonPathSegment.AnyArrayElement); + } +} + +/// +/// Captures a concrete resource model and its index within the builder's canonical resource ordering. +/// Used by multiple set passes that need to track both the model and its positional index. +/// +internal sealed record BaseResourceEntry(int Index, ConcreteResourceModel Model); diff --git a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ValidateForeignKeyStorageInvariantPass.cs b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ValidateForeignKeyStorageInvariantPass.cs index c2445fc92..044e2979d 100644 --- a/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ValidateForeignKeyStorageInvariantPass.cs +++ b/src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ValidateForeignKeyStorageInvariantPass.cs @@ -96,15 +96,29 @@ RelationalModelSetBuilderContext context { Dictionary tablesByName = new(); + // Concrete resources may share a physical table (e.g., descriptors share dms.Descriptor), + // so we use DistinctBy to avoid processing the same physical table more than once. foreach ( var table in context .ConcreteResourcesInNameOrder.SelectMany(resource => resource.RelationalModel.TablesInDependencyOrder ) - .Concat(context.AbstractIdentityTablesInNameOrder.Select(table => table.TableModel)) + .DistinctBy(t => t.Table) ) { - tablesByName.TryAdd(table.Table, table); + tablesByName.Add(table.Table, table); + } + + foreach (var abstractTable in context.AbstractIdentityTablesInNameOrder) + { + if (!tablesByName.TryAdd(abstractTable.TableModel.Table, abstractTable.TableModel)) + { + throw new InvalidOperationException( + $"Duplicate table name '{abstractTable.TableModel.Table.Schema.Value}.{abstractTable.TableModel.Table.Name}' " + + "encountered during foreign key storage validation. " + + "This indicates a naming collision in the derived model set." + ); + } } return tablesByName; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql.Tests.Integration/UpdateTests.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql.Tests.Integration/UpdateTests.cs index 96a9382dd..5ff562354 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql.Tests.Integration/UpdateTests.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql.Tests.Integration/UpdateTests.cs @@ -4,13 +4,13 @@ // See the LICENSE and NOTICES files in the project root for more information. using System.Globalization; -using EdFi.DataManagementService.Old.Postgresql.Model; +using EdFi.DataManagementService.Backend; using EdFi.DataManagementService.Core.External.Backend; using EdFi.DataManagementService.Core.External.Model; +using EdFi.DataManagementService.Old.Postgresql.Model; using FluentAssertions; using Npgsql; using NUnit.Framework; -using EdFi.DataManagementService.Backend; namespace EdFi.DataManagementService.Old.Postgresql.Tests.Integration; @@ -709,9 +709,9 @@ public async Task Setup() "_lastModifiedDate": "2024-10-29T14:54:49+00:00" } """, - CreateDocumentReferences( - [new("CourseOffering", sessionUpsertRequest.DocumentInfo.ReferentialId.Value)] - ), + CreateDocumentReferences([ + new("CourseOffering", sessionUpsertRequest.DocumentInfo.ReferentialId.Value), + ]), traceId: new("courseOfferingUpsertRequest") ); @@ -747,9 +747,9 @@ public async Task Setup() } } """, - CreateDocumentReferences( - [new("Section", courseOfferingUpsertRequest.DocumentInfo.ReferentialId.Value)] - ), + CreateDocumentReferences([ + new("Section", courseOfferingUpsertRequest.DocumentInfo.ReferentialId.Value), + ]), traceId: new("section1UpsertRequest") ); @@ -770,9 +770,9 @@ public async Task Setup() } } """, - documentReferences: CreateDocumentReferences( - [new("Section", courseOfferingUpsertRequest.DocumentInfo.ReferentialId.Value)] - ), + documentReferences: CreateDocumentReferences([ + new("Section", courseOfferingUpsertRequest.DocumentInfo.ReferentialId.Value), + ]), traceId: new("section2UpsertRequest") ); @@ -954,9 +954,9 @@ public async Task Setup() [], [] ), - documentReferences: CreateDocumentReferences( - [new("Location", locationUpsertRequest.DocumentInfo.ReferentialId.Value)] - ) + documentReferences: CreateDocumentReferences([ + new("Location", locationUpsertRequest.DocumentInfo.ReferentialId.Value), + ]) ); await CreateUpsert().Upsert(xyzUpsertRequest, Connection!, Transaction!); diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/DocumentAuthorizationHelper.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/DocumentAuthorizationHelper.cs index 8668240a6..561fcbe42 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/DocumentAuthorizationHelper.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/DocumentAuthorizationHelper.cs @@ -4,9 +4,9 @@ // See the LICENSE and NOTICES files in the project root for more information. using System.Text.Json; -using EdFi.DataManagementService.Old.Postgresql.Operation; using EdFi.DataManagementService.Core.External.Backend; using EdFi.DataManagementService.Core.External.Model; +using EdFi.DataManagementService.Old.Postgresql.Operation; using Npgsql; namespace EdFi.DataManagementService.Old.Postgresql; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/ISqlAction.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/ISqlAction.cs index 49bdf5eed..bc2ef0929 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/ISqlAction.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/ISqlAction.cs @@ -6,11 +6,11 @@ using System.Text.Json; using System.Text.Json.Nodes; using System.Threading; -using EdFi.DataManagementService.Old.Postgresql.Model; +using EdFi.DataManagementService.Backend; using EdFi.DataManagementService.Core.External.Backend; using EdFi.DataManagementService.Core.External.Model; +using EdFi.DataManagementService.Old.Postgresql.Model; using Npgsql; -using EdFi.DataManagementService.Backend; namespace EdFi.DataManagementService.Old.Postgresql.Operation; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpdateDocumentById.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpdateDocumentById.cs index 98c188125..f4a46b90c 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpdateDocumentById.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpdateDocumentById.cs @@ -5,9 +5,9 @@ using System.Text.Json; using System.Text.Json.Nodes; -using EdFi.DataManagementService.Old.Postgresql.Model; using EdFi.DataManagementService.Core.External.Backend; using EdFi.DataManagementService.Core.External.Model; +using EdFi.DataManagementService.Old.Postgresql.Model; using Json.More; using Json.Path; using Microsoft.Extensions.Logging; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpsertDocument.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpsertDocument.cs index c7bb24bc8..190c4ccaa 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpsertDocument.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/Operation/UpsertDocument.cs @@ -4,9 +4,9 @@ // See the LICENSE and NOTICES files in the project root for more information. using System.Text.Json; -using EdFi.DataManagementService.Old.Postgresql.Model; using EdFi.DataManagementService.Core.External.Backend; using EdFi.DataManagementService.Core.External.Model; +using EdFi.DataManagementService.Old.Postgresql.Model; using Json.Path; using Microsoft.Extensions.Logging; using Npgsql; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlDocumentStoreRepository.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlDocumentStoreRepository.cs index a0ea5a8cb..bbf3df9b3 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlDocumentStoreRepository.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlDocumentStoreRepository.cs @@ -4,13 +4,13 @@ // See the LICENSE and NOTICES files in the project root for more information. using System.Data; -using EdFi.DataManagementService.Old.Postgresql.Operation; +using EdFi.DataManagementService.Backend; using EdFi.DataManagementService.Core.External.Backend; using EdFi.DataManagementService.Core.External.Interface; +using EdFi.DataManagementService.Old.Postgresql.Operation; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Npgsql; -using EdFi.DataManagementService.Backend; namespace EdFi.DataManagementService.Old.Postgresql; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlServiceExtensions.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlServiceExtensions.cs index 22e4a2bfd..cced540e1 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlServiceExtensions.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/PostgresqlServiceExtensions.cs @@ -3,8 +3,8 @@ // The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. // See the LICENSE and NOTICES files in the project root for more information. -using EdFi.DataManagementService.Old.Postgresql.Operation; using EdFi.DataManagementService.Core.External.Interface; +using EdFi.DataManagementService.Old.Postgresql.Operation; using Microsoft.Extensions.DependencyInjection; namespace EdFi.DataManagementService.Old.Postgresql; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/ReferenceHelper.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/ReferenceHelper.cs index a1ee6bdfd..db11aa17b 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/ReferenceHelper.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/ReferenceHelper.cs @@ -3,9 +3,9 @@ // The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. // See the LICENSE and NOTICES files in the project root for more information. -using EdFi.DataManagementService.Old.Postgresql.Model; -using EdFi.DataManagementService.Core.External.Model; using EdFi.DataManagementService.Backend; +using EdFi.DataManagementService.Core.External.Model; +using EdFi.DataManagementService.Old.Postgresql.Model; namespace EdFi.DataManagementService.Old.Postgresql; diff --git a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/SecurityHelper.cs b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/SecurityHelper.cs index fce243d82..7daffe35d 100644 --- a/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/SecurityHelper.cs +++ b/src/dms/backend/EdFi.DataManagementService.Old.Postgresql/SecurityHelper.cs @@ -61,19 +61,22 @@ public static DocumentSecurityElements ToDocumentSecurityElements(this JsonEleme new MetaEdPropertyFullName(eo!["PropertyName"]!.GetValue()), new EducationOrganizationId(long.Parse(eo["Id"]!.GetValue())) )) - .ToArray() ?? []; + .ToArray() + ?? []; StudentUniqueId[] studentUniqueId = jsonObject["Student"] ?.AsArray() .Select(id => new StudentUniqueId(id!.GetValue())) - .ToArray() ?? []; + .ToArray() + ?? []; ContactUniqueId[] contactUniqueId = jsonObject["Contact"] ?.AsArray() .Select(id => new ContactUniqueId(id!.GetValue())) - .ToArray() ?? []; + .ToArray() + ?? []; StaffUniqueId[] staffUniqueId = jsonObject["Staff"]?.AsArray().Select(id => new StaffUniqueId(id!.GetValue())).ToArray() diff --git a/trigger-index-findings.md b/trigger-index-findings.md deleted file mode 100644 index 7e9ee59a0..000000000 --- a/trigger-index-findings.md +++ /dev/null @@ -1,180 +0,0 @@ -# Trigger + Index Findings for Key Unification (post DMS-945 / commit 24655fe972409888) - -This note captures gaps between the **key unification** design (`reference/design/backend-redesign/design-docs/key-unification.md`) -and the now-landed **index/trigger inventory derivation** implementation added in commit `24655fe972409888` (DMS-945). - -Scope: trigger/index **support needed for key unification**, given the current `DeriveIndexInventoryPass` / -`DeriveTriggerInventoryPass` contracts and behaviors. - -## 1) SQL Server cascade vs fallback strategy mismatch - -Key unification’s design assumes: - -- SQL Server should **attempt** declarative `ON UPDATE CASCADE` for eligible reference FKs, and -- only emit trigger-based propagation fallback **when SQL Server rejects** the FK graph due to multiple-cascade-path/cycle restrictions. - -However, the current relational-model derivation unconditionally disables update cascades for *all* reference FKs on MSSQL: - -- `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/ReferenceConstraintPass.cs` (see `onUpdate` selection around `SqlDialect.Mssql ? ReferentialAction.NoAction : ...`). - -Implications / required design update: - -- `key-unification.md` should be updated to reflect the current “**always `NO ACTION` on MSSQL + always trigger-based propagation fallback**” strategy, **or** -- the implementation should be changed back to “try cascade, fallback on rejection” if that remains the intended design. - -## 2) IdentityPropagationFallback trigger “owning table” ambiguity (and likely inversion) - -To replace `ON UPDATE CASCADE`, an identity-propagation fallback trigger must fire when the **referenced/target** row’s -identity columns change, and then update **referrer** rows. - -But the current trigger intent derivation records propagation triggers as owned by the **referrer** table: - -- `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs` - - `DbTriggerInfo.Table` is set to the referrer root table. - - `DbTriggerInfo.TargetTable` is set to the referenced resource root or abstract identity table. -- The unit tests explicitly lock this in: - - `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel.Tests.Unit/DeriveTriggerInventoryPassTests.cs` asserts (for example) that `TR_Enrollment_Propagation_School` has `Table.Name == "Enrollment"` and `TargetTable.Name == "School"`. - -This is a design gap for key unification (and for propagation generally), because DDL emission will eventually need to -know **which table the trigger is created on** vs **which table is being updated by the trigger**. Today the contract -does not model this clearly: - -- `DbTriggerInfo` documents `TargetTable` only for abstract identity maintenance, not propagation fallback: - - `src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs` -- The current DDL emitter always emits `CREATE TRIGGER ... ON `: - - `src/dms/backend/EdFi.DataManagementService.Backend.Ddl/RelationalModelDdlEmitter.cs` - -Required design clarification/change: - -- Define (in docs + contracts) what `Table` and `TargetTable` mean for `DbTriggerKind.IdentityPropagationFallback`. - - If the trigger truly fires on the referenced table, the contract likely needs an explicit `TriggerTable` and - `AffectedTable` (or similar), not a single ambiguous `Table`. - - If the current `DbTriggerInfo` shape is retained, the DDL emitter must be able to interpret propagation triggers as - “create trigger on `TargetTable` that updates `Table`”, which conflicts with current semantics for other trigger kinds. - -## 3) Propagation fallback must update canonical storage columns under unification - -Key unification requires trigger-based propagation fallback to update **canonical stored columns** for unified identity -parts (never the alias/binding columns), because unified member columns become computed/generated read-only aliases: - -- `reference/design/backend-redesign/design-docs/key-unification.md` (SQL Server fallback section; triggers must update canonicals) - -The current propagation-trigger intent records “propagated columns” as: - -- `binding.IdentityBindings.Select(ib => ib.Column)` in - `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs` - -Under key unification, those `ib.Column` values are exactly the *per-site binding column names* that are intended to -become unified aliases (read-only). There is no current mechanism in the trigger inventory contract to map these to -canonical storage columns. - -Required design update: - -- When key unification is introduced (`ColumnStorage` + canonical/alias metadata), propagation-trigger derivation or - DDL emission must map “binding columns” to **storage columns** (canonical) before generating trigger SQL. -- The design should also specify de-duplication behavior when multiple propagated binding columns map to the same canonical - column (common under unification). - -## 4) Identity projection columns: current derivation does not include propagated identity values - -The redesign’s referential-id recomputation and identity stamping depend on **locally stored identity columns**, -including **propagated reference identity values** for identity-component references: - -- `reference/design/backend-redesign/design-docs/overview.md` (referential ids recomputed from locally present identity columns, including propagated reference identity values) -- `reference/design/backend-redesign/design-docs/update-tracking.md` (identity projection includes reference identity values stored alongside identity-component references; canonical under key unification) - -But the current trigger inventory derives root `IdentityProjectionColumns` by reusing the *root unique-constraint* mapping logic: - -- `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs` uses - `BuildReferenceIdentityBindings(...)` and, when an `identityJsonPath` is sourced from a reference object path, it - adds **only** the reference FK column (`..._DocumentId`) to the identity projection set. -- This mirrors `RootIdentityConstraintPass` behavior: - - `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/RootIdentityConstraintPass.cs` - -That mapping is reasonable for the *relational guardrail* UNIQUE constraint (which intentionally uses stable -`..._DocumentId` columns), but it is insufficient for: - -- DB-side referential-id recomputation (UUIDv5 over identity values), and -- correct identity-stamp bumping when cascades (or fallback propagation) update propagated reference identity values while - `..._DocumentId` remains stable. - -Required design update: - -- Define a trigger-derivation identity-projection column set that is **not** the same as the root UNIQUE constraint’s - column set. -- For each `DocumentReferenceBinding` where `IsIdentityComponent == true` - (`src/dms/backend/EdFi.DataManagementService.Backend.External/RelationalModelTypes.cs`), - include the stored reference identity columns (`IdentityBindings[*].Column`) in the identity projection column list. -- Under key unification, those “identity projection values” must be interpreted as presence-gated unified-alias - expressions or directly compared via the alias column value-diff, not by “column updated” detection. - -## 5) “Identity columns changed” must be value-diff based under unified aliases - -Key unification introduces generated/computed alias columns whose values change when the canonical storage column -changes, even though alias columns are never written directly. Therefore, trigger implementations must not use -“column updated” detection for unified members, and must instead use **old vs new value-diff** semantics (null-safe) -based on the presence-gated canonical expression for unified aliases. - -Gaps exposed by DMS-945’s trigger inventory contract: - -- Story text and the current `DbTriggerInfo.IdentityProjectionColumns` documentation can be read as “use these columns - in `UPDATE OF (...)` / `IF UPDATE(...)` gating”: - - `reference/design/backend-redesign/epics/01-relational-model/07-index-and-trigger-inventory.md` - - `src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs` -- Key unification explicitly requires the opposite: value-diff gating for unified members. - -Required design update: - -- Update the “trigger inventory” story/design wording and the `DbTriggerInfo` contract documentation to explicitly state - that `IdentityProjectionColumns` are a **value-diff comparison set**, not an “updated columns” set. -- Ensure the eventual DDL emitter has enough metadata to compare unified values correctly (either by comparing the - computed alias column values directly, or by expanding `ColumnStorage.UnifiedAlias` to a presence-gated expression). - -## 6) Propagation fallback trigger coverage is root-table only - -`DeriveTriggerInventoryPass` only emits propagation fallback triggers for **root-table** reference bindings: - -- `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/SetPasses/DeriveTriggerInventoryPass.cs` filters - out bindings where `binding.Table` is not the resource root table. - -Under key unification and the broader redesign, references can exist in: - -- child/collection tables, and -- `_ext` extension tables. - -When referenced identities update, those tables’ propagated identity columns also need to be kept consistent on SQL -Server (since cascades are disabled there today), or representation/query semantics will drift from PostgreSQL. - -Required design update: - -- Specify whether SQL Server propagation fallback is required for non-root reference bindings, and if so, - extend inventory derivation to cover child/extension reference sites as well. - -## 7) Index inventory: filtered/partial indexes for unified predicate performance are not representable - -Key unification notes that if predicate rewriting from alias → canonical is not implemented, performance may require -additional indexes, preferably filtered/partial on the canonical column gated by presence (`P IS NOT NULL`). - -The current index-inventory contract cannot represent filtered/partial predicates: - -- `DbIndexInfo` is `{ Name, Table, KeyColumns, IsUnique, Kind }` only: - - `src/dms/backend/EdFi.DataManagementService.Backend.External/DerivedRelationalModelSetContracts.cs` - -Required design update (if this option remains on the table): - -- Either defer this entirely (and require predicate rewriting instead), or -- extend the index inventory model to represent dialect-specific filtered/partial index predicates in a SQL-free way. - -## 8) Minor documentation alignment: pass naming / ordering reference - -`key-unification.md` references an `IndexAndTriggerInventoryPass`, but the implementation is split into: - -- `DeriveIndexInventoryPass` -- `DeriveTriggerInventoryPass` - -See: - -- `src/dms/backend/EdFi.DataManagementService.Backend.RelationalModel/Build/RelationalModelSetPasses.cs` - -This should be updated in the key-unification doc to match the current pipeline shape. -