josegonzalez / cakephp-version

CakePHP3: plugin that facilitates versioned database entities
MIT License
51 stars 22 forks source link

Versioning of associated table fields #49

Closed AvelinoJavier closed 2 years ago

AvelinoJavier commented 2 years ago

First of all thanks for developing this plugin. Is it possible to version table association changes?

jeremyharris commented 2 years ago

Hi @AvelinoJavier,

What do you mean? If you mean versioning associated data changes, then yes, that's exactly what this plugin does! It doesn't, however, track deletions.

If you're talking about versioning changes done within the table code (eg adding a new association, changing the conditions on another), then no, it doesn't. The plugin is really only for database data.

What kind of use case do you have? I might be able to answer your question better.

AvelinoJavier commented 2 years ago

My case is that I have a Roles table that is associated with a Permissions table in a many-to-many way. I need it to be versioned when a permission is added/removed from a role. Now when I do that operation it doesn't version those types of changes.

jeremyharris commented 2 years ago

Correct, it doesn't record additions and deletions, only changes. I'm not sure how it could given how this plugin works. I think you'll need a different audit log library for that.

AvelinoJavier commented 2 years ago

It is understood. thanks for the clarification