canvas-lms/lib/data_fixup
Evan Battaglia 494207756c Populate root_account_id if only 1 root account
i.e., open-source Canvas users.

Test plan:
- ensure you do not have any courses or groups related to the site
  admin, and have only one root account
- have a variety of records in the different groups of models mentioned
  in the code with root_account_id not filled
- have some developer keys with account_id=null and
  root_account_id=null, and associated account tokens
- run migrations
- check that developer keys and access tokens have root_account_id set
  to the site admin id
- check that the other models have root_account_id filled to the
  non-site-admin root account

closes INTEROP-6275

Change-Id: I1e7057e81555db305f2f143c2d9fa4c1416219e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250763
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-11-10 21:04:09 +00:00
..
lti add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
add_lti_id_to_users.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
add_new_default_report.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
add_post_policies_to_assignments.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
add_role_overrides_for_new_permission.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
add_tool_proxy_to_message_handler.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
add_user_uuid_to_learning_outcome_results.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_dev_key_account_bindings.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_dev_key_account_bindings_for_deleted_keys.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_dummy_root_account_id_on_folders.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_moderation_graders.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_new_default_help_link.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_nulls.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
backfill_posted_at_on_submissions.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
cleanup_cross_shard_developer_keys.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
clear_feature_flags.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
clear_old_communication_channel_root_account_ids.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
clear_old_user_root_account_ids.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
copy_big_blue_button_settings.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
copy_built_in_roles_by_root_account.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
copy_role_overrides.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
create_lti_links_for_legacy_lti_tool_settings.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
create_subscriptions_for_plagiarism_tools.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
delete_duplicate_notification_endpoints.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
delete_empty_adhoc_assignment_overrides.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
delete_empty_progressions.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
delete_extra_placeholder_submissions.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
delete_invalid_communication_channels.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
delete_scores_for_assignment_groups.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_assignment_peer_review_jobs.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_discussion_topic_materialized_views.rb update to inst-jobs 1.0 via shims 2020-10-28 13:46:49 +00:00
fix_grader_visibility_data.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_nan_group_weights.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_overwritten_file_module_items.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_planner_overrides_marked_complete_data.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_points_possible_sums_in_quizzes.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_reinserted_verifier_question_yaml.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fix_select_final_grade_for_existing_accounts.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
fixup_group_originality_reports.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
import_instfs_attachments.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
init_account_index_for_course_audit_log.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
init_new_grade_history_audit_log_indexes.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
initialize_submission_cached_due_date.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
invalidate_built_in_role_caches.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
make_late_policy_unique.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
migrate_messages_to_partitions.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
move_feature_flags_to_settings.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
move_master_import_results.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
move_rce_favorites_to_account_settings.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
move_sub_account_grading_periods_to_courses.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_account_report_date_times.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_context_on_outcome_proficiencies.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_context_on_wiki_pages.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_conversation_participant_private_hash.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_course_id_on_submissions.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_last_comment_at_on_submissions.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_media_tracks_web_vtt_content.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_missing_root_account_ids_if_single_root_account_install.rb Populate root_account_id if only 1 root account 2020-11-10 21:04:09 +00:00
populate_points_for_all_scores.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
populate_root_account_id_for_assignments.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_id_for_group_categories.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_id_on_asset_user_accesses.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_id_on_attachments.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_id_on_calendar_events.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_id_on_models.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
populate_root_account_id_on_user_observers.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_ids_on_communication_channels.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
populate_root_account_ids_on_conversations_tables.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_ids_on_learning_outcomes.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_root_account_ids_on_users.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_scores_and_metadata_for_assignment_groups_and_teacher_view.rb update all invocations of send_later and friends to new syntax 2020-10-30 19:13:54 +00:00
populate_scores_course_score.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
populate_submission_anonymous_ids.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
reassociate_grading_period_groups.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
rebuild_quiz_submissions_from_quiz_submission_events.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
rebuild_quiz_submissions_from_quiz_submission_versions.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
reclaim_instfs_attachments.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
reinsert_assessment_question_file_verifiers.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
remove_invalid_assignment_overrides.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
remove_orphaned_assignment_override_students.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
resend_plagiarism_events.rb Make plagiarism faster and separate errored reports 2020-11-04 22:05:07 +00:00
run_due_date_cacher_for_quiz_lti.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
run_update_course_score_statistic.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
set_account_setting_enable_turnitin.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
set_actl_context_type_for_course_level_tool_proxies.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
set_existing_binding_state.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
set_lti_line_items_coupled.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
set_posting_notification_frequency.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
split_up_user_preferences.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
turn_off_anonymous_grading_for_discussion_topics_and_quizzes.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
update_anonymous_grading_settings.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
update_developer_key_access_token_counts.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
update_grading_standards_to_full_range.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
update_mastery_connect_tool_config.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00
validate_assignment_overrides.rb add # frozen_string_literal: true for lib 2020-10-27 20:49:50 +00:00