Spring boot 如何使用schema-h2.sql
弹簧靴2.4.3 schema-h2.sql似乎没有效果 已创建H2数据库,但未创建任何表 schema-h2.sql:Spring boot 如何使用schema-h2.sql,spring-boot,Spring Boot,弹簧靴2.4.3 schema-h2.sql似乎没有效果 已创建H2数据库,但未创建任何表 schema-h2.sql: DROP TABLE IF EXISTS Blogger; CREATE TABLE Blogger( id bigint NOT NULL, name varchar(100), age int, PRIMARY KEY (id) ); DROP TABLE IF EXISTS Story; CREATE TABLE Story( id bigint NOT NULL
DROP TABLE IF EXISTS Blogger;
CREATE TABLE Blogger(
id bigint NOT NULL,
name varchar(100),
age int,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS Story;
CREATE TABLE Story(
id bigint NOT NULL,
title varchar(100),
content varchar(400),
posted date,
blogger_id int,
PRIMARY KEY (id)
);
application.properties:
spring.thymeleaf.cache=false
spring.web.locale-resolver=fixed
spring.web.locale=en
spring.h2.console.enabled=true
spring.h2.console.path=/db
spring.datasource.url=jdbc:h2:mem:testdb
有什么建议吗?
谢谢大家! 找到了解决方案,我需要添加spring.datasource.platform=h2属性