instance method schema_up_to_date?

Ruby on Rails 7.1.6

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

schema_up_to_date?(configuration, format = ActiveRecord.schema_format, file = nil)

No documentation comment.

Parameters

configuration req
format opt = ActiveRecord.schema_format
file opt = nil
Source
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 389
      def schema_up_to_date?(configuration, format = ActiveRecord.schema_format, file = nil)
        db_config = resolve_configuration(configuration)

        file ||= schema_dump_path(db_config)

        return true unless file && File.exist?(file)

        with_temporary_connection(db_config) do |connection|
          return false unless connection.internal_metadata.enabled?
          return false unless connection.internal_metadata.table_exists?

          connection.internal_metadata[:schema_sha1] == schema_sha1(file)
        end
      end

Defined in activerecord/lib/active_record/tasks/database_tasks.rb line 389 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Tasks::DatabaseTasks

Type at least 2 characters to search.

↑↓ navigate · open · esc close