Apparently, there was a change to something in postgres 9.5, or maybe just my install of it. If you upgrade your Postgres database version and suddenly your rails app stops doing migrations, add the following line to config/database.yml database config to get it working again:
The error message i was getting was:
ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "schema_migrations" already exists
Basically, sometimes Rails was finding the schema_migrations table, and sometimes it wasn't, but setting the schema_search_path fixed it.
I'm still not sure where exactly the problem came from, but setting the setting fixed it.