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

Does not create customer table automatically #3

Open
erguluur opened this issue Jan 8, 2022 · 3 comments
Open

Does not create customer table automatically #3

erguluur opened this issue Jan 8, 2022 · 3 comments

Comments

@erguluur
Copy link

erguluur commented Jan 8, 2022

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

@nurullahsakar
Copy link

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

@niravvarma
Copy link

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.

@DmitriKonnovNN
Copy link

DmitriKonnovNN commented Apr 19, 2022

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.

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

4 participants