instance method
dump_schema_cache
Ruby on Rails 5.2.8.1
Since v5.2.8.1Signature
dump_schema_cache(conn, filename)
Dumps the schema cache in YAML format for the connection into the file
Examples:
ActiveRecord::Tasks::DatabaseTasks.dump_schema_cache(ActiveRecord::Base.connection, "tmp/schema_dump.yaml")
Parameters
-
connreq -
filenamereq
Source
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 293
def dump_schema_cache(conn, filename)
conn.schema_cache.clear!
conn.data_sources.each { |table| conn.schema_cache.add(table) }
open(filename, "wb") { |f| f.write(YAML.dump(conn.schema_cache)) }
end
Defined in activerecord/lib/active_record/tasks/database_tasks.rb line 293
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Tasks::DatabaseTasks