instance method
schema_up_to_date?
Ruby on Rails 6.1.7.10
Since v6.0.6Signature
schema_up_to_date?(configuration, format = ActiveRecord::Base.schema_format, file = nil, environment = nil, name = nil)
No documentation comment.
Parameters
-
configurationreq -
formatopt = ActiveRecord::Base.schema_format -
fileopt = nil -
environmentopt = nil -
nameopt = nil
Source
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 339
def schema_up_to_date?(configuration, format = ActiveRecord::Base.schema_format, file = nil, environment = nil, name = nil)
db_config = resolve_configuration(configuration)
if environment || name
ActiveSupport::Deprecation.warn("`environment` and `name` will be removed as parameters in 7.0.0, you may now pass an ActiveRecord::DatabaseConfigurations::DatabaseConfig as `configuration` instead.")
end
name ||= db_config.name
file ||= dump_filename(name, format)
return true unless File.exist?(file)
ActiveRecord::Base.establish_connection(db_config)
return false unless ActiveRecord::InternalMetadata.enabled?
return false unless ActiveRecord::InternalMetadata.table_exists?
ActiveRecord::InternalMetadata[:schema_sha1] == schema_sha1(file)
end
Defined in activerecord/lib/active_record/tasks/database_tasks.rb line 339
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Tasks::DatabaseTasks