-
Notifications
You must be signed in to change notification settings - Fork 81
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
Deployment on Heroku #11
Comments
Logidze uses custom database variables (to conditionally track changes and responsible users) and thus requires superuser privileges (unless 9.6 haven't been released). And Heroku doesn't provide superuser access (or other ways to alter databases or roles). So, I had no idea how we can fix this for 9.5 so far. Sorry( |
Face the same issue on Amazon RDS, as workaround use this: require 'active_record/connection_adapters/postgresql_adapter'
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.set_callback :checkout, :after do
execute("SELECT set_config('logidze.disabled', 'off', false)")
execute("SELECT set_config('logidze.responsible', 'off', false)")
end (Put to config/initializers/logidze_workaround.rb) |
@nobodyzzz Thanks for the workaround! Added to the readme. I just want to add that you still have to remove "ALTER DATABASE ..." statements from the installation migration. |
@dedman |
Thanks @palkan! |
Then why is the alter database statements still in the generated migration template if it's not needed? 🤔 |
These statements are only included for PostgreSQL <9.6 where we need them (see #11 (comment)) |
Ah, my mistake :) Thanks |
First of all, awesome gem!
I just tried to deploy to Heroku, and the migration returned this error.
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied to set parameter "logidze.disabled" CONTEXT: SQL statement "ALTER DATABASE ***DB_NAME*** SET logidze.disabled TO off"
Any ideas on how this might be fixed?
The text was updated successfully, but these errors were encountered: