add sourcestamps for referential integrity

Fixes #3079.
Merge pull request #1401 from djmitche/bug3079

Add rows for referential integrity