chore: bump minimum version of psql from 9.x to 10.x
Closes:
MODIFY
CHANGELOG.adoc
CHANGELOG.adoc
@@ -135,6 +135,8 @@ Particular thanks go to the team at https://www.scheer-pas.com[Scheer PAS^] who
* [manager-jpa]: Remove most uses of JPA Criteria API and replace with https://persistence.blazebit.com/[Blaze-Persistence^]. This is a modern reinterpretation of the Criteria API concept that is usable by mere human beings such as Apiman's maintainer. https://github.com/Blazebit/blaze-persistence/issues/1436[Thanks to Christian Beikov for his assistance^] in fixing a show-stopper bug that Apiman exposed in Hibernate when using Blaze-Persistence. By https://github.com/msavy[Marc Savy (@msavy)^].
+* [distro]: bump minimum version of Postgres from 9.x to 10.x. PGES 9.x does not support the `create or replace procedure` syntax we use, and the 9.x lineage is not supported upstream any more.
+
=== Removed
* [distro]: **Apiman is no longer distributed with the Keycloak Server Overlay**, as this has been discontinued by the Keycloak team. You will need to point Apiman to a Keycloak server that is run separately (see the Docker Compose distro for examples). By https://github.com/msavy[Marc Savy (@msavy)^].

RENAME
distro/data/src/main/resources/ddls/apiman-gateway_postgresql9.ddl
distro/data/src/main/resources/ddls/apiman-gateway_postgresql10.ddl
RENAME
distro/data/src/main/resources/ddls/apiman_postgresql9.ddl
distro/data/src/main/resources/ddls/apiman_postgresql10.ddl
MODIFY
distro/ddl/pom.xml
distro/ddl/pom.xml
<goal>updateSQL</goal>
</goals>
<configuration>
- <migrationSqlOutputFile>${basedir}/target/apiman_postgresql9.ddl</migrationSqlOutputFile>
+ <migrationSqlOutputFile>${basedir}/target/apiman_postgresql10.ddl</migrationSqlOutputFile>
<driver>org.postgresql.Driver</driver>
<url>offline:postgresql?version=9.6.23&amp;caseSensitive=true&amp;changeLogFile=${basedir}/target/changelog/postgresql/databasechangelog.csv</url>
<username>apiman</username>

MODIFY
distro/wildfly/src/main/resources/overlay/standalone/configuration/standalone-apiman.xml
distro/wildfly/src/main/resources/overlay/standalone/configuration/standalone-apiman.xml
</security>
</datasource>
<drivers>
- <driver name="postgresql9" module="org.postgres">
+ <driver name="postgresql10" module="org.postgres">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
<driver name="mysql8" module="com.mysql">

MODIFY
docs/modules/migration/pages/migrations.adoc
docs/modules/migration/pages/migrations.adoc
@@ -8,6 +8,7 @@ Unless stated otherwise, the instructions assume that you are upgrading sequenti
To migrate from Apiman 2.x to 3.0.0.Final, please use Apiman's export-import function.
=== Breaking Changes
+
==== Elasticsearch support removed for Apiman Manager backend storage
[IMPORTANT]
@@ -51,6 +52,11 @@ This also makes scaling Apiman easier out-of-the-box, as the gateway containers
Please refer to the Apiman documentation for further information.
+==== Minimum database versions
+
+For PostgreSQL, 10 is now the minimum required database version.
+All versions from 10 to 14 seem to work well.
+
== Migrating to 2.2.3.Final
No special action should be required, although backing up is always recommended.

