Does not create customer table automatically
Even when i change to ddl-auto: create-drop, it does not create customer table in the application startup
if your application properly connect to the DB, please check the structure of your application.yml (care about spaces and tabs). For example in IntelliJ, create-drop keywork have to be in yellow
I also faced the same issue. Yup, it has to do with formatting of the YAML file. I just copied the file from the repo and then it worked.
Hello everyone! This is an simplified solution (ONLY for POSTGRES running within docker container):
-
make sure you have no previously created volumes mounted to your target Postgres-Database. Otherwise initialisation is skipped. a) If you'd want your DB to be initialised with just one DATABASE:
-
in docker-compose.yml add:
environment: POSTGRES_DB: name_of_your_db (e.g.: POSTGRES_DB: customer) POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256"
b) If you'd want to have several DB initialised:
- add to docker.compose
environment: POSTGRES_MULTIPLE_DATABASES: customer, fraud POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256" - make sure docker-compose copies your shell-initialising script into concerned volume.
- in case your OS is Windows make sure your shell-script is correctly interpreted by UNIX systems.
I just want make it clear. This is a database initialisation and not pre-population.