'Spring boot: H2 test database don't recognize "serial4"
I'm using h2 as in memory in order to test a spring repository class. But when h2 try to create the table return:
org.h2.jdbc.JdbcSQLNonTransientException: Unknown data type: "SERIAL4";
The ddl of the table show that the id column is a serial4 datatype.
id serial4 NOT NULL
But h2 don't recognize that. The origina table is under postgresql.
There is any type of solution?
Thanks
UPDATE:
I've updated the applications.yaml of test enviroment, but the result is the same. Here's the updated yaml file:
spring:
application:
name: test_name
jpa:
database-platform: org.hibernate.dialect.H2Dialect
show-sql: true
properties:
generate-ddl: true
hibernate:
ddl-auto: create
format_sql: true
jdbc:
batch_size: 500
lob:
non_contextual_creation: true
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:mydb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_LOWER=TRUE;MODE=POSTGRESQL;INIT=CREATE SCHEMA IF NOT EXISTS test_schema\;
logging:
level:
root: INFO
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
