Updated pair insert trigger to create pair_id automatically