Add migration to fix foreign keys creation for messaging tables