method

prepare_all

prepare_all()
public

No documentation available.

# File activerecord/lib/active_record/tasks/database_tasks.rb, line 188
      def prepare_all
        seed = false

        configs_for(env_name: env).each do |db_config|
          ActiveRecord::Base.establish_connection(db_config)

          # Skipped when no database
          migrate

          if ActiveRecord.dump_schema_after_migration
            dump_schema(db_config, ActiveRecord.schema_format)
          end
        rescue ActiveRecord::NoDatabaseError
          create_current(db_config.env_name, db_config.name)

          if File.exist?(schema_dump_path(db_config))
            load_schema(
              db_config,
              ActiveRecord.schema_format,
              nil
            )
          else
            migrate
          end

          seed = true
        end

        ActiveRecord::Base.establish_connection
        load_seed if seed
      end