Add foreign key constraints to database tables