I have a springboot application and I would like to connect my application to the H2 database. Below is my schema.
CREATE TABLE IF NOT EXISTS employee
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(250) NOT NULL,
last_name VARCHAR(250) NOT NULL,
email VARCHAR(250) NOT NULL,
posit VARCHAR(250) NOT NULL,
mobile INTEGER NOT NULL
);
Below is is my application.properties.
spring.jpa.defer-datasource-initialization=true
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.path=/h2-console
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false
spring.datasource.initialize=true
spring.datasource.schema=schema.sql
spring.datasource.data=schema.sql
spring.jpa.hibernate.ddl-auto = update
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type=TRACE
However, I face the following issue:
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "create table employee (id bigint not null auto_increment, email varchar(255), first_name varchar(255), last_name varchar(255), mobile integer, posit varchar(255), primary key (id)) engine[*]=InnoDB"; expected "identifier"; SQL statement.
May I know what is the issue and how do I change this?