版本:
Spring: 5.2.16.RELEASE
Spring Integrations: 5.3.9.RELEASE
PostgreSQL: 13.x
我已经实现了一个纯 Spring 5.x webapp;没有 Spring Boot。
我正在使用JdbcMetadataStore
并要求使用位于类路径中的模式定义初始化 PostgreSQL 数据库:
classpath:org/springframework/integration/jdbc/schema-postgresql.sql
在关于该主题的一篇非常有用的文章之后,以下是我放入的属性spring.properties
:
spring.integration.jdbc.initialize-schema=always
spring.integration.jdbc.schema=classpath:org/springframework/integration/jdbc/schema-postgresql.sql
这不起作用。经过研究这个问题,我了解到启动初始化是支持的,但是在 Spring Boot 中。
问题:没有在 webapp 初始化期间在其他地方显式处理此 SQL 脚本的执行,是否有任何标准方法可以在启动时加载上面列出的脚本?注意:我没有使用schema.sql
脚本或类似的东西来初始化我的后端。