Useful Scripts - Eonic/ProteanCMS GitHub Wiki

Deleting All of One Kind of Content

To delete all content related to a specific schema, such as 'Job', you can use the following queries:

-- Delete related audits
DELETE FROM tblAudit 
WHERE nAuditKey IN (
    SELECT nAuditId FROM tblContent 
    WHERE cContentSchemaName = 'Job'
);

-- Delete content with schema name 'Job'
DELETE FROM tblContent 
WHERE cContentSchemaName = 'Job';

Renaming Countries for Existing Contacts

If you need to update country names for contacts in the database, such as changing 'uk' to 'England', use this query:

UPDATE tblCartContact
SET cContactCountry = 'England'
WHERE cContactCountry = 'uk' 
AND nContactDirId <> 0 
AND nContactCartId = 0;

This will update all contacts where the directory ID is set and the cart ID is zero, ensuring only relevant entries are affected.



⚠️ **GitHub.com Fallback** ⚠️