Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ODS-6044] Integrate latest 5.0 Data Standard Work - Set 1 #856

Merged
merged 11 commits into from
Oct 23, 2023
3,700 changes: 2,813 additions & 887 deletions Application/EdFi.Ods.Standard/Standard/5.0.0/Artifacts/Metadata/ApiModel.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,4 @@
}
]
}
]
]

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ CREATE TABLE [tracked_changes_edfi].[Grade]
OldGradingPeriodDescriptorId [INT] NOT NULL,
OldGradingPeriodDescriptorNamespace [NVARCHAR](255) NOT NULL,
OldGradingPeriodDescriptorCodeValue [NVARCHAR](50) NOT NULL,
OldGradingPeriodSequence [INT] NOT NULL,
OldGradingPeriodName [NVARCHAR](60) NOT NULL,
OldGradingPeriodSchoolYear [SMALLINT] NOT NULL,
OldLocalCourseCode [NVARCHAR](60) NOT NULL,
OldSchoolId [BIGINT] NOT NULL,
Expand All @@ -563,7 +563,7 @@ CREATE TABLE [tracked_changes_edfi].[Grade]
NewGradingPeriodDescriptorId [INT] NULL,
NewGradingPeriodDescriptorNamespace [NVARCHAR](255) NULL,
NewGradingPeriodDescriptorCodeValue [NVARCHAR](50) NULL,
NewGradingPeriodSequence [INT] NULL,
NewGradingPeriodName [NVARCHAR](60) NULL,
NewGradingPeriodSchoolYear [SMALLINT] NULL,
NewLocalCourseCode [NVARCHAR](60) NULL,
NewSchoolId [BIGINT] NULL,
Expand Down Expand Up @@ -597,13 +597,13 @@ CREATE TABLE [tracked_changes_edfi].[GradingPeriod]
OldGradingPeriodDescriptorId [INT] NOT NULL,
OldGradingPeriodDescriptorNamespace [NVARCHAR](255) NOT NULL,
OldGradingPeriodDescriptorCodeValue [NVARCHAR](50) NOT NULL,
OldPeriodSequence [INT] NOT NULL,
OldGradingPeriodName [NVARCHAR](60) NOT NULL,
OldSchoolId [BIGINT] NOT NULL,
OldSchoolYear [SMALLINT] NOT NULL,
NewGradingPeriodDescriptorId [INT] NULL,
NewGradingPeriodDescriptorNamespace [NVARCHAR](255) NULL,
NewGradingPeriodDescriptorCodeValue [NVARCHAR](50) NULL,
NewPeriodSequence [INT] NULL,
NewGradingPeriodName [NVARCHAR](60) NULL,
NewSchoolId [BIGINT] NULL,
NewSchoolYear [SMALLINT] NULL,
Id uniqueidentifier NOT NULL,
Expand Down Expand Up @@ -1065,7 +1065,7 @@ CREATE TABLE [tracked_changes_edfi].[ReportCard]
OldGradingPeriodDescriptorId [INT] NOT NULL,
OldGradingPeriodDescriptorNamespace [NVARCHAR](255) NOT NULL,
OldGradingPeriodDescriptorCodeValue [NVARCHAR](50) NOT NULL,
OldGradingPeriodSequence [INT] NOT NULL,
OldGradingPeriodName [NVARCHAR](60) NOT NULL,
OldGradingPeriodSchoolId [BIGINT] NOT NULL,
OldGradingPeriodSchoolYear [SMALLINT] NOT NULL,
OldStudentUSI [INT] NOT NULL,
Expand All @@ -1074,7 +1074,7 @@ CREATE TABLE [tracked_changes_edfi].[ReportCard]
NewGradingPeriodDescriptorId [INT] NULL,
NewGradingPeriodDescriptorNamespace [NVARCHAR](255) NULL,
NewGradingPeriodDescriptorCodeValue [NVARCHAR](50) NULL,
NewGradingPeriodSequence [INT] NULL,
NewGradingPeriodName [NVARCHAR](60) NULL,
NewGradingPeriodSchoolId [BIGINT] NULL,
NewGradingPeriodSchoolYear [SMALLINT] NULL,
NewStudentUSI [INT] NULL,
Expand Down Expand Up @@ -1512,7 +1512,7 @@ CREATE TABLE [tracked_changes_edfi].[StudentCompetencyObjective]
OldGradingPeriodDescriptorId [INT] NOT NULL,
OldGradingPeriodDescriptorNamespace [NVARCHAR](255) NOT NULL,
OldGradingPeriodDescriptorCodeValue [NVARCHAR](50) NOT NULL,
OldGradingPeriodSequence [INT] NOT NULL,
OldGradingPeriodName [NVARCHAR](60) NOT NULL,
OldGradingPeriodSchoolId [BIGINT] NOT NULL,
OldGradingPeriodSchoolYear [SMALLINT] NOT NULL,
OldObjectiveEducationOrganizationId [BIGINT] NOT NULL,
Expand All @@ -1525,7 +1525,7 @@ CREATE TABLE [tracked_changes_edfi].[StudentCompetencyObjective]
NewGradingPeriodDescriptorId [INT] NULL,
NewGradingPeriodDescriptorNamespace [NVARCHAR](255) NULL,
NewGradingPeriodDescriptorCodeValue [NVARCHAR](50) NULL,
NewGradingPeriodSequence [INT] NULL,
NewGradingPeriodName [NVARCHAR](60) NULL,
NewGradingPeriodSchoolId [BIGINT] NULL,
NewGradingPeriodSchoolYear [SMALLINT] NULL,
NewObjectiveEducationOrganizationId [BIGINT] NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ BEGIN

