Add foreign key sql functionality.