josegonzalez / cakephp-version

CakePHP3: plugin that facilitates versioned database entities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Versioning of associated table fields

AvelinoJavier opened this issue · comments

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

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.

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.

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.

It is understood. thanks for the clarification