SHARE
TWEET

Clean residual namespaces

yregaieg May 23rd, 2017 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DELETE FROM alf_node_properties
  2. WHERE (node_id, qname_id) IN
  3. (SELECT p.node_id "node_id",
  4. p.qname_id "qname_id"
  5. FROM alf_namespace ns
  6. INNER JOIN alf_qname q ON (ns.id = q.ns_id)
  7. INNER JOIN alf_node_properties p ON (p.qname_id = q.id)
  8. INNER JOIN alf_node n ON (n.id = p.node_id)
  9. WHERE ns.uri = ?
  10. AND q.local_name = ?)
  11.  
  12.  
  13. UPDATE alf_node
  14. SET type_qname_id = 76
  15. WHERE id IN
  16. (SELECT n.id "node_id"
  17. FROM alf_namespace ns
  18. INNER JOIN alf_qname q ON (ns.id = q.ns_id)
  19. INNER JOIN alf_node n ON (n.type_qname_id = q.id)
  20. WHERE ns.uri = ?)
  21.  
  22.  
  23. DELETE FROM alf_node_aspects
  24. WHERE (node_id, qname_id) IN
  25. (SELECT a.node_id "node_id", a.qname_id "qname_id"
  26. FROM alf_namespace ns
  27. INNER JOIN alf_qname q ON (ns.id = q.ns_id)
  28. INNER JOIN alf_node_aspects a ON (a.qname_id = q.id)
  29. WHERE ns.uri=?)
  30.  
  31.  
  32. UPDATE alf_child_assoc
  33. SET qname_ns_id = 2
  34. WHERE id IN
  35. (SELECT ca.id "id"
  36. FROM alf_namespace ns
  37. INNER JOIN alf_child_assoc ca ON (ca.qname_ns_id = ns.id)
  38. WHERE ns.uri = ?)
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top