cancel
Showing results for 
Search instead for 
Did you mean: 

CAP - DB Deployer failing after renaming a column of an entity

Mohit_Agarwal
Associate
Associate
0 Kudos

Hi everyone,

I have been working on a CAP Node.js project where I have an order entity. My MTA project is deployed to BTP and running successfully.

I made a spelling error in a column of the order entity in schema.cds file. If you look closely, earlier it was 'empdigitialid'. Now I have corrected it to be 'empdigitalid'. After renaming the entity, when I try to deploy the artifacts, it is failing with the following error:

com.sap.hana.di.table: Database error 287: cannot insert NULL or update to NULL: EMPDIGITALID: line 1 col 1 (at pos 0)

Old schema:

Mohit_Agarwal_1-1681218401846.png

Updated schema:

Mohit_Agarwal_0-1681218343056.png

Log file:

Mohit_Agarwal_3-1681218537697.png

Link to log file: cafti-cds-db-deployer.log

Please let me know if you need any other details.

Thanks!!

View Entire Topic
divyeaggarwal
Explorer
0 Kudos

Hi Mohit

It might be because there is some entry in the table database. Please delete all the database entries and deploy again. It should work.

Regards

Divye

Mohit_Agarwal
Associate
Associate
0 Kudos

Hi Divye,

Thanks for the clarification.

Yes, there are entries in the database. But, if you see line number 523 of the log file, it says

"CAFTI_ORDER": the table contains data; recreating it and copying the data (STDOUT, APP/TASK/deploy)#"

This shows that CAP takes care of the data itself. It's just that it failed while migrating the DB object, as visible in the next line:

Error: com.sap.hana.di.table: "CAFTI_ORDER": could not migrate the database object [8250019] (STDOUT, APP/TASK/deploy)#

I am really not sure if I am supposed to delete all the entries for making a change to the column name. Do you know of any way to do this without losing the entries of the table?

Thanks for your help!!

Regards,

Mohit