Before closing the schema class, there is an extra new line that should be removed
ActiveRecord::Schema.define(version: 9) do
...
create_continuous_aggregate "temperature_events", <<-SQL
SELECT time_bucket('1 day'::interval, events.created_at) AS time_bucket,
avg(events.value) AS avg
FROM events
WHERE ((events.event_type)::text = 'temperature'::text)
GROUP BY (time_bucket('1 day'::interval, events.created_at))
ORDER BY (time_bucket('1 day'::interval, events.created_at));
SQL
add_continuous_aggregate_policy "temperature_events", "10 days", "1 day", "1 hour"
end
Before closing the schema class, there is an extra new line that should be removed