generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DMS and GlueJob files re-aligned - v1
- Loading branch information
1 parent
883814c
commit cbe406c
Showing
7 changed files
with
112 additions
and
90 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
59 changes: 59 additions & 0 deletions
59
...tronic-monitoring-data/glue-job/Archived/RDS_MSSQLServer_DB_Scripts/D_Comments_V2_DDL.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,59 @@ | ||
-- SET ANSI_NULLS ON | ||
-- GO | ||
-- SET QUOTED_IDENTIFIER ON | ||
-- GO | ||
-- CREATE TABLE [dbo].[D_Comments_V2]( | ||
-- [CommentSID] [int] IDENTITY(1,1) NOT NULL, | ||
-- [VisitID] [int] NULL, | ||
-- [ActivityID] [uniqueidentifier] NULL, | ||
-- [Comments] [varchar](4200) NULL, | ||
-- [CommentType] [varchar](50) NULL | ||
-- ) ON [PRIMARY] | ||
-- GO | ||
-- CREATE CLUSTERED INDEX [PK_D_Comments_V2] ON [dbo].[D_Comments_V2] | ||
-- ( | ||
-- [CommentSID] ASC | ||
-- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
-- GO | ||
-- SET ANSI_PADDING ON | ||
-- GO | ||
-- CREATE NONCLUSTERED INDEX [I1_D_Comments_V2] ON [dbo].[D_Comments_V2] | ||
-- ( | ||
-- [VisitID] ASC, | ||
-- [CommentType] ASC | ||
-- ) | ||
-- INCLUDE([CommentSID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
-- GO | ||
-- SET ANSI_PADDING ON | ||
-- GO | ||
-- CREATE NONCLUSTERED INDEX [I2_D_Comments_V2] ON [dbo].[D_Comments_V2] | ||
-- ( | ||
-- [CommentType] ASC | ||
-- ) | ||
-- INCLUDE([CommentSID],[ActivityID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
-- GO | ||
-- CREATE NONCLUSTERED INDEX [I3_D_Comments_V2] ON [dbo].[D_Comments_V2] | ||
-- ( | ||
-- [VisitID] ASC, | ||
-- [ActivityID] ASC | ||
-- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
-- GO | ||
-- SET ANSI_PADDING ON | ||
-- GO | ||
-- CREATE NONCLUSTERED INDEX [I4_D_Comments_V2] ON [dbo].[D_Comments_V2] | ||
-- ( | ||
-- [ActivityID] ASC, | ||
-- [CommentType] ASC | ||
-- ) | ||
-- INCLUDE([CommentSID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
-- GO | ||
-- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Database ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'D_Comments_V2', @level2type=N'COLUMN',@level2name=N'CommentSID' | ||
-- GO | ||
-- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Database ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'D_Comments_V2', @level2type=N'COLUMN',@level2name=N'VisitID' | ||
-- GO | ||
-- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Database ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'D_Comments_V2', @level2type=N'COLUMN',@level2name=N'ActivityID' | ||
-- GO | ||
-- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Free text comments summarising either a phone call or a visit adding detail that isnt captured else where ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'D_Comments_V2', @level2type=N'COLUMN',@level2name=N'Comments' | ||
-- GO | ||
-- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'identifies if the comment belongs to either a phone call or a visit' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'D_Comments_V2', @level2type=N'COLUMN',@level2name=N'CommentType' | ||
-- GO |
31 changes: 31 additions & 0 deletions
31
...ng-data/glue-job/Archived/RDS_MSSQLServer_DB_Scripts/D_Comments_V2_Insert_Into_Select.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,31 @@ | ||
-- SET IDENTITY_INSERT g4s_cap_dw.dbo.D_Comments_V2 ON | ||
-- ; | ||
|
||
-- truncate table [g4s_cap_dw].[dbo].[D_Comments_V2]; | ||
|
||
-- INSERT INTO g4s_cap_dw.dbo.D_Comments_V2 (CommentSID, VisitID, ActivityID, Comments, CommentType) | ||
-- SELECT CommentSID, VisitID, ActivityID, | ||
-- trim(replace(replace(Comments, char(141), ''), char(129), '')) AS Comments, | ||
-- CommentType | ||
-- FROM g4s_cap_dw.dbo.D_Comments | ||
-- ; | ||
|
||
-- SET IDENTITY_INSERT g4s_cap_dw.dbo.D_Comments_V2 OFF; | ||
|
||
|
||
-- -- TESTING QUERIES -- | ||
-- -- | ||
-- -- SELECT COUNT(*) FROM g4s_cap_dw.dbo.D_Comments_V2; -- 49695569 | ||
-- -- SELECT COUNT(*) FROM g4s_cap_dw.dbo.D_Comments; -- 49695569 | ||
-- -- | ||
|
||
|
||
-- -- | ||
-- -- SELECT 'D_Comments' AS TableName, Comments | ||
-- -- FROM g4s_cap_dw.dbo.D_Comments | ||
-- -- WHERE CommentSID = 26837791 | ||
-- -- UNION | ||
-- -- SELECT 'D_Comments_V2' AS TableName, Comments | ||
-- -- FROM g4s_cap_dw.dbo.D_Comments_V2 | ||
-- -- WHERE CommentSID = 26837791 | ||
-- -- |
Binary file removed
BIN
-6.55 KB
terraform/environments/electronic-monitoring-data/glue-job/glue_data_validation_lib.zip
Binary file not shown.
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
59 changes: 0 additions & 59 deletions
59
...s/electronic-monitoring-data/modules/dms/RDS_MSSQLServer_DB_Scripts/D_Comments_V2_DDL.sql
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...nitoring-data/modules/dms/RDS_MSSQLServer_DB_Scripts/D_Comments_V2_Insert_Into_Select.sql
This file was deleted.
Oops, something went wrong.