1

I have a Spring boot application that uses JPA with Hibernate. It already connect to a primary data source for all transactions.

Now the task in hand is that I need to dynamically create Database Schema in a different database. For instance,

For project 1, create schema 1 in Database X For project 2, create schema 2 in Database X

Later, these databases will be used by others externally. I am looking for the best way to get this done.

The Cloud Guy
  • 963
  • 1
  • 8
  • 20

1 Answers1

0

In case of defining multiple datasources in spring boot project, you have to declare associated beans in your configuration. With spring.jpa.hibernate.ddl-auto=create it will automatically create the schema in right database as answered here

zpavel
  • 951
  • 5
  • 11