Comments (4)
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.
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.
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.
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)
- Entity with TimestampableEntity trait fails on PUT operation HOT 6
- [Loggable] restore data without flush HOT 1
- Timestampable not working in 2.17 HOT 2
- [Timestampable] symfony/clock integration
- [Timestampable] symfony/clock integration
- SoftDeleteable is ignored and delete records hardly HOT 3
- [Loggable] Incomplete documentation on how to use custom LogEntry entity HOT 1
- Timestampable (and maybe more extensions) don't work with DBAL 4.0.0-RC2 HOT 6
- Semantical Error WITH Doctrine ORM 3.0 HOT 2
- [Tree & Doctrine 3] Fatal Compile Error: Declaration of Gedmo\Tree\Entity\Repository\NestedTreeRepository::__call($method, $args) ... HOT 2
- string $targetTableAlias HOT 2
- in Symfony 7 annotation_reader no exists
- [Loggable] Add option to store prev data
- The bundle not set automatcly the value to updated_at and created_at columns when persisting data HOT 5
- Missing Reference Listener in the documentation
- [Tree] [materializedPath] Deleting parent removes children when onDelete="restrict" HOT 2
- Cannot get DoctrineExtensions to work with Symfony 7 HOT 2
- The service "gedmo.listener.softdeleteable" has a dependency on a non-existent service "annotation_reader". HOT 2
- Table ext_log_entries very very slow on queries HOT 7
- Timestampable issue mapping expects array HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrineextensions.