Since ActiveRecord 3.2.14, db/structure.sql automatically includes a "SET search_path TO" statement before adding the "INSERT INTO schema_migrations" statements, which is handy.

However, if you haven't set schema_search_path in your config/database.yml (I deliberately haven't) and you use multi_schema in your migrations then the search path will flip-flop between "$user",public and public depending on whether you've run "rake db:structure:dump" or "rake db:migrate". This makes version control tedious.

The default client search path of "$user",public can be overridden in postgresql.conf so I have made this configurable through MultiSchema.default_search_path as part of this fix.