Skip to content

Commit

Permalink
CON-3860 & CON-3921
Browse files Browse the repository at this point in the history
  • Loading branch information
hkf-tech committed Sep 6, 2021
1 parent c63f455 commit bb239cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
<None Include="Scripts\PostDeployment\AML-3762-EOI-API.sql" />
<None Include="Scripts\Manual\AML-3655_GenerateFinanceDataInserts.sql" />
<None Include="Scripts\PostDeployment\UpdateAgreementTemplateV3.sql" />
<None Include="Scripts\Manual\CON-3921-DataFixForTermAndConditionsAcceptedOn.sql" />
</ItemGroup>
<ItemGroup>
<Build Include="Tables\Invitation.sql" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Update TermsAndConditionsAcceptedOn for all users created afer 27th July 2021
Update [employer_account].[User]
Set TermAndConditionsAcceptedOn = GETDATE()
where Id in (
Select UserId from (
Select *, ROW_NUMBER() over (partition by M.UserId order by M.CreatedDate) As Rank2
from [employer_account].[Membership] M
) Result
Where Result.Rank2 = 1
and CreatedDate >= CONVERT(DATETIME,'27/07/2021',103) --dd/MM/yyyy
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ AS
USING (SELECT @userRef AS UserRef) AS [Source]
ON [Target].UserRef = [Source].UserRef
WHEN MATCHED THEN UPDATE SET [Target].Email = @email, [Target].FirstName = @firstName, [Target].LastName = @lastName, [Target].CorrelationId = COALESCE(@correlationId, [Target].CorrelationId)
WHEN NOT MATCHED THEN INSERT (UserRef, Email, FirstName, LastName, CorrelationId) VALUES (@userRef, @email, @firstName, @lastName, @correlationId);
WHEN NOT MATCHED THEN INSERT (UserRef, Email, FirstName, LastName, CorrelationId, TermAndConditionsAcceptedOn) VALUES (@userRef, @email, @firstName, @lastName, @correlationId, GETDATE());

0 comments on commit bb239cd

Please sign in to comment.