Spring boot run fly way migration for test profile

Viewed 86

I want to load init data into the postgres db table when the spring boot application starts up locally. I have application-test.yml as active profile. This is only for the testing purpose and I don't want to run this script in production i.e for default application.yml and my prod config just works fine.

I am using spring data jpa, hibernate and postgres and I have my postgres db running locally with the database schema. All I want to have is that I want to insert some data to one of the table if the active profile is set to test during application start up.

Is there a way to do this?

0 Answers
Related