Help regarding auto seeding of db tables from the auto generated schema
Have a spring boot application where i am using Spring Data JPA and creating the db schema automatically using the ORM.
Now my requirement is to automatically run the schema .sql file to create tables and relationships when building and deploying the project the project . Need some help.
Here is my application config:
5 Replies
⌛
This post has been reserved for your question.
Hey @BigWiz! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Have you ever heard about Flyway?
It has a "concept" called afterMigrate.
This could help you with that...
Here's an example:
https://github.com/galdino/ufood-api/blob/main/src/main/resources/db/testdata/afterMigrate.sql
GitHub
ufood-api/src/main/resources/db/testdata/afterMigrate.sql at main ·...
Rest API with Spring, Spring Boot, Spring Data JPA - galdino/ufood-api
heard it for the first time, found a good baeldung tutorial, and tried it out. will implement in my own app within sometime, thanks for letting me know about this awesome piece of software.
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@146662188122243072>.