Commits

schneems authored 69067826a02
Fix preparing database schema when using :sql The schema of a Rails database can be stored in a custom dsl, Rails refers to this as a "schema" where if it is stored as raw SQL, this is called "structure". A Rails app can choose to use either by setting `ActiveRecord::Base.schema_format` to `:ruby` or `:sql`. More recent versions of Rails have rake tasks that will conditionally execute depending on what the app has set `rake db:schema:load_if_ruby` and `rake db:structure:load_if_sql`, for apps that support these rake tasks we can simply execute both tasks and only the one that is set will fire. For older applications that do not have these conditional rake tasks we must be more invasive. We can inspect the value of `ActiveRecord::Base.schema_format` and set the appropriate task. Needs tests.