Follow-up from "Add ClickHouse structure SQL and rake tasks"

The following discussion from !192771 (closed) should be addressed:

  • @pshutsin started a discussion: (+1 comment)

    neat-pick: we have this click_house_database_names.each do |database| many times in this file. Maybe it's better to restructure it differently:

    click_house_database_names.each do |database|
      namespace :reset do
        task database => :environment do
          # ...
        end
      end
      
      namespace :migrate do
        task database => :environment do
          # ...
        end
      end
    
      namespace :schema do
        namespace :load do
          task database => :environment do
            # ...
          end      
        end
      end
    end