GithubHelp home page GithubHelp logo

Deployment on Heroku about logidze HOT 8 CLOSED

palkan avatar palkan commented on July 4, 2024
Deployment on Heroku

from logidze.

Comments (8)

palkan avatar palkan commented on July 4, 2024

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(
I need a little bit more time for investigation.

from logidze.

nobodyzzz avatar nobodyzzz commented on July 4, 2024

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)

from logidze.

palkan avatar palkan commented on July 4, 2024

@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.

from logidze.

palkan avatar palkan commented on July 4, 2024

@dedman
I've updated the gem (version 0.3.1), now should work on Heroku with PostgreSQL 9.6 without any tweak.

from logidze.

dedman avatar dedman commented on July 4, 2024

Thanks @palkan!

from logidze.

Frexuz avatar Frexuz commented on July 4, 2024

Then why is the alter database statements still in the generated migration template if it's not needed? 🤔
https://github.com/palkan/logidze/blob/master/lib/generators/logidze/install/templates/migration.rb.erb#L10

from logidze.

palkan avatar palkan commented on July 4, 2024

These statements are only included for PostgreSQL <9.6 where we need them (see #11 (comment))

from logidze.

Frexuz avatar Frexuz commented on July 4, 2024

Ah, my mistake :) Thanks

from logidze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.