MODIFY
gateway/engine/jdbc/src/main/java/io/apiman/gateway/engine/jdbc/JdbcInitializer.java
gateway/engine/jdbc/src/main/java/io/apiman/gateway/engine/jdbc/JdbcInitializer.java
@@ -19,16 +19,13 @@ package io.apiman.gateway.engine.jdbc;
import io.apiman.common.util.ddl.DdlParser;
import io.apiman.gateway.engine.IGatewayInitializer;
-import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.URL;
-import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.apache.commons.dbutils.QueryRunner;
-import org.apache.commons.dbutils.ResultSetHandler;
/**
* Used to (optionally) initialize the Gateway database using a DDL. This
@@ -49,7 +46,7 @@ public class JdbcInitializer extends AbstractJdbcComponent implements IGatewayIn
super(config);
dbType = config.get("datasource.type"); //$NON-NLS-1$
if (dbType == null) {
- throw new IllegalArgumentException("Missing configuration parameter for JDBC Initializer: 'datasource.type', Sample values: h2, mysql5, postgresql9, oracle12"); //$NON-NLS-1$
+ throw new IllegalArgumentException("Missing configuration parameter for JDBC Initializer: 'datasource.type', Sample values: h2, mysql5, postgresql10, oracle12"); //$NON-NLS-1$
}
}

MODIFY
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaDialectMapper.java
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaDialectMapper.java
@@ -30,8 +30,6 @@ import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.Oracle9iDialect;
import org.hibernate.dialect.OracleDialect;
-import org.hibernate.dialect.PostgreSQL81Dialect;
-import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.dialect.PostgreSQL91Dialect;
import org.hibernate.dialect.PostgreSQL92Dialect;
import org.hibernate.dialect.PostgreSQL93Dialect;
@@ -70,17 +68,15 @@ public class JpaDialectMapper {
DB_TYPE_MAP.put(Oracle8iDialect.class.getName(), NamePair.of("oracle19", Oracle8iDialect.class.getName()));
DB_TYPE_MAP.put(Oracle9iDialect.class.getName(), NamePair.of("oracle19", Oracle9iDialect.class.getName()));
- DB_TYPE_MAP.put("postgresql9", NamePair.of("postgresql9", ApimanPostgreSQLDialect.class.getName()));
- DB_TYPE_MAP.put(ApimanPostgreSQLDialect.class.getName(), NamePair.of("postgresql9",ApimanPostgreSQLDialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQLDialect.class.getName(), NamePair.of("postgresql9", PostgreSQLDialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL81Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL81Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL82Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL82Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL9Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL9Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL91Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL91Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL92Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL92Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL93Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL93Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL94Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL94Dialect.class.getName()));
- DB_TYPE_MAP.put(PostgreSQL95Dialect.class.getName(), NamePair.of("postgresql9", PostgreSQL95Dialect.class.getName()));
+ DB_TYPE_MAP.put("postgresql10", NamePair.of("postgresql10", ApimanPostgreSQLDialect.class.getName()));
+ DB_TYPE_MAP.put(ApimanPostgreSQLDialect.class.getName(), NamePair.of("postgresql10",ApimanPostgreSQLDialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQLDialect.class.getName(), NamePair.of("postgresql10", PostgreSQLDialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQL9Dialect.class.getName(), NamePair.of("postgresql10", PostgreSQL9Dialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQL91Dialect.class.getName(), NamePair.of("postgresql10", PostgreSQL91Dialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQL92Dialect.class.getName(), NamePair.of("postgresql10", PostgreSQL92Dialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQL93Dialect.class.getName(), NamePair.of("postgresql10", PostgreSQL93Dialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQL94Dialect.class.getName(), NamePair.of("postgresql10", PostgreSQL94Dialect.class.getName()));
+ DB_TYPE_MAP.put(PostgreSQL95Dialect.class.getName(), NamePair.of("postgresql10", PostgreSQL95Dialect.class.getName()));
DB_TYPE_MAP.put("mssql15", NamePair.of(SQLServerDialect.class.getName(), "mssql15"));
DB_TYPE_MAP.put(SQLServerDialect.class.getName(), NamePair.of("mssql15", SQLServerDialect.class.getName()));

chore: bump minimum version of psql from 9.x to 10.x

Closes: #2301