Giter Site home page Giter Site logo

Comments (2)

matgaw avatar matgaw commented on June 12, 2024

Current workaround - instead of adding this setting to config/initializers/logidze.rb - add the following to config/application.rb:

config.after_initialize do
      # disable loading of log data by default
      # this needs to stay enabled if we are inside Rake task (e.g. during a migration), because otherwise it creates
      # errors with ActiveRecord trying to reach non-existent columns - hence the if below
      # note that this can't be moved to config/initializers because it's too early there to detect if we're inside
      # a Rake task
      if Rake.application.rakefile.blank?
        Logidze.ignore_log_data_by_default = true
      end
    end

from logidze.

palkan avatar palkan commented on June 12, 2024

This is weird, because at the point of third migration, Rails shouldn't refer the already-removed some_column.

Maybe, it's not that weird as it seems. Rails keeps the database schema in a cache (you can reset it by running SomeColumn.reset_column_information). The reason why it's affected by the ignore_log_data_by_default setting is as follows: when a table has ignored columns, Active Record always uses an explicit list of columns to fetch instead of SELECT *; thus, it adds a no-longer-existing column to the list and fails. If you don't have any ignored columns, Rails uses SELECT * and everything works fine.

So, it's not really related to Logidze, but the way ignored_columns works.

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.