From 49e9db5a60a48c6aece78ecc0149b9e1d20c64ef Mon Sep 17 00:00:00 2001 From: Sarathlal Sarangadharan Date: Mon, 17 Nov 2025 10:59:36 +0000 Subject: [PATCH] TD-6148: adf sync time update table has been moved to LH from eLfH --- .../LearningHub.Nhs.Database.sqlproj | 3 ++ .../Scripts/TD-6148-ADFtableData.sql | 44 ++++++++++++++++++ .../Adf/proc_UpdateLastSyncTimeAdf.sql | Bin 0 -> 572 bytes .../Tables/Adf/ADFSyncMetadata.sql | 7 +++ 4 files changed, 54 insertions(+) create mode 100644 WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-6148-ADFtableData.sql create mode 100644 WebAPI/LearningHub.Nhs.Database/Stored Procedures/Adf/proc_UpdateLastSyncTimeAdf.sql create mode 100644 WebAPI/LearningHub.Nhs.Database/Tables/Adf/ADFSyncMetadata.sql diff --git a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj index e91c431a0..a88a4bcff 100644 --- a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj +++ b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj @@ -688,6 +688,9 @@ + + + diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-6148-ADFtableData.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-6148-ADFtableData.sql new file mode 100644 index 000000000..1c244876e --- /dev/null +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-6148-ADFtableData.sql @@ -0,0 +1,44 @@ +INSERT INTO ADFSyncMetadata (SyncDirection, TableName, LastSyncTime) +VALUES +('ELFHtoLH', 'mergeUserTBL', '1900-01-01'), +('ELFHtoLH', 'userAdminLocationTBL', '1900-01-01'), +('ELFHtoLH', 'userEmploymentReferenceTBL', '1900-01-01'), +('ELFHtoLH', 'userEmploymentResponsibilityTBL', '1900-01-01'), +('ELFHtoLH', 'userHistoryAttributeTBL', '1900-01-01'), +('ELFHtoLH', 'userReportingUserTBL', '1900-01-01'), +('ELFHtoLH', 'emailTemplateTBL', '1900-01-01'), +('ELFHtoLH', 'userprofile', '1900-01-01'), +('ELFHtoLH', 'user', '1900-01-01'), +('ELFHtoLH', 'userRoleUpgradeTBL', '1900-01-01'), +('ELFHtoLH', 'userHistoryTBL', '1900-01-01'), +('ELFHtoLH', 'userHistoryTypeTBL', '1900-01-01'), +('ELFHtoLH', 'userPasswordValidationTokenTBL', '1900-01-01'), +('ELFHtoLH', 'userGroupTypeInputValidationTBL', '1900-01-01'), +('ELFHtoLH', 'userAttributeTBL', '1900-01-01'), +('ELFHtoLH', 'termsAndConditionsTBL', '1900-01-01'), +('ELFHtoLH', 'tenantUrlTBL', '1900-01-01'), +('ELFHtoLH', 'tenantTBL', '1900-01-01'), +('ELFHtoLH', 'tenantSmtpTBL', '1900-01-01'), +('ELFHtoLH', 'systemSettingTBL', '1900-01-01'), +('ELFHtoLH', 'loginWizardStageActivityTBL', '1900-01-01'), +('ELFHtoLH', 'loginWizardRuleTBL', '1900-01-01'), +('ELFHtoLH', 'loginWizardStageTBL', '1900-01-01'), +('ELFHtoLH', 'ipCountryLookupTBL', '1900-01-01'), +('ELFHtoLH', 'emailTemplateTypeTBL', '1900-01-01'), +('ELFHtoLH', 'attributeTBL', '1900-01-01'), +('ELFHtoLH', 'attributeTypeTBL', '1900-01-01'), +('ELFHtoLH', 'gdcRegisterTBL', '1900-01-01'), +('ELFHtoLH', 'gmclrmpTBL', '1900-01-01'), +('ELFHtoLH', 'regionTBL', '1900-01-01'), +('ELFHtoLH', 'userEmploymentTBL', '1900-01-01'), +('ELFHtoLH', 'locationTypeTBL', '1900-01-01'), +('ELFHtoLH', 'locationTBL', '1900-01-01'), +('ELFHtoLH', 'countryTBL', '1900-01-01'), +('ELFHtoLH', 'schoolTBL', '1900-01-01'), +('ELFHtoLH', 'deaneryTBL', '1900-01-01'), +('ELFHtoLH', 'gradeTBL', '1900-01-01'), +('ELFHtoLH', 'specialtyTBL', '1900-01-01'), +('ELFHtoLH', 'JobRoleTbl', '1900-01-01'), +('ELFHtoLH', 'userTermsAndConditionsTBL', '1900-01-01'), +('ELFHtoLH', 'medicalCouncilTBL', '1900-01-01'), +('ELFHtoLH', 'staffGroupTBL', '1900-01-01') diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Adf/proc_UpdateLastSyncTimeAdf.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Adf/proc_UpdateLastSyncTimeAdf.sql new file mode 100644 index 0000000000000000000000000000000000000000..c7896b6b205a29ff5406ebc1e5a9b11609695d4e GIT binary patch literal 572 zcmZ{hQA+|r6ot=o(0`c6gphjZDTG#cwIH|9F&{)^*A#@>789aBpM5*q4591G+&gp6 zIrrW(`=6dhN)*X*8a;D+Qja{=#8r%DdR49u&DAC^wIyF_LA|7sX{VJQiJxR+eXF2q zwb4885r{R+bDg1XbQcgYh%JaEtPP3<)fez1y5GBap&MPPrOSV8OP^eC@KUm>!!hd` z)*&wi`4xKm=?q)en_E3-$kx@I5x6RLxes_xL;nf>c!mKNs~@|#Ua$I#h|OYRlc%-Lapl(Sl{n@vxnftT literal 0 HcmV?d00001 diff --git a/WebAPI/LearningHub.Nhs.Database/Tables/Adf/ADFSyncMetadata.sql b/WebAPI/LearningHub.Nhs.Database/Tables/Adf/ADFSyncMetadata.sql new file mode 100644 index 000000000..c39c5980b --- /dev/null +++ b/WebAPI/LearningHub.Nhs.Database/Tables/Adf/ADFSyncMetadata.sql @@ -0,0 +1,7 @@ +CREATE TABLE ADFSyncMetadata ( + SyncDirection VARCHAR(50), -- e.g., 'ELFHtoLH' or 'LHtoELFH' + TableName VARCHAR(100), -- e.g., 'userTBL_Test', 'departmentTBL' + LastSyncTime DATETIME2, + PRIMARY KEY (SyncDirection, TableName) +); +GO