Skip to content

Commit

Permalink
Bugfix for null metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmalloy committed Sep 14, 2023
1 parent eed7bf2 commit a77d08a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/jasper/repository/RefRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ AND jsonb_exists(ref.tags, '+plugin/origin')
@Transactional
@Query(nativeQuery = true, value = """
UPDATE ref r
SET metadata = jsonb_set(metadata, '{obsolete}', CAST('true' as jsonb), true)
SET metadata = COALESCE(jsonb_set(metadata, '{obsolete}', CAST('true' as jsonb), true), CAST('{"obsolete":true}' as jsonb))
WHERE r.url = :url
AND r.modified < :modified""")
int setObsolete(String url, Instant modified);
Expand Down

0 comments on commit a77d08a

Please sign in to comment.