Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rebuild database enable extension pg_stat_statements line got removed in schema file

After rebuild the database by running:

bin/rake db:drop db:create db:migrate

pg_stat_statements line got removed in db/schema.rb.

Why this line got removed?

like image 431
Juanito Fatas Avatar asked Feb 03 '16 14:02

Juanito Fatas


1 Answers

The question is really how did it get there in the first place. Did you restore the database from another source, perhaps? This is fairly common if you're using a cloud provider (like Heroku, for example).

You can create an actual migration to add this extension:

class AddStatsExtension < ActiveRecord::Migration
  def change
    enable_extension 'pg_stat_statements'
  end
end
like image 55
ChrisH Avatar answered Nov 15 '22 00:11

ChrisH