Browse Source

Adjust IDENTITY in DDLs for H2 2.x compatibility

See gh-29200
pull/29745/head
Henning Poettker 4 years ago committed by Stephane Nicoll
parent
commit
e3d0f1feee
  1. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/city-schema.sql
  2. 10
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java
  3. 12
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema.sql
  4. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/data-city-schema.sql
  5. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/another.sql
  6. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/lexical-schema-aaa.sql
  7. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/schema.sql
  8. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/schema.sql
  9. 2
      spring-boot-project/spring-boot-cli/src/test/resources/schema-all.sql
  10. 2
      spring-boot-project/spring-boot/src/test/resources/schema.sql
  11. 2
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/src/main/resources/schema.sql
  12. 2
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc/src/main/resources/schema.sql

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/city-schema.sql

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
CREATE TABLE CITY (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30),
state VARCHAR(30),
country VARCHAR(30),

10
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -98,9 +98,11 @@ class ConnectionFactoryHealthIndicatorTests { @@ -98,9 +98,11 @@ class ConnectionFactoryHealthIndicatorTests {
CloseableConnectionFactory connectionFactory = createTestDatabase();
try {
String customValidationQuery = "SELECT COUNT(*) from HEALTH_TEST";
Mono.from(connectionFactory.create()).flatMapMany((it) -> Flux
.from(it.createStatement("CREATE TABLE HEALTH_TEST (id INTEGER IDENTITY PRIMARY KEY)").execute())
.flatMap(Result::getRowsUpdated).thenMany(it.close())).as(StepVerifier::create).verifyComplete();
String createTableStatement = "CREATE TABLE HEALTH_TEST (id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY)";
Mono.from(connectionFactory.create())
.flatMapMany((it) -> Flux.from(it.createStatement(createTableStatement).execute())
.flatMap(Result::getRowsUpdated).thenMany(it.close()))
.as(StepVerifier::create).verifyComplete();
ReactiveHealthIndicator healthIndicator = new ConnectionFactoryHealthIndicator(connectionFactory,
customValidationQuery);
healthIndicator.health().as(StepVerifier::create).assertNext((actual) -> {

12
spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema.sql

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
CREATE TABLE PREFIX_JOB_INSTANCE (
JOB_INSTANCE_ID BIGINT IDENTITY NOT NULL PRIMARY KEY ,
JOB_INSTANCE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
VERSION BIGINT ,
JOB_NAME VARCHAR(100) NOT NULL,
JOB_KEY VARCHAR(32) NOT NULL,
@ -7,7 +7,7 @@ CREATE TABLE PREFIX_JOB_INSTANCE ( @@ -7,7 +7,7 @@ CREATE TABLE PREFIX_JOB_INSTANCE (
) ;
CREATE TABLE PREFIX_JOB_EXECUTION (
JOB_EXECUTION_ID BIGINT IDENTITY NOT NULL PRIMARY KEY ,
JOB_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
VERSION BIGINT ,
JOB_INSTANCE_ID BIGINT NOT NULL,
CREATE_TIME TIMESTAMP NOT NULL,
@ -36,7 +36,7 @@ CREATE TABLE PREFIX_JOB_EXECUTION_PARAMS ( @@ -36,7 +36,7 @@ CREATE TABLE PREFIX_JOB_EXECUTION_PARAMS (
) ;
CREATE TABLE PREFIX_STEP_EXECUTION (
STEP_EXECUTION_ID BIGINT IDENTITY NOT NULL PRIMARY KEY ,
STEP_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,
VERSION BIGINT NOT NULL,
STEP_NAME VARCHAR(100) NOT NULL,
JOB_EXECUTION_ID BIGINT NOT NULL,
@ -75,11 +75,11 @@ CREATE TABLE PREFIX_JOB_EXECUTION_CONTEXT ( @@ -75,11 +75,11 @@ CREATE TABLE PREFIX_JOB_EXECUTION_CONTEXT (
) ;
CREATE TABLE PREFIX_STEP_EXECUTION_SEQ (
ID BIGINT IDENTITY
ID BIGINT GENERATED BY DEFAULT AS IDENTITY
);
CREATE TABLE PREFIX_JOB_EXECUTION_SEQ (
ID BIGINT IDENTITY
ID BIGINT GENERATED BY DEFAULT AS IDENTITY
);
CREATE TABLE PREFIX_JOB_SEQ (
ID BIGINT IDENTITY
ID BIGINT GENERATED BY DEFAULT AS IDENTITY
);

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/data-city-schema.sql

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
CREATE TABLE CITY (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30),
state VARCHAR(30),
country VARCHAR(30),

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/another.sql

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
CREATE TABLE SPAM (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30)
);

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/lexical-schema-aaa.sql

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
CREATE TABLE FOO (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
todrop VARCHAR(30)
);

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/schema.sql

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
CREATE TABLE FOO (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30)
);

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/schema.sql

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
CREATE TABLE BAR (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30)
);

2
spring-boot-project/spring-boot-cli/src/test/resources/schema-all.sql

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
CREATE TABLE FOO (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30)
);

2
spring-boot-project/spring-boot/src/test/resources/schema.sql

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
CREATE TABLE EXAMPLE (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30)
);

2
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/src/main/resources/schema.sql

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
CREATE TABLE CUSTOMER (
ID INTEGER IDENTITY PRIMARY KEY,
ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
FIRST_NAME VARCHAR(30),
DATE_OF_BIRTH DATE
);

2
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc/src/main/resources/schema.sql

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
CREATE TABLE CITY (
id INTEGER IDENTITY PRIMARY KEY,
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(30),
state VARCHAR(30),
country VARCHAR(30)

Loading…
Cancel
Save