Skip to content
Partner Developer Portal

Definition

The Dataservices Changelogsource model holds named sources for change-log records. Each entry records a change-source identifier and source name, together with organisation information.

_deleted indicates whether the record has been deleted in the source system.

dataservices.changelog count per dataservices.changelogsource

Section titled “dataservices.changelog count per dataservices.changelogsource”

Count related dataservices.changelog records for each dataservices.changelogsource record, joined on changelogsourceid.

SELECT
m."changelogsourceid",
m."sourcename",
COUNT(c."changelogsourceid") AS changelog_count
FROM dataservices.changelogsource AS m
LEFT JOIN dataservices.changelog AS c
ON m."changelogsourceid" = c."changelogsourceid"
AND m."organisation" = c."organisation"
GROUP BY m."changelogsourceid", m."sourcename"
ORDER BY changelog_count DESC;

dataservices.changelog records with dataservices.changelogsource details

Section titled “dataservices.changelog records with dataservices.changelogsource details”

List dataservices.changelog records with the dataservices.changelogsource values they reference through changelogsourceid.

SELECT
c."changelogid",
c."logtimestamp",
m."changelogsourceid",
m."sourcename" AS "changelogsource_sourcename"
FROM dataservices.changelog AS c
INNER JOIN dataservices.changelogsource AS m
ON m."changelogsourceid" = c."changelogsourceid"
AND m."organisation" = c."organisation";

dataservices.changelogsource records not used by dataservices.changelog

Section titled “dataservices.changelogsource records not used by dataservices.changelog”

Find dataservices.changelogsource records that no dataservices.changelog record references.

SELECT
m."changelogsourceid",
m."sourcename"
FROM dataservices.changelogsource AS m
WHERE NOT EXISTS (
SELECT 1
FROM dataservices.changelog AS c
WHERE m."changelogsourceid" = c."changelogsourceid"
AND m."organisation" = c."organisation"
);