Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何使用schema-h2.sql_Spring Boot - Fatal编程技术网

Spring boot 如何使用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

弹簧靴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,
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属性