method

reconstruct_from_schema

Importance_0
v6.1.7.7 - Show latest stable - 0 notes - Class: DatabaseTasks
reconstruct_from_schema(db_config, format = ActiveRecord::Base.schema_format, file = nil) 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 360
      def reconstruct_from_schema(db_config, format = ActiveRecord::Base.schema_format, file = nil) # :nodoc:
        file ||= dump_filename(db_config.name, format)

        check_schema_file(file)

        ActiveRecord::Base.establish_connection(db_config)

        if schema_up_to_date?(db_config, format, file)
          truncate_tables(db_config)
        else
          purge(db_config)
          load_schema(db_config, format, file)
        end
      rescue ActiveRecord::NoDatabaseError
        create(db_config)
        load_schema(db_config, format, file)
      end
Register or log in to add new notes.