Reorganize ActiveRecord tasks [Arun Agrawal & Abd ar-Rahman Hamidi]

Follow up to #14940, which finishes the work of #10139