When I integrate Spring Boot with PostgreSQL to build up a backend.

So far, I have used flyway to migrate database in postgreSQL but I have to write sql script by myself.
In my mind, I think a solution as the following description:

- When Spring Boot application starts.
- It will generate a sql script from all entity classes which I defined in model folder.
- The sql script will be place in resource/db/migration folder and be used by flyway to migrate in postgreSQL.

Please give me an advice or any suggestions or something like this to perform my idea.
Any information is highly appreciated !!!