Fix postgresql query for deleting auth expiry job
All checks were successful
continuous-integration/drone/push Build is passing

Solid Queue uses a text column, instead of a jsonb, so we need to cast
it as jsonb on the fly.
This commit is contained in:
Râu Cao 2025-05-05 17:37:58 +04:00
parent 5a523fd220
commit a97bbf61a8
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -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