-- Handle key changes
INSERT INTO tracked_changes_edfi.Grade(
OldBeginDate, OldGradeTypeDescriptorId, OldGradeTypeDescriptorNamespace, OldGradeTypeDescriptorCodeValue, OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodSequence, OldGradingPeriodSchoolYear, OldLocalCourseCode, OldSchoolId, OldSchoolYear, OldSectionIdentifier, OldSessionName, OldStudentUSI, OldStudentUniqueId,
NewBeginDate, NewGradeTypeDescriptorId, NewGradeTypeDescriptorNamespace, NewGradeTypeDescriptorCodeValue, NewGradingPeriodDescriptorId, NewGradingPeriodDescriptorNamespace, NewGradingPeriodDescriptorCodeValue, NewGradingPeriodSequence, NewGradingPeriodSchoolYear, NewLocalCourseCode, NewSchoolId, NewSchoolYear, NewSectionIdentifier, NewSessionName, NewStudentUSI, NewStudentUniqueId,
OldBeginDate, OldGradeTypeDescriptorId, OldGradeTypeDescriptorNamespace, OldGradeTypeDescriptorCodeValue, OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodName, OldGradingPeriodSchoolYear, OldLocalCourseCode, OldSchoolId, OldSchoolYear, OldSectionIdentifier, OldSessionName, OldStudentUSI, OldStudentUniqueId,
NewBeginDate, NewGradeTypeDescriptorId, NewGradeTypeDescriptorNamespace, NewGradeTypeDescriptorCodeValue, NewGradingPeriodDescriptorId, NewGradingPeriodDescriptorNamespace, NewGradingPeriodDescriptorCodeValue, NewGradingPeriodName, NewGradingPeriodSchoolYear, NewLocalCourseCode, NewSchoolId, NewSchoolYear, NewSectionIdentifier, NewSessionName, NewStudentUSI, NewStudentUniqueId,
Id, ChangeVersion)
SELECT
d.BeginDate, d.GradeTypeDescriptorId, dj0.Namespace, dj0.CodeValue, d.GradingPeriodDescriptorId, dj1.Namespace, dj1.CodeValue, d.GradingPeriodSequence, d.GradingPeriodSchoolYear, d.LocalCourseCode, d.SchoolId, d.SchoolYear, d.SectionIdentifier, d.SessionName, d.StudentUSI, dj2.StudentUniqueId,
i.BeginDate, i.GradeTypeDescriptorId, ij0.Namespace, ij0.CodeValue, i.GradingPeriodDescriptorId, ij1.Namespace, ij1.CodeValue, i.GradingPeriodSequence, i.GradingPeriodSchoolYear, i.LocalCourseCode, i.SchoolId, i.SchoolYear, i.SectionIdentifier, i.SessionName, i.StudentUSI, ij2.StudentUniqueId,
d.BeginDate, d.GradeTypeDescriptorId, dj0.Namespace, dj0.CodeValue, d.GradingPeriodDescriptorId, dj1.Namespace, dj1.CodeValue, d.GradingPeriodName, d.GradingPeriodSchoolYear, d.LocalCourseCode, d.SchoolId, d.SchoolYear, d.SectionIdentifier, d.SessionName, d.StudentUSI, dj2.StudentUniqueId,
i.BeginDate, i.GradeTypeDescriptorId, ij0.Namespace, ij0.CodeValue, i.GradingPeriodDescriptorId, ij1.Namespace, ij1.CodeValue, i.GradingPeriodName, i.GradingPeriodSchoolYear, i.LocalCourseCode, i.SchoolId, i.SchoolYear, i.SectionIdentifier, i.SessionName, i.StudentUSI, ij2.StudentUniqueId,
d.Id, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d INNER JOIN inserted i ON d.Id = i.Id
INNER JOIN edfi.Descriptor dj0
Expand All @@ -507,7 +507,7 @@ BEGIN
ON i.StudentUSI = ij2.StudentUSI

