Changes between Version 9 and Version 10 of DatabaseCleanup


Ignore:
Timestamp:
Jun 9, 2017, 2:28:51 PM (7 years ago)
Author:
casties
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseCleanup

    v9 v10  
    118118order by 2
    119119}}}
     120
     121DANGEROUS: Set `system_status` of every last version of `is_reference_of` relations with target 74095 to `CURRENT_VERSION`. (Needs two nested subselects and safe_mode=off)
     122{{{
     123update node
     124set system_status = 'CURRENT_VERSION'
     125-- select * from node
     126where (id, version) in
     127(
     128select * from
     129(
     130select id, max(version)
     131from node
     132where
     133target_id = 74095
     134and object_class = 'is_reference_of'
     135group by id
     136) as d
     137)
     138}}}