-
Notifications
You must be signed in to change notification settings - Fork 28
Make Scenic Integration Optional #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Make Scenic Integration Optional #124
Conversation
murrayju
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission! Just a bit of feedback, if you don't mind addressing it.
|
@murrayju Please note that I also bumped some tool versions to ensure that the project is up to date when running the tests locally. For what it's worth, to get all the tests running locally, I had to make some changes to some surrounding code. I haven't committed it yet but it may be worth it to get it included. Specifically the test helper diff --git a/lib/timescaledb/continuous_aggregates.rb b/lib/timescaledb/continuous_aggregates.rb
index 5c4e61f..85d4293 100644
--- a/lib/timescaledb/continuous_aggregates.rb
+++ b/lib/timescaledb/continuous_aggregates.rb
@@ -3,11 +3,15 @@ module Timescaledb
self.table_name = "timescaledb_information.continuous_aggregates"
self.primary_key = 'materialization_hypertable_name'
- has_many :jobs, foreign_key: "hypertable_name",
- class_name: "Timescaledb::Job"
+ has_many :jobs,
+ foreign_key: "hypertable_name",
+ primary_key: "view_name",
+ class_name: "Timescaledb::Job"
- has_many :chunks, foreign_key: "hypertable_name",
- class_name: "Timescaledb::Chunk"
+ has_many :chunks,
+ foreign_key: "hypertable_name",
+ primary_key: "materialization_hypertable_name",
+ class_name: "Timescaledb::Chunk"
scope :resume, -> do
{
diff --git a/spec/support/active_record/schema.rb b/spec/support/active_record/schema.rb
index 6924962..b0a2a91 100644
--- a/spec/support/active_record/schema.rb
+++ b/spec/support/active_record/schema.rb
@@ -36,6 +36,10 @@ def setup_tables
end
def teardown_tables
+ Timescaledb::ContinuousAggregates.all.each do |continuous_aggregate|
+ ActiveRecord::Base.connection.execute("DROP MATERIALIZED VIEW IF EXISTS #{continuous_aggregate.view_name} CASCADE")
+ end
+
ActiveRecord::Base.connection.tables.each do |table|
ActiveRecord::Base.connection.drop_table(table, force: :cascade)
end |
|
@calmacleod lets get the tests to pass in this PR. Please add your fixes |
|
@murrayju The PR has been updated with the following:
|
|
Thanks @calmacleod. It looks like the tests are still failing in the checks here. Can you take another look? |
Resolve Scenic Integration Causes Issues with Multiple Databases by adding optional configuration block with option to disable Scenic integration