WHERE
d.BeginDate <> i.BeginDate OR d.GradeTypeDescriptorId <> i.GradeTypeDescriptorId OR d.GradingPeriodDescriptorId <> i.GradingPeriodDescriptorId OR d.GradingPeriodSequence <> i.GradingPeriodSequence OR d.GradingPeriodSchoolYear <> i.GradingPeriodSchoolYear OR d.LocalCourseCode <> i.LocalCourseCode OR d.SchoolId <> i.SchoolId OR d.SchoolYear <> i.SchoolYear OR d.SectionIdentifier <> i.SectionIdentifier OR d.SessionName <> i.SessionName OR d.StudentUSI <> i.StudentUSI;
d.BeginDate <> i.BeginDate OR d.GradeTypeDescriptorId <> i.GradeTypeDescriptorId OR d.GradingPeriodDescriptorId <> i.GradingPeriodDescriptorId OR d.GradingPeriodName <> i.GradingPeriodName OR d.GradingPeriodSchoolYear <> i.GradingPeriodSchoolYear OR d.LocalCourseCode <> i.LocalCourseCode OR d.SchoolId <> i.SchoolId OR d.SchoolYear <> i.SchoolYear OR d.SectionIdentifier <> i.SectionIdentifier OR d.SessionName <> i.SessionName OR d.StudentUSI <> i.StudentUSI;
END
GO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2271,8 +2271,8 @@ BEGIN

SET NOCOUNT ON

