Is the structure just a sql
version of the db while the schema is a Rails
version of the db? When would you want to load either? Or does it make a difference?
The schema file is the Rails version of your db and doesn't contain any db specific stuff like, views, triggers, and so on.
db/schema.rb cannot express database specific items such as triggers, sequences, stored procedures or check constraints, etc. Please note that while custom SQL statements can be run in migrations, these statements cannot be reconstituted by the schema dumper. If you are using features like this, then you should set the schema format to :sql. http://edgeguides.rubyonrails.org/active_record_migrations.html#schema-dumping-and-you
When would you use one over the other depends on whether you have db specific stuff that you need. If all you use are the basic tables, with indexes and primary and foreign keys you are good to go with schema files.
In my opinion however I always use structure.sql
since I always use some db specific things.
You can change what format you want to use by changing this in your config/application.rb
file.
config.active_record.schema_format = :sql # default is :ruby