From 7f9dd92a27e937e3cbc42c1e3c8b844c3583c92b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 9 Oct 2018 19:35:14 +0200 Subject: Track historical space stats in PgHero to determine PostgreSQL growth (#8906) --- db/migrate/20181007025445_create_pghero_space_stats.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/migrate/20181007025445_create_pghero_space_stats.rb (limited to 'db/migrate/20181007025445_create_pghero_space_stats.rb') diff --git a/db/migrate/20181007025445_create_pghero_space_stats.rb b/db/migrate/20181007025445_create_pghero_space_stats.rb new file mode 100644 index 000000000..6198a6f84 --- /dev/null +++ b/db/migrate/20181007025445_create_pghero_space_stats.rb @@ -0,0 +1,13 @@ +class CreatePgheroSpaceStats < ActiveRecord::Migration[5.2] + def change + create_table :pghero_space_stats do |t| + t.text :database + t.text :schema + t.text :relation + t.integer :size, limit: 8 + t.timestamp :captured_at + end + + add_index :pghero_space_stats, [:database, :captured_at] + end +end -- cgit