2

I use the Apartment gem in Rails 4 to manage mult-tenancy in my Rails app.

As explained by this question, the PG Stat Statments that attempt to execute require superuser privelage, which Heroku does not allow. So I followed the directions to disable pg_stat_statements.

However the next time I created a migration, I noticed that this line got re-added to the db/schema.rb file.

enable_extension "pg_stat_statements"

How do I configure active record to never re-add that enable.. line again? I want that permanently disabled.

Thanks!

Community
  • 1
  • 1
user2490003
  • 10,706
  • 17
  • 79
  • 155

1 Answers1

0

Add a migration with following:

def change
  disable_extension "pg_stat_statements"
end
Juanito Fatas
  • 9,419
  • 9
  • 46
  • 70
  • 1
    I did try that, twice actually. But later migrations tend to add it back in - it might be the `activerecord` gem that automatically tries to do that – user2490003 Feb 03 '16 at 17:52