Git Product home page Git Product logo

Comments (7)

jung-thomas avatar jung-thomas commented on June 27, 2024

Have you ran a cds build command first? That should create the /gen/ folder and output the csn model.

from cloud-cap-hana-swapi.

thymdi avatar thymdi commented on June 27, 2024

I see the model path after cds build but with cds deploy --to hana the /gen/ folder is re-created and csn.json is moved to gen/db/last-dev.

Also, loading the data gives a load of errors of two types:
CompileMessage {
message: 'CSN property ‘on’ can only be used alternatively to ‘keys’',
location: [Object],
'$location': [Object],
validNames: null,
severity: 'Error'

and

CompileMessage {
message: 'CSN property ‘mixin’ is not expected in ‘projection’',
location: [Object],
'$location': [Object],
validNames: null,
severity: 'Error'

from cloud-cap-hana-swapi.

jung-thomas avatar jung-thomas commented on June 27, 2024

I see the model path after cds build but with cds deploy --to hana the /gen/ folder is re-created and csn.json is moved to gen/db/last-dev.

Interesting - it does that for me now as well. It seems like another cds build is needed after the cds deploy. I'm not sure why the deploy is doing that though. Perhaps a recent change to the way deploy works or a bug. But it does seem like just running another cds build afterwards restores the full /gen folder.

Although I don't receive any of the errors you reported when running the load script. Here is my output when I ran it just now:
image

Perhaps you can post a screenshot to get a sense of where those errors might be coming from. Also try running cds version from the same place you run the load script. Maybe you are picking up an older, global install of CDS. Especially the mixin not expected in the projection sounds like maybe an older release. I just tested against the latest available cds version.
image

from cloud-cap-hana-swapi.

thymdi avatar thymdi commented on June 27, 2024

When loaded the data using the restored /gen/ folder (after second build), got no errors.
Still getting the errors if I load with /gen/db/last-dev model.
The two generated csn.json files have some differences.

from cloud-cap-hana-swapi.

jung-thomas avatar jung-thomas commented on June 27, 2024

Yes, I'm not sure why the srv content within /gen is getting wiped out by the deploy. Seems to be not right to me. But that csn in the /gen/db/last-dev is something different. It's how cds is just keep track of the changes that have been made to any part of the data model that uses persistence journaling/Schema Evolution.

@cds.persistence.journal
- this causes the creation of hdbmigrationtable instead of regular hdbtable. https://blogs.sap.com/2022/02/15/sap-cap-recent-enhancements-the-hana-dev-should-know-about/
But this isn't the complete model, it's only a partial model used internally within CAP to track changes.

For the data load or any other usage of the CAP APIs you want the full model that should be in the /gen service folder. So, the whole role problem here seems to be that /gen/srv is getting deleted for some reason when the cds deploy runs. But at least there is an easy work around to just run cds build again after a deploy to bring it back.

from cloud-cap-hana-swapi.

thymdi avatar thymdi commented on June 27, 2024

Ok, I see. Thanks for explaining.

from cloud-cap-hana-swapi.

jung-thomas avatar jung-thomas commented on June 27, 2024

I did add two notes to the README.md about this situation and I'll enter an internal ticket to try and see if we can figure out why the /gen/srv is getting cleared in the first place.
Thanks,
Thomas Jung

from cloud-cap-hana-swapi.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.