From a97bbf61a8a0650343b3697fc6e123cbc6558534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Mon, 5 May 2025 17:37:58 +0400 Subject: [PATCH] Fix postgresql query for deleting auth expiry job Solid Queue uses a text column, instead of a jsonb, so we need to cast it as jsonb on the fly. --- app/models/remote_storage_authorization.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/remote_storage_authorization.rb b/app/models/remote_storage_authorization.rb index d2d3700..f6a7fed 100644 --- a/app/models/remote_storage_authorization.rb +++ b/app/models/remote_storage_authorization.rb @@ -78,7 +78,7 @@ class RemoteStorageAuthorization < ApplicationRecord when /sqlite/ query.where("json_extract(arguments, '$.arguments') = ?", job_args.to_json) when /postgres/ - query.where("arguments->>'arguments' = ?", job_args.to_json) + query.where("CAST(arguments AS jsonb)->>'arguments' = ?", job_args.to_json) else raise "Unsupported database adapter" end.destroy_all