orppst / pst-api-service

the api service for the tool
Mozilla Public License 2.0
0 stars 0 forks source link

API reinitialises the database on restart #21

Open DJWalker42 opened 8 months ago

DJWalker42 commented 8 months ago

An API service restart reinitialises the database meaning it returns the database to the state as defined by 'AppLifeCycleBean', which is essentially the implementation of 'EmerlinExample'. It now might be more useful to have a one-off database initialisation command that is separate from the API service such that an API service restart does not wipe the database. Is this possible?

pahjbo commented 8 months ago

Actually, I think that the initialisation is idempotent, but I take the point that the example instance should probably be moved out on final publication. It would be a good thing to set up as a script with the https://github.com/orppst/pst-cli-app when that is sufficiently developed

pahjbo commented 7 months ago

Clarification - the code that adds the content to the database does not destroy anything - however the JPA deployment itself is set to drop tables first, so that every test deployment will start afresh - have made a change to the deployed settings so that only table updates are attempted