method

prepare_all

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: DatabaseTasks
prepare_all() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

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

        each_current_configuration(env) do |db_config|
          with_temporary_pool(db_config) do
            begin
              database_initialized = migration_connection.schema_migration.table_exists?
            rescue ActiveRecord::NoDatabaseError
              create(db_config)
              retry
            end

            unless database_initialized
              if File.exist?(schema_dump_path(db_config))
                load_schema(db_config, ActiveRecord.schema_format, nil)
              end

              seed = true
            end

            migrate
            dump_schema(db_config) if ActiveRecord.dump_schema_after_migration
          end
        end

        load_seed if seed
      end
Register or log in to add new notes.