method
schema_up_to_date?
v7.0.0 -
Show latest stable
- Class:
ActiveRecord::Tasks::DatabaseTasks
schema_up_to_date?(configuration, format = ActiveRecord.schema_format, file = nil)public
No documentation available.
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 383
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.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