SQL
x
SET @user = 'RoySmith';
SET @user_id = (select actor_id from actor_logging);
SELECT
(SELECT count(distinct(ll.log_title))
FROM logging_userindex lu
JOIN logging_logindex ll ON lu.log_title = ll.log_title
JOIN actor_logging ON lu.log_actor = actor_id
WHERE actor_name = @user
AND lu.log_namespace = 0
AND ll.log_namespace = 0
AND lu.log_type = 'delete'
AND lu.log_action = 'delete') as deleted
,
(SELECT count(distinct(ll.log_title))
FROM logging_userindex lu
JOIN logging_logindex ll ON lu.log_title = ll.log_title
JOIN actor_logging ON lu.log_actor = actor_id
WHERE actor_name = @user
AND lu.log_namespace = 0
AND ll.log_namespace = 0
AND lu.log_type = 'delete'
AND lu.log_action = 'delete'
AND ll.log_type = 'delete'
AND ll.log_action = 'restore'
AND ll.log_timestamp > lu.log_timestamp) as restored
;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.