From 2cd173ea5ad5b888183e65cc5a26f2588091a1d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 22:01:55 +0000 Subject: [PATCH 1/2] Bump io.github.mfvanek:pg-index-health-bom from 0.20.2 to 0.20.3 Bumps [io.github.mfvanek:pg-index-health-bom](https://github.com/mfvanek/pg-index-health) from 0.20.2 to 0.20.3. - [Release notes](https://github.com/mfvanek/pg-index-health/releases) - [Commits](https://github.com/mfvanek/pg-index-health/compare/v.0.20.2...v.0.20.3) --- updated-dependencies: - dependency-name: io.github.mfvanek:pg-index-health-bom dependency-version: 0.20.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- internal-bom/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal-bom/build.gradle.kts b/internal-bom/build.gradle.kts index 0a28660..20a8e98 100644 --- a/internal-bom/build.gradle.kts +++ b/internal-bom/build.gradle.kts @@ -12,7 +12,7 @@ javaPlatform { dependencies { api(platform("org.junit:junit-bom:5.13.4")) api(platform("org.testcontainers:testcontainers-bom:1.21.3")) - api(platform("io.github.mfvanek:pg-index-health-bom:0.20.2")) + api(platform("io.github.mfvanek:pg-index-health-bom:0.20.3")) api(platform("org.mockito:mockito-bom:5.20.0")) api(platform("org.assertj:assertj-bom:3.27.6")) From d4610d2af468f2a01b3f5568dc8d81215927ace7 Mon Sep 17 00:00:00 2001 From: Ivan Vakhrushev Date: Sun, 12 Oct 2025 12:41:11 +0400 Subject: [PATCH 2/2] Upgrade to pgih 0.30.0 --- .../postgres/example/PostgresClusterDemo.java | 2 +- .../mfvanek/postgres/example/SimpleTest.java | 2 +- .../hikari/HikariDataSourceProviderTest.java | 2 +- internal-bom/build.gradle.kts | 2 +- .../pg/cluster/config/DatabaseConfig.java | 2 +- .../DatabaseStructureStaticAnalysisTest.java | 20 +++++++++++++------ 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/console-app-example/src/main/java/io/github/mfvanek/postgres/example/PostgresClusterDemo.java b/console-app-example/src/main/java/io/github/mfvanek/postgres/example/PostgresClusterDemo.java index 6d4d556..932a1b6 100644 --- a/console-app-example/src/main/java/io/github/mfvanek/postgres/example/PostgresClusterDemo.java +++ b/console-app-example/src/main/java/io/github/mfvanek/postgres/example/PostgresClusterDemo.java @@ -21,7 +21,7 @@ public static void main(String[] args) throws InterruptedException { .withUsername("test_user") .withPassword("test_password") .withDatabaseName("test_db") - .withPostgresVersion("17.4") + .withPostgresVersion("17.6.0") .build()) { final var pgUrl = clusterWrapper.getCommonUrlToPrimary(); log.info("pgUrl = {}", pgUrl); diff --git a/console-app-example/src/test/java/io/github/mfvanek/postgres/example/SimpleTest.java b/console-app-example/src/test/java/io/github/mfvanek/postgres/example/SimpleTest.java index 2613266..5dec7cd 100644 --- a/console-app-example/src/test/java/io/github/mfvanek/postgres/example/SimpleTest.java +++ b/console-app-example/src/test/java/io/github/mfvanek/postgres/example/SimpleTest.java @@ -22,7 +22,7 @@ class SimpleTest { @Test void testSimple() throws SQLException { try (PostgreSQLContainer postgres = new PostgreSQLContainer<>( - DockerImageName.parse("postgres").withTag("17.4")) + DockerImageName.parse("postgres").withTag("17.6")) .withTmpFs(Collections.singletonMap("/var/lib/postgresql/data", "rw")) .withDatabaseName("test_db") .withUsername("test_user") diff --git a/db-commons/src/test/java/io/github/mfvanek/postgres/hikari/HikariDataSourceProviderTest.java b/db-commons/src/test/java/io/github/mfvanek/postgres/hikari/HikariDataSourceProviderTest.java index 151df19..94bc938 100644 --- a/db-commons/src/test/java/io/github/mfvanek/postgres/hikari/HikariDataSourceProviderTest.java +++ b/db-commons/src/test/java/io/github/mfvanek/postgres/hikari/HikariDataSourceProviderTest.java @@ -17,7 +17,7 @@ class HikariDataSourceProviderTest { @Test void getDataSourceShouldSetDriverClassName() { try (PostgreSQLContainer postgres = new PostgreSQLContainer<>( - DockerImageName.parse("postgres").withTag("17.4")) + DockerImageName.parse("postgres").withTag("17.6")) .withTmpFs(Collections.singletonMap("/var/lib/postgresql/data", "rw")) .withDatabaseName("test_db") .withUsername("test_user") diff --git a/internal-bom/build.gradle.kts b/internal-bom/build.gradle.kts index 20a8e98..34a8b97 100644 --- a/internal-bom/build.gradle.kts +++ b/internal-bom/build.gradle.kts @@ -12,7 +12,7 @@ javaPlatform { dependencies { api(platform("org.junit:junit-bom:5.13.4")) api(platform("org.testcontainers:testcontainers-bom:1.21.3")) - api(platform("io.github.mfvanek:pg-index-health-bom:0.20.3")) + api(platform("io.github.mfvanek:pg-index-health-bom:0.30.0")) api(platform("org.mockito:mockito-bom:5.20.0")) api(platform("org.assertj:assertj-bom:3.27.6")) diff --git a/spring-boot-app-example/src/main/java/io/github/mfvanek/pg/cluster/config/DatabaseConfig.java b/spring-boot-app-example/src/main/java/io/github/mfvanek/pg/cluster/config/DatabaseConfig.java index ed3bd00..579dc73 100644 --- a/spring-boot-app-example/src/main/java/io/github/mfvanek/pg/cluster/config/DatabaseConfig.java +++ b/spring-boot-app-example/src/main/java/io/github/mfvanek/pg/cluster/config/DatabaseConfig.java @@ -24,7 +24,7 @@ public PostgreSqlClusterWrapper clusterWrapper() { .withUsername("test_user") .withPassword("test_password") .withDatabaseName("test_database") - .withPostgresVersion("17.4") + .withPostgresVersion("17.6.0") .build(); } diff --git a/spring-boot-app-example/src/test/java/io/github/mfvanek/pg/cluster/DatabaseStructureStaticAnalysisTest.java b/spring-boot-app-example/src/test/java/io/github/mfvanek/pg/cluster/DatabaseStructureStaticAnalysisTest.java index 5e0cf46..85b6ee9 100644 --- a/spring-boot-app-example/src/test/java/io/github/mfvanek/pg/cluster/DatabaseStructureStaticAnalysisTest.java +++ b/spring-boot-app-example/src/test/java/io/github/mfvanek/pg/cluster/DatabaseStructureStaticAnalysisTest.java @@ -2,6 +2,8 @@ import io.github.mfvanek.pg.core.checks.common.DatabaseCheckOnHost; import io.github.mfvanek.pg.core.checks.common.Diagnostic; +import io.github.mfvanek.pg.model.column.Column; +import io.github.mfvanek.pg.model.column.ColumnWithType; import io.github.mfvanek.pg.model.dbobject.DbObject; import io.github.mfvanek.pg.model.table.Table; import io.github.mfvanek.pg.testing.PostgreSqlClusterWrapper; @@ -47,7 +49,7 @@ class DatabaseStructureStaticAnalysisTest { void checkPostgresVersion() { final String pgVersion = jdbcTemplate.queryForObject("select version();", String.class); assertThat(pgVersion) - .startsWith("PostgreSQL 17.4"); + .startsWith("PostgreSQL 17.6"); } @Test @@ -59,14 +61,20 @@ void databaseStructureCheckForPublicSchema() { .filter(DatabaseCheckOnHost::isStatic) .forEach(check -> { final ListAssert checkAssert = assertThat(check.check()) - .as(check.getDiagnostic().name()); + .as(check.getName()); - switch (check.getDiagnostic()) { - case COLUMNS_WITH_FIXED_LENGTH_VARCHAR -> checkAssert.hasSize(2); - case COLUMNS_WITHOUT_DESCRIPTION -> checkAssert.hasSize(4); - case TABLES_NOT_LINKED_TO_OTHERS -> checkAssert.hasSize(1) + switch (check.getName()) { + case "COLUMNS_WITH_FIXED_LENGTH_VARCHAR" -> checkAssert.hasSize(2); + case "COLUMNS_WITHOUT_DESCRIPTION" -> checkAssert.hasSize(4); + case "TABLES_NOT_LINKED_TO_OTHERS", "TABLES_WHERE_PRIMARY_KEY_COLUMNS_NOT_FIRST" -> checkAssert.hasSize(1) .asInstanceOf(list(Table.class)) .containsExactly(Table.of("employees")); + case "COLUMNS_WITH_TIMESTAMP_OR_TIMETZ_TYPE" -> checkAssert.hasSize(2) + .asInstanceOf(list(ColumnWithType.class)) + .containsExactly( + ColumnWithType.ofTimestamp(Column.ofNotNull("employees", "created_at")), + ColumnWithType.ofTimestamp(Column.ofNullable("employees", "updated_at")) + ); default -> checkAssert.isEmpty(); } });