Hey guys checkout this our frndly raggin as a part of our reunion @ kv mgs
Create Schema automatically https://stackify.com/spring-boot-level-up/ if you want to add initial data to the database, you can create files with standard names such as schema.sql, data.sql or import.sql to be picked up automatically by Spring Boot auto-configuration, or you can define your DataSource bean to load a custom named SQL script manually: @Configuration public class PersistenceConfig { @Bean public DataSource dataSource () { EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder (); EmbeddedDatabase db = builder . setType ( EmbeddedDatabaseType . H2 ) . addScript ( "mySchema.sql" ) . addScript ( "myData.sql" ) . build (); return db ; } } This has the effect of overriding the auto-configured DataSource bean, but not the rest of the default beans that make up the configuration of the persistence layer. The entry point for...
Comments
vineet