cap-js / change-tracking

CDS plugin providing out-of-the box support for automatic capturing, storing, and viewing of the change records of modeled entities.
https://cap.cloud.sap/docs
Apache License 2.0
16 stars 6 forks source link

Change tracking not working in Multi-tenant CAP Nodejs Project #85

Open vishalsharma190596 opened 4 months ago

vishalsharma190596 commented 4 months ago

I am trying to add the plugin @cap-js/change-tracking to store change logs for an Entity in my CAP Nodejs multi tenant Project.

I have followed the guide to implement this Change Tracking Plugin for SAP Cloud Application Programming Model (CAP).

I have added the @changelog annotations to an entity for which I am trying to track changes. This brings the facet in the fiori elements object page. And when I trying to edit a record and save it from the app I am getting below error:

no such table: sap_changelog_ChangeLog in: INSERT INTO sap_changelog_ChangeLog

Below is how I have added the annotation to my service entity in file app/managebooks/annotations.cds :

annotate service.Books with { title @changelog; };

It needs the table sap_changelog_ChangeLog to persist the change log entries but just by adding the module in package.json and adding annotation to properties is not generating the table while doing local testing with sqlite. Please let me know if there are some steps missed here.

Thanks & Regards, Vishal Sharma

vishalsharma190596 commented 4 months ago

Please find the Git repo for the sample app below: https://github.tools.sap/I583347/change-tracking.git

nkaputnik commented 4 months ago

@vishalsharma190596 did you also redeploy/build the database after installing the change log plugin?

Best, Nick

vishalsharma190596 commented 4 months ago

@nkaputnik Yes I have done the cds build and redeployement multiple times. Still no issues. Request you to please get the sample project from the git repo I have mentioned above and let me know if there are any issues you could recognize. Also would appreciate it if you could try to replicate the change tracking in the same multi-tenant project from the git repo.

Thanks & Regards, Vishal Sharma

nkaputnik commented 4 months ago

Hello @vishalsharma190596 can you give me you SAP User ID, I'll set up a meeting next week to jointly go through the use case, the repo you gave me doesn't have any noticable issues for me.

Best, Nick

vishalsharma190596 commented 4 months ago

Sure Nick,

My SAP email id is vishal.sharma08@sap.com

Thanks & Regards, Vishal Sharma