Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hibernate database initialization or not ? #26

Closed
Nolife999 opened this issue Jun 15, 2020 · 1 comment
Closed

Use hibernate database initialization or not ? #26

Nolife999 opened this issue Jun 15, 2020 · 1 comment

Comments

@Nolife999
Copy link
Collaborator

Hello,

The schema-postgresql.sql from src/main/ressources had been removed in a previous commit. We made this file in toulouse so that hibernate could initialize automatically the database on startup
when the following properties are set :
spring.datasource.initialization-mode=always
spring.datasource.initialize=true
spring.jpa.hibernate.ddl-auto=update

This autoinitialization works well with postgres as the script won't do anything if the database is already created. That was very handy when we deployed the application on the cloud or if we want to patch the application.

The other and current option is that the user builds itself the database with the script is2_postgres.sql found in db . Also the current docker compose uses this file and it should works well.
Will our deployements on the cloud use docker image or do we have to add a call to this external script for database initialization ?

Note also that the schema-postgresql.sql is more complicated to update than the is2_postgres.sql

What option do we want ?

@francescoamato
Copy link
Contributor

Hi @Nolife999,
we usually use the scripts contained in the db folder, for the different databases.
The is2_postgres.sql file is also used for building the docker image in the db.Dockerfile file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants