快车道

 

【转】spring.datasource.schema/data 根据官网深趴

来源:https://blog.csdn.net/qq_41055045/article/details/122038093

推荐适用于测试的 springboot 2.5 及以上版本中 application.yaml 配置示例:
# DataSource Config
spring:
  datasource:
    driver-class-name: org.h2.Driver
    url: jdbc:h2:mem:test
    username: root
    password: test
  sql:
    init:
      schema-locations: classpath:db/schema-h2.sql
      data-locations: classpath:db/data-h2.sql
      mode: always

不推荐的废弃配置方式:
spring:
  datasource:
    schema: classpath:db/schema-h2.sql
    data: classpath:db/data-h2.sql

posted on 2023-06-29 12:28 快车道 阅读(48) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿(1)

我参与的团队

随笔分类(3)

随笔档案(11)

IT学习网站

路过的博客

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