OK if I simplify this to:
select * from plugin_store_rows WHERE plugin_name = 'discourse-data-explorer' AND type_name = 'JSON' AND (replace(key, 'q:',''))::integer < 0;
That brings back 2 identical rows (bar ‘id’).
I guess I should be brave and delete one!
PS Done, deleted the newer record - rebuilding
(Used DELETE from plugin_store_rows WHERE id = $$$the duplicate records id$$$;
)
MIGRATION NOW WORKED!
Thanks for push @Falco