Modified migrations and added references to tables with foreign keys.