Difference between revisions of "Query Utils"
From OpenKM Documentation
Line 7: | Line 7: | ||
</source> | </source> | ||
Tested: OpenKM (6.x) Database (MySQL). | Tested: OpenKM (6.x) Database (MySQL). | ||
+ | |||
+ | == Looking for OKM_ACTIVITY document history == | ||
+ | Looking for creation of some document named /okm_root:/employees/8526. employe_name.pdf | ||
+ | <source lang="sql"> | ||
+ | select * from OKM_ACTIVITY where ACT_ACTION="CREATE_DOCUMENT" and ACT_PARAMS LIKE "%/employees/8526%"; | ||
+ | </source> | ||
+ | |||
+ | Looking for when has been deleted of some document named /okm_root:/employees/8526. employe_name.pdf | ||
+ | <source lang="sql"> | ||
+ | select * from OKM_ACTIVITY where ACT_ACTION="DELETE_DOCUMENT" and ACT_PARAMS LIKE "%/employees/8526%"; | ||
+ | </source> | ||
+ | |||
+ | Looking for all the activity log of the document | ||
+ | <source lang="sql"> | ||
+ | select * from OKM_ACTIVITY where ACT_PARAMS LIKE "%/employees/8526%"; | ||
+ | </source> | ||
+ | |||
+ | |||
+ | |||
+ | Tested: OpenKM (5.x) Database (MySQL). | ||
[[Category: Migration Guide]] | [[Category: Migration Guide]] |
Revision as of 16:39, 11 September 2012
Here are some queries that could be useful for migration.
Save OKM_CONFIG table values
Creates update script with actual OKM_CONFIG table values to be restored in new OpenKM database;
select 'UPDATE OKM_CONFIG SET CFG_VALUE=''' || CFG_VALUE || ''' WHERE CFG_KEY=''' || CFG_KEY || '''' from OKM_CONFIG;
Tested: OpenKM (6.x) Database (MySQL).
Looking for OKM_ACTIVITY document history
Looking for creation of some document named /okm_root:/employees/8526. employe_name.pdf
select * from OKM_ACTIVITY where ACT_ACTION="CREATE_DOCUMENT" and ACT_PARAMS LIKE "%/employees/8526%";
Looking for when has been deleted of some document named /okm_root:/employees/8526. employe_name.pdf
select * from OKM_ACTIVITY where ACT_ACTION="DELETE_DOCUMENT" and ACT_PARAMS LIKE "%/employees/8526%";
Looking for all the activity log of the document
select * from OKM_ACTIVITY where ACT_PARAMS LIKE "%/employees/8526%";
Tested: OpenKM (5.x) Database (MySQL).