I'm in the process of creating an audit table for content nodes as a dashboard in Umbraco and I'm a little stuck. So far, I have something that sort of works by going to the database and grabbing a slew of records from the umbracoLog table and joining those returns to the cmsDocument table as well as the umbracoUser table. Here's what that looks like:
select ul.id as logId,ul.NodeId,cd.text as pageName, ul.Datestamp,
uu.id as userId, uu.userName, uu.userLogin,
cd.versionId
from umbracoLog ul
inner join umbracoUser uu on ul.userId=uu.id
left join cmsDocument cd on ul.NodeId=cd.nodeId
where 1=1
and cd.newest=1
and ul.logHeader='Publish'
order by ul.Datestamp desc, cd.updateDate desc
However, this always produces the latest versionId for the pages and this is where I'm stuck. How do I map a version ID to the change that was made ata certain time. The timestamps don't necessarily match, so I can't use that as a paramater. I suppose one way is to try and do some funky logic and do nested loops over various sql queries. But, before I go down that road I wanted to check if someone might have a solution for something like this already (that they don't mind sharing).
Creating and Audit Table
Hi guys an gals,
I'm in the process of creating an audit table for content nodes as a dashboard in Umbraco and I'm a little stuck. So far, I have something that sort of works by going to the database and grabbing a slew of records from the umbracoLog table and joining those returns to the cmsDocument table as well as the umbracoUser table. Here's what that looks like:
However, this always produces the latest versionId for the pages and this is where I'm stuck. How do I map a version ID to the change that was made ata certain time. The timestamps don't necessarily match, so I can't use that as a paramater. I suppose one way is to try and do some funky logic and do nested loops over various sql queries. But, before I go down that road I wanted to check if someone might have a solution for something like this already (that they don't mind sharing).
Thanks a heap!
-- Nik
is working on a reply...