diff --git a/lib/timescaledb/schema_dumper.rb b/lib/timescaledb/schema_dumper.rb index 17a9d71..0b2df70 100644 --- a/lib/timescaledb/schema_dumper.rb +++ b/lib/timescaledb/schema_dumper.rb @@ -154,7 +154,7 @@ def timescale_index_options_for(hypertable) def timescale_continuous_aggregates(stream) return unless Timescaledb::ContinuousAggregates.table_exists? - Timescaledb::ContinuousAggregates.all.find_each do |aggregate| + Timescaledb::ContinuousAggregates.order(:view_name).find_each do |aggregate| refresh_policies_opts = if (refresh_policy = aggregate.jobs.refresh_continuous_aggregate.first) interval = timescale_interval(refresh_policy.schedule_interval) end_offset = timescale_interval(refresh_policy.config["end_offset"])