microservices icon indicating copy to clipboard operation
microservices copied to clipboard

Does not create customer table automatically

Open erguluur opened this issue 4 years ago • 3 comments

Even when i change to ddl-auto: create-drop, it does not create customer table in the application startup

erguluur avatar Jan 08 '22 17:01 erguluur

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

nurullahsakar avatar Feb 16 '22 16:02 nurullahsakar

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.

niravvarma avatar Feb 28 '22 19:02 niravvarma

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.

DmitriKonnovNN avatar Apr 19 '22 11:04 DmitriKonnovNN