INSERT INTO [tracked_changes_edfi].[Grade](OldBeginDate, OldGradeTypeDescriptorId, OldGradeTypeDescriptorNamespace, OldGradeTypeDescriptorCodeValue, OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodSequence, OldGradingPeriodSchoolYear, OldLocalCourseCode, OldSchoolId, OldSchoolYear, OldSectionIdentifier, OldSessionName, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion)
SELECT d.BeginDate, d.GradeTypeDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodDescriptorId, j1.Namespace, j1.CodeValue, d.GradingPeriodSequence, d.GradingPeriodSchoolYear, d.LocalCourseCode, d.SchoolId, d.SchoolYear, d.SectionIdentifier, d.SessionName, d.StudentUSI, j2.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
INSERT INTO [tracked_changes_edfi].[Grade](OldBeginDate, OldGradeTypeDescriptorId, OldGradeTypeDescriptorNamespace, OldGradeTypeDescriptorCodeValue, OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodName, OldGradingPeriodSchoolYear, OldLocalCourseCode, OldSchoolId, OldSchoolYear, OldSectionIdentifier, OldSessionName, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion)
SELECT d.BeginDate, d.GradeTypeDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodDescriptorId, j1.Namespace, j1.CodeValue, d.GradingPeriodName, d.GradingPeriodSchoolYear, d.LocalCourseCode, d.SchoolId, d.SchoolYear, d.SectionIdentifier, d.SessionName, d.StudentUSI, j2.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d
INNER JOIN edfi.Descriptor j0
ON d.GradeTypeDescriptorId = j0.DescriptorId
Expand Down Expand Up @@ -2401,8 +2401,8 @@ BEGIN

SET NOCOUNT ON

INSERT INTO [tracked_changes_edfi].[GradingPeriod](OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldPeriodSequence, OldSchoolId, OldSchoolYear, Id, Discriminator, ChangeVersion)
SELECT d.GradingPeriodDescriptorId, j0.Namespace, j0.CodeValue, d.PeriodSequence, d.SchoolId, d.SchoolYear, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
INSERT INTO [tracked_changes_edfi].[GradingPeriod](OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodName, OldSchoolId, OldSchoolYear, Id, Discriminator, ChangeVersion)
SELECT d.GradingPeriodDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodName, d.SchoolId, d.SchoolYear, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d
INNER JOIN edfi.Descriptor j0
ON d.GradingPeriodDescriptorId = j0.DescriptorId
Expand Down Expand Up @@ -4530,8 +4530,8 @@ BEGIN

SET NOCOUNT ON

