task dependency diagram for active-record-5.2.3/lib/active_record/railties/database.rake.
All dependencies on load_config, check_protected_environments, and environment are omitted because they are numerous and distort the diagram.
black lines are dependencies gray lines are invocations, where these are obvious (like calling a .invoke method).