tables updated to include foreign keys