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 000000000..c7896b6b2 Binary files /dev/null and b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Adf/proc_UpdateLastSyncTimeAdf.sql differ 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