Git Product home page Git Product logo

Comments (4)

l3pp4rd avatar l3pp4rd commented on May 24, 2024

hm, maybe there could be few strategies on how the logs should be stored.

  • aggresive, stores every versioned field, does not care about changeset
  • default, current behavior, stores only changedset

Or by default it could just not care about a field which is not in revision list. This option could probably be configurable.

Any other ideas? Whats your opinion?

from doctrineextensions.

vladar avatar vladar commented on May 24, 2024

After some thinking, I afraid that you must have all revisions to make "revert" work properly with changeset-based strategy.

Otherwise you'll get inconsistent behavior: sometimes objects will be reverted to expected state, but sometimes you'll get object in mixed state. E.g. blog post "title" is restored, but "text" remains in current state, because older revision, which contained last "text" change was deleted.

Possible workaround is to merge changesets from revisions, which you are going to delete, but that makes maintenance rather complex.

I'd prefer aggressive strategy, because it is way simpler to maintain (both code and data). Of course it will take more disk space, but that shouldn't be a problem - you may enable compression for this data on RDBMS level and probably one day in MongoDb too.

But if using this approach it would be still useful to know which fields were modified in this revision, as it's the cool feature, which changeset-based strategy has.

What do you think?

from doctrineextensions.

l3pp4rd avatar l3pp4rd commented on May 24, 2024

I think that I should think about all those mentioned issues and when we should decide which solution is best to implement. I think I'll add an option to Loggable annotation, to configure either to store all versioned fields all the time or only the changeset. The full storage would require additional flag or something to identify which fields were changed in this specific log entry. Anyway I need to rethink it more

from doctrineextensions.

l3pp4rd avatar l3pp4rd commented on May 24, 2024

solved it in simple way, which is: do not trigger exception when the object is not fully reverted, references #163

from doctrineextensions.

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.