Closed ftomassetti closed 4 months ago
Alternatively, it could make sense to expose a method ensureTheDBIsInitialized
that can be safely called without losing all the content of the database, if the database has been already initialized
Until now I only used this for testing, but I agree that this is a dangerous operation. I even doubt whether this init
should be available in the model server. It is also directly callable through the command line, where you can also create a new database.
Hi Federico, I just found out that the create database was always done when starting the server. This was not intentional, but the side effect of JS/TS script (database.ts
) that can be run as an application.
When loading the server this code always ran at the start.
I am removing it in the history branch, and will probably remove the database.ts script as well.
@ftomassetti If you are using the database.ts script, we should see how we can replace this.
This has been fixed,
Currently the
init
API must be called explicitly to initialize the database.@joswarmer would it make sense if, when starting the repository, we check if the database has already the expected classes, and if not we call the
init
logic automatically?If you think it makes sense, I can prepare a PR.