INSERT INTO [tracked_changes_edfi].[ReportCard](OldEducationOrganizationId, OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodSequence, OldGradingPeriodSchoolId, OldGradingPeriodSchoolYear, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion)
SELECT d.EducationOrganizationId, d.GradingPeriodDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodSequence, d.GradingPeriodSchoolId, d.GradingPeriodSchoolYear, d.StudentUSI, j1.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
INSERT INTO [tracked_changes_edfi].[ReportCard](OldEducationOrganizationId, OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodName, OldGradingPeriodSchoolId, OldGradingPeriodSchoolYear, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion)
SELECT d.EducationOrganizationId, d.GradingPeriodDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodName, d.GradingPeriodSchoolId, d.GradingPeriodSchoolYear, d.StudentUSI, j1.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d
INNER JOIN edfi.Descriptor j0
ON d.GradingPeriodDescriptorId = j0.DescriptorId
Expand Down Expand Up @@ -4920,6 +4920,27 @@ ALTER TABLE [edfi].[SectionCharacteristicDescriptor] ENABLE TRIGGER [edfi_Sectio
GO


DROP TRIGGER IF EXISTS [edfi].[edfi_SectionTypeDescriptor_TR_DeleteTracking]
GO

CREATE TRIGGER [edfi].[edfi_SectionTypeDescriptor_TR_DeleteTracking] ON [edfi].[SectionTypeDescriptor] AFTER DELETE AS
BEGIN
IF @@rowcount = 0
RETURN

SET NOCOUNT ON

INSERT INTO [tracked_changes_edfi].[Descriptor](OldDescriptorId, OldCodeValue, OldNamespace, Id, Discriminator, ChangeVersion)
SELECT d.SectionTypeDescriptorId, b.CodeValue, b.Namespace, b.Id, 'edfi.SectionTypeDescriptor', (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d
INNER JOIN edfi.Descriptor b ON d.SectionTypeDescriptorId = b.DescriptorId
END
GO

ALTER TABLE [edfi].[SectionTypeDescriptor] ENABLE TRIGGER [edfi_SectionTypeDescriptor_TR_DeleteTracking]
GO


DROP TRIGGER IF EXISTS [edfi].[edfi_SeparationDescriptor_TR_DeleteTracking]
GO

Expand Down Expand Up @@ -5586,8 +5607,8 @@ BEGIN

SET NOCOUNT ON

INSERT INTO [tracked_changes_edfi].[StudentCompetencyObjective](OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodSequence, OldGradingPeriodSchoolId, OldGradingPeriodSchoolYear, OldObjectiveEducationOrganizationId, OldObjective, OldObjectiveGradeLevelDescriptorId, OldObjectiveGradeLevelDescriptorNamespace, OldObjectiveGradeLevelDescriptorCodeValue, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion)
SELECT d.GradingPeriodDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodSequence, d.GradingPeriodSchoolId, d.GradingPeriodSchoolYear, d.ObjectiveEducationOrganizationId, d.Objective, d.ObjectiveGradeLevelDescriptorId, j1.Namespace, j1.CodeValue, d.StudentUSI, j2.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
INSERT INTO [tracked_changes_edfi].[StudentCompetencyObjective](OldGradingPeriodDescriptorId, OldGradingPeriodDescriptorNamespace, OldGradingPeriodDescriptorCodeValue, OldGradingPeriodName, OldGradingPeriodSchoolId, OldGradingPeriodSchoolYear, OldObjectiveEducationOrganizationId, OldObjective, OldObjectiveGradeLevelDescriptorId, OldObjectiveGradeLevelDescriptorNamespace, OldObjectiveGradeLevelDescriptorCodeValue, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion)
SELECT d.GradingPeriodDescriptorId, j0.Namespace, j0.CodeValue, d.GradingPeriodName, d.GradingPeriodSchoolId, d.GradingPeriodSchoolYear, d.ObjectiveEducationOrganizationId, d.Objective, d.ObjectiveGradeLevelDescriptorId, j1.Namespace, j1.CodeValue, d.StudentUSI, j2.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d
INNER JOIN edfi.Descriptor j0
ON d.GradingPeriodDescriptorId = j0.DescriptorId
Expand Down Expand Up @@ -6019,6 +6040,27 @@ ALTER TABLE [edfi].[SubmissionStatusDescriptor] ENABLE TRIGGER [edfi_SubmissionS
GO


DROP TRIGGER IF EXISTS [edfi].[edfi_SupporterMilitaryConnectionDescriptor_TR_DeleteTracking]
GO

CREATE TRIGGER [edfi].[edfi_SupporterMilitaryConnectionDescriptor_TR_DeleteTracking] ON [edfi].[SupporterMilitaryConnectionDescriptor] AFTER DELETE AS
BEGIN
IF @@rowcount = 0
RETURN

SET NOCOUNT ON

INSERT INTO [tracked_changes_edfi].[Descriptor](OldDescriptorId, OldCodeValue, OldNamespace, Id, Discriminator, ChangeVersion)
SELECT d.SupporterMilitaryConnectionDescriptorId, b.CodeValue, b.Namespace, b.Id, 'edfi.SupporterMilitaryConnectionDescriptor', (NEXT VALUE FOR [changes].[ChangeVersionSequence])
FROM deleted d
INNER JOIN edfi.Descriptor b ON d.SupporterMilitaryConnectionDescriptorId = b.DescriptorId
END
GO

ALTER TABLE [edfi].[SupporterMilitaryConnectionDescriptor] ENABLE TRIGGER [edfi_SupporterMilitaryConnectionDescriptor_TR_DeleteTracking]
GO


DROP TRIGGER IF EXISTS [edfi].[edfi_Survey_TR_DeleteTracking]
GO

Expand Down
Loading