GithubHelp home page GithubHelp logo

Handle schema changes about logidze HOT 4 CLOSED

palkan avatar palkan commented on July 23, 2024
Handle schema changes

from logidze.

Comments (4)

charlie-wasp avatar charlie-wasp commented on July 23, 2024 1

For me the third option looks the most reasonable, however it might break some apps, using logidze already.

First two options are less reasonable (imho), because if there wasn’t a column at the certain point in time, so we shouldn’t pretend, that it was :)

Maybe we can implement first and third, and provide a switch between them for users.

What do you think, @palkan?

from logidze.

palkan avatar palkan commented on July 23, 2024 1

Maybe we can implement first and third, and provide a switch between them for users.

Yeah, that make sense. And make the third to be a default.

from logidze.

palkan avatar palkan commented on July 23, 2024

Btw, we can use AR missing attribute exception https://github.com/rails/rails/blob/8fd69db783b14dcdde92f4682b8d3c66bdbcb90b/activemodel/lib/active_model/attribute_methods.rb#L470

from logidze.

dsalahutdinov avatar dsalahutdinov commented on July 23, 2024

Hello @palkan and @charlie-wasp
Could you please help with this issue sharing your suggestions about way of solving it.

Adding new column (the same case if we change column white list and regenerate triggers) causes starting to track changes of it.
If I've got right, somewhere here we need to determine that we do not have changes of that column. (but how?) All the knowledge about tracking columns list is in the sql triggers so we do not have the way to get it in ruby directly (because it is known only as options when we generate the model table triggers.

One way is to configure tracking columns list in the model class with dsl, and then generate the migration with help of this data, so in this case we will be able to track the case when versions history do not have changes of some column.

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.