app/views/pg_hero/home/queries.html.erb in pghero-1.7.0 vs app/views/pg_hero/home/queries.html.erb in pghero-2.0.0
- old
+ new
@@ -5,16 +5,26 @@
<h1 style="float: left;">Queries</h1>
<% if @historical_query_stats_enabled %>
<%= render partial: "query_stats_slider" %>
+ <% elsif @database.query_stats_table_exists? && (columns = @database.missing_query_stats_columns).any? %>
+ <div style="clear: both;">
+ <p>Add missing columns to re-enable historical query stats.</p>
+ <pre><code><% @database.missing_query_stats_columns.each do |column| %>ALTER TABLE pghero_query_stats ADD COLUMN "<%= column %>" <%= column == "query_hash" ? "bigint" : "text" %>;
+<% end %></code></pre>
+ <p>Then restart the web server.</p>
+ </div>
<% end %>
<% if @query_stats_enabled %>
<% if @error %>
<div class="alert alert-danger">Cannot understand start or end time.</div>
<% elsif @query_stats.any? || @historical_query_stats_enabled %>
<%= render partial: "queries_table", locals: {queries: @query_stats, sort_headers: true} %>
+ <script>
+ highlightQueries();
+ </script>
<% else %>
<p>Stats are not available yet. Come back soon!</p>
<% end %>
<% else %>
<p>Query stats are not enabled.</p>