migration fix

This commit is contained in:
benedettadavico
2026-05-19 15:34:58 +02:00
parent ff0ecc95fb
commit c9a9940cb9
2 changed files with 14 additions and 2 deletions
@@ -4,7 +4,6 @@ UPDATE gateways
SET ports_check = (last_probe_result::jsonb -> 'ports_check')
WHERE last_probe_result IS NOT NULL
AND btrim(last_probe_result) <> ''
AND last_probe_result ~ '^[\[{]'
AND last_probe_result::jsonb ? 'ports_check'
AND ports_check IS NULL;
@@ -12,5 +11,4 @@ UPDATE gateways
SET last_probe_result = (last_probe_result::jsonb - 'ports_check')::text
WHERE last_probe_result IS NOT NULL
AND btrim(last_probe_result) <> ''
AND last_probe_result ~ '^[\[{]'
AND last_probe_result::jsonb ? 'ports_check';
@@ -0,0 +1,14 @@
UPDATE gateways
SET ports_check = (last_probe_result::jsonb -> 'ports_check')
WHERE last_probe_result IS NOT NULL
AND btrim(last_probe_result) <> ''
AND last_probe_result ~ '^[\[{]'
AND last_probe_result::jsonb ? 'ports_check'
AND ports_check IS NULL;
UPDATE gateways
SET last_probe_result = (last_probe_result::jsonb - 'ports_check')::text
WHERE last_probe_result IS NOT NULL
AND btrim(last_probe_result) <> ''
AND last_probe_result ~ '^[\[{]'
AND last_probe_result::jsonb ? 'ports_check';