-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/58454 logon events and MI views (#2487)
* views to surface json data and sum distinct school logins * remove unused output * docs * surface more data from dfe signin * views --------- Co-authored-by: Mohsen Qureshi <[email protected]>
- Loading branch information
1 parent
627729e
commit 49bcb2a
Showing
13 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
db/migrations/schema-objects/20230404110400.do.admin-logon-event-urn-column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
IF NOT EXISTS( | ||
SELECT * | ||
FROM sys.columns | ||
WHERE object_ID = object_id('mtc_admin.adminLogonEvent') | ||
AND col_name(object_ID, column_Id) = 'urn') | ||
BEGIN | ||
ALTER TABLE [mtc_admin].[adminLogonEvent] | ||
ADD [urn] int NULL; | ||
END |
1 change: 1 addition & 0 deletions
1
db/migrations/schema-objects/20230404110400.undo.admin-logon-event-urn-column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE [mtc_admin].[adminLogonEvent] DROP COLUMN IF EXISTS [urn]; |
9 changes: 9 additions & 0 deletions
9
db/migrations/schema-objects/20230404110716.do.admin-logon-event-mtcrole-column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
IF NOT EXISTS( | ||
SELECT * | ||
FROM sys.columns | ||
WHERE object_ID = object_id('mtc_admin.adminLogonEvent') | ||
AND col_name(object_ID, column_Id) = 'mtcRole') | ||
BEGIN | ||
ALTER TABLE [mtc_admin].[adminLogonEvent] | ||
ADD [mtcRole] nvarchar(50) NULL; | ||
END |
1 change: 1 addition & 0 deletions
1
db/migrations/schema-objects/20230404110716.undo.admin-logon-event-mtcrole-column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE [mtc_admin].[adminLogonEvent] DROP COLUMN IF EXISTS [mtcRole]; |
9 changes: 9 additions & 0 deletions
9
db/migrations/schema-objects/20230404111132.do.admin-logon-event-dferole-column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
IF NOT EXISTS( | ||
SELECT * | ||
FROM sys.columns | ||
WHERE object_ID = object_id('mtc_admin.adminLogonEvent') | ||
AND col_name(object_ID, column_Id) = 'dfeRole') | ||
BEGIN | ||
ALTER TABLE [mtc_admin].[adminLogonEvent] | ||
ADD [dfeRole] nvarchar(max) NULL; | ||
END |
1 change: 1 addition & 0 deletions
1
db/migrations/schema-objects/20230404111132.undo.admin-logon-event-dferole-column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE [mtc_admin].[adminLogonEvent] DROP COLUMN IF EXISTS [dfeRole]; |
4 changes: 4 additions & 0 deletions
4
db/migrations/schema-objects/20230404112801.do.vew-mi-checks-with-errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE OR ALTER VIEW mtc_admin.[vewMiChecksWithErrors] AS | ||
SELECT COUNT(chk.id) as [numberOfChecksWithErrors] | ||
FROM [mtc_admin].[check] chk | ||
WHERE chk.processingFailed = 1 |
1 change: 1 addition & 0 deletions
1
db/migrations/schema-objects/20230404112801.undo.vew-mi-checks-with-errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP VIEW IF EXISTS mtc_admin.[vewMiChecksWithErrors]; |
4 changes: 4 additions & 0 deletions
4
db/migrations/schema-objects/20230404113200.do.vew-mi-checks-not-started.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE OR ALTER VIEW mtc_admin.[vewMiChecksNotStarted] AS | ||
SELECT COUNT(chk.id) as [numberOfChecksNotStarted] | ||
FROM [mtc_admin].[check] chk | ||
WHERE chk.startedAt IS NULL AND chk.isLiveCheck = 1 |
1 change: 1 addition & 0 deletions
1
db/migrations/schema-objects/20230404113200.undo.vew-mi-checks-not-started.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP VIEW IF EXISTS mtc_admin.[vewMiChecksNotStarted]; |
4 changes: 4 additions & 0 deletions
4
db/migrations/schema-objects/20230404115415.do.vew-mi-schools-logged-on-at-least-once.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE OR ALTER VIEW mtc_admin.[vewMiSchoolsLoggedOnAtLeastOnce] AS | ||
SELECT COUNT(DISTINCT ale.urn) as [numberOfSchoolsAccessedService] | ||
FROM [mtc_admin].[adminLogonEvent] ale | ||
WHERE ale.mtcRole = 'TEACHER' |
1 change: 1 addition & 0 deletions
1
db/migrations/schema-objects/20230404115415.undo.vew-mi-schools-logged-on-at-least-once.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP VIEW IF EXISTS mtc_admin.[vewMiSchoolsLoggedOnAtLeastOnce]; |