Class: CreatePgInsightsHealthCheckResults

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/pg_insights/templates/db/migrate/create_pg_insights_health_check_results.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/pg_insights/templates/db/migrate/create_pg_insights_health_check_results.rb', line 2

def change
  create_table :pg_insights_health_check_results do |t|
    t.string :check_type, null: false, limit: 50
    t.json :result_data
    t.string :status, null: false, default: "pending", limit: 20
    t.text :error_message
    t.datetime :executed_at
    t.integer :execution_time_ms
    t.timestamps

    t.index [ :check_type, :executed_at ], name: "idx_pg_insights_health_check_type_executed_at"
    t.index [ :status, :executed_at ], name: "idx_pg_insights_health_status_executed_at"
  end
end