在 spring boot 项目中使用 hibernate 设置 hibernate.hbm2ddl.auto=update 时,在新的环境部署时会自动创建数据库表结构,但不会执行 data.sql 中的数据库初始语句。但使用 create,就会在第二次启动时清除数据库重新创建。
期待的结果 在 hibernate 中使用 hmb2ddl.auto=update 的同时,部署到新环境时自动初始化 data.sql 里面的语句插入一些初始数据
在 spring boot 项目中使用 hibernate 设置 hibernate.hbm2ddl.auto=update 时,在新的环境部署时会自动创建数据库表结构,但不会执行 data.sql 中的数据库初始语句。但使用 create,就会在第二次启动时清除数据库重新创建。
期待的结果 在 hibernate 中使用 hmb2ddl.auto=update 的同时,部署到新环境时自动初始化 data.sql 里面的语句插入一些初始数据