Assist Support Guide: Difference between revisions
From Calidus HUB
(Initial creation) |
m (Categorisation of document pages) |
||
Line 49: | Line 49: | ||
order by log_id desc; | order by log_id desc; | ||
</code> | </code> | ||
Revision as of 17:15, 13 March 2020
Requirements
MySQL WorkBench
Updating Data En Mass
By default, MySQL will not allow updating of data without explicit WHERE or LIMIT clauses. To enable this:
- Go to "Edit/Preferences"
- Choose "SQL Editor" Under "Query Results"
- Check "Safe Updates"
- Restart MySQL WorkBench.
Warning: You will then be able to (for example) delete all data inadvertently, so enable this option with care.
Viewing BLOB fields
By default, MySQL WorkBench displays all text fields as "BLOB", which you must then right-click and choose "Open Value in Editor". To enable viewing the text directly in the results, do the following:
- Go to "Edit/Preferences"
- Choose "SQL Editor" Under "Query Results"
- Check "Treat BINARY/VARBINARY as nonbinary character string"
- Restart MySQL WorkBench.
Note: Enabling this option comes with a performance hit - some text fields contain the entire page data, so enable this with care.
Common Queries
-- Find the page ID
SELECT * FROM obs_assist.obs_page
WHERE PAGE_TITLE LIKE '%SDD_366558%';
-- Find all revisions (to change comments)
SELECT * FROM obs_assist.obs_revision
where rev_page IN
(SELECT page_id FROM obs_assist.obs_page
WHERE PAGE_TITLE LIKE '%SDD_366558%'
);
-- Find unpatrolled pages to set them patrolled
SELECT *
FROM obs_assist.obs_recentchanges
where rc_patrolled = 0;
UPDATE obs_assist.obs_recentchanges
SET rc_patrolled = 1
where rc_user_text = 'StylesC'
and rc_patrolled = 0;
-- Check the logs for details of PDF production
SELECT * FROM obs_assist.obs_logging
where log_action ='PdfBook'
order by log_id desc;