Skip to content

Fix SQL statement to calculate updated_at when upserting #1320

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

andyundso
Copy link
Member

The previous CASE statement used COALESCE with 'NULL' as a fallback value if either source or target were NULL. However, 'NULL' as written in this statement, is a varchar and therefore does not work when comparing with other datatypes (e.g. int).

This commit changes the switch statement to check if either both values are equal, or both values are actually NULL.

The previous `CASE` statement used `COALESCE` with `'NULL'` as a fallback value if either `source` or `target` were `NULL`. However, `'NULL'` as written in this statement, is a `varchar` and therefore does not work when comparing with other datatypes.

This commit changes the switch statement to check if either both values are equal, or both values are actually `NULL`.
@andyundsoandyundso force-pushed the fix-sql-statement-for-touch-attributes branch from 9c40428 to 45bf0ef Compare March 23, 2025 14:27
@andyundsoandyundso requested a review from aidanharan March 23, 2025 14:30
@aidanharanaidanharan merged commit 3973683 into main Mar 24, 2025
3 of 6 checks passed
@aidanharanaidanharan deleted the fix-sql-statement-for-touch-attributes branch March 24, 2025 12:53
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants