comparison db/sat_pubsub_update_0_1.sql @ 303:3c2705199108

sat_pubsub_update_0_1.sql now also updates comment nodes
author Goffi <goffi@goffi.org>
date Tue, 01 Dec 2015 23:32:32 +0100
parents 05c875a13a62
children 4d4575911060
comparison
equal deleted inserted replaced
302:b8b25efae0bc 303:3c2705199108
26 UPDATE items SET data = xmlelement(name item, xmlattributes((xpath('/item/@id', data::xml))[1] as id), 26 UPDATE items SET data = xmlelement(name item, xmlattributes((xpath('/item/@id', data::xml))[1] as id),
27 XMLPARSE(CONTENT NULLIF(array_to_string(xpath('/item/entry/preceding-sibling::*', data::xml)::text[],''),'')), 27 XMLPARSE(CONTENT NULLIF(array_to_string(xpath('/item/entry/preceding-sibling::*', data::xml)::text[],''),'')),
28 xmlelement(name entry, xmlattributes('http://www.w3.org/2005/Atom' as xmlns), array_to_string(xpath('/item/entry/*', data::xml)::text[], '')::xml), 28 xmlelement(name entry, xmlattributes('http://www.w3.org/2005/Atom' as xmlns), array_to_string(xpath('/item/entry/*', data::xml)::text[], '')::xml),
29 XMLPARSE(CONTENT NULLIF(array_to_string(xpath('/item/entry/following-sibling::*', data::xml)::text[],''),''))) 29 XMLPARSE(CONTENT NULLIF(array_to_string(xpath('/item/entry/following-sibling::*', data::xml)::text[],''),'')))
30 FROM nodes WHERE nodes.node_id = items.node_id 30 FROM nodes WHERE nodes.node_id = items.node_id
31 AND node = 'urn:xmpp:microblog:0' 31 AND (node = 'urn:xmpp:microblog:0' or node LIKE 'urn:xmpp:comments:%')
32 AND XMLEXISTS('/item/entry' PASSING (data::xml)); 32 AND XMLEXISTS('/item/entry' PASSING (data::xml));