diff --git a/CHANGELOG.md b/CHANGELOG.md index 007485b..223dfb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ verbatim as the body of the matching GitHub release. | Version | Date | Notes | |---|---|---| +| v0.2.6 | 2026-11-23 | [changelog/v0.2.6.md](changelog/v0.2.6.md) | | v0.2.5 | 2026-11-23 | [changelog/v0.2.5.md](changelog/v0.2.5.md) | | v0.2.4 | 2026-11-23 | [changelog/v0.2.4.md](changelog/v0.2.4.md) | | v0.2.3 | 2026-11-20 | [changelog/v0.2.3.md](changelog/v0.2.3.md) | diff --git a/changelog/v0.2.6.md b/changelog/v0.2.6.md new file mode 100644 index 0000000..1b6a028 --- /dev/null +++ b/changelog/v0.2.6.md @@ -0,0 +1,22 @@ +# v0.2.6 + +Fixes the v0.2.5 migration, which crash-looped a Postgres deployment. + +## Fixed + +- **V21 no longer crash-loops the gateway on Postgres 16.** v0.2.5 found the provider type + constraint by listing every `CHECK` constraint on `providers` and dropping it. Postgres + 16 also reports `NOT NULL` as a `CHECK` constraint in + `information_schema.table_constraints`, with a synthesized name such as + `2200_16395_1_not_null` that cannot be dropped: the migration failed, Flyway rolled it + back, and the container restarted into the same failure. V21 now joins + `information_schema.check_constraints` and drops only the constraint whose clause + mentions `OPENAI`, so the type check is the only candidate. On Postgres the synthetic + `NOT NULL` rows do not appear in `check_constraints` at all, so the join excludes them + even before the clause filter. +- No schema change beyond v0.2.5's intended one: the `providers` type check still ends up + listing `OPENAI`, `ANTHROPIC`, `GEMINI` and `VERTEX`. + +If a deployment was left crash-looping by v0.2.5, deploying v0.2.6 is enough: the failed +migration was rolled back, so Flyway runs the corrected V21 on the next boot. No manual +database step. diff --git a/deploy/dokploy/README.md b/deploy/dokploy/README.md index 53d041b..b8d4003 100644 --- a/deploy/dokploy/README.md +++ b/deploy/dokploy/README.md @@ -20,7 +20,7 @@ database. The console is always a plain Application. 3. Compose path: `deploy/dokploy/compose.yml`. 4. **Trigger Type: On Tag**, with auto-deploy enabled. The gateway is a production service; a pull request or a push to `Develop` must not restart it. A release tag - (`v0.2.5`) is the only thing that deploys — see "When it deploys" below. + (`v0.2.6`) is the only thing that deploys — see "When it deploys" below. 5. **Environment** (the compose file references all of these): ```bash diff --git a/docs/SPRING-AI.md b/docs/SPRING-AI.md index cc0f14e..78f6698 100644 --- a/docs/SPRING-AI.md +++ b/docs/SPRING-AI.md @@ -13,7 +13,7 @@ on Spring AI; the gateway never depends on it. io.github.an1ndra path-spring-ai - 0.2.5 + 0.2.6 ``` diff --git a/path-gateway/pom.xml b/path-gateway/pom.xml index 55d924f..2638280 100644 --- a/path-gateway/pom.xml +++ b/path-gateway/pom.xml @@ -7,7 +7,7 @@ io.github.an1ndra path-parent - 0.2.5 + 0.2.6 ../pom.xml diff --git a/path-gateway/src/main/java/db/migration/V21__Provider_types.java b/path-gateway/src/main/java/db/migration/V21__Provider_types.java index 3147eeb..66dc827 100644 --- a/path-gateway/src/main/java/db/migration/V21__Provider_types.java +++ b/path-gateway/src/main/java/db/migration/V21__Provider_types.java @@ -40,8 +40,19 @@ public void migrate(Context context) throws Exception { private List checkConstraints(Connection connection) throws Exception { List names = new ArrayList<>(); - String sql = "select constraint_name from information_schema.table_constraints " - + "where lower(table_name) = '" + TABLE + "' and constraint_type = 'CHECK'"; + // Filter on the clause, not just the constraint type. Postgres 16 reports NOT NULL + // as a CHECK constraint in information_schema.table_constraints with a synthetic + // name that cannot be dropped (ERROR: constraint "..._not_null" does not exist), + // which failed this migration and crash-looped the gateway. Only the type check + // mentions OPENAI. + String sql = "select tc.constraint_name " + + "from information_schema.table_constraints tc " + + "join information_schema.check_constraints cc " + + " on cc.constraint_name = tc.constraint_name " + + " and cc.constraint_schema = tc.constraint_schema " + + "where lower(tc.table_name) = '" + TABLE + "' " + + " and tc.constraint_type = 'CHECK' " + + " and cc.check_clause like '%OPENAI%'"; try (Statement statement = connection.createStatement(); ResultSet rows = statement.executeQuery(sql)) { while (rows.next()) { diff --git a/path-spring-ai/pom.xml b/path-spring-ai/pom.xml index 2364f99..389a84c 100644 --- a/path-spring-ai/pom.xml +++ b/path-spring-ai/pom.xml @@ -7,7 +7,7 @@ io.github.an1ndra path-parent - 0.2.5 + 0.2.6 ../pom.xml diff --git a/pom.xml b/pom.xml index 4577072..3b9ece2 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ io.github.an1ndra path-parent - 0.2.5 + 0.2.6 pom path-parent Build parent for Path, the provider-agnostic LLM gateway, and its Spring AI adapter