-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I'm unsure how to do timescale updates in Rails. There is a Timescaledb::Extension.update! but it does not work. I guess I would have to have a migration that does something like
ApplicationRecord.connection.execute('ALTER EXTENSION timescaledb UPDATE')
?
I tried to execute that last statement in the console, but it didn't work:
/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in 'PG::Connection#exec': ERROR: extension "timescaledb" cannot be updated after the old version has already been loaded (PG::FeatureNotSupported)
HINT: Start a new session and execute ALTER EXTENSION as the first command. Make sure to pass the "-X" flag to psql.
I assume it would also not work in a migration since it would not be the first statement executed. I'm working on making the update part of an initialization script for my docker container (we're using Kamal to manage the production deployment of Timescale).
Metadata
Metadata
Assignees
Labels
No labels