From 55d30d362116c1bb94a196145a7410d129cc0625 Mon Sep 17 00:00:00 2001 From: Scott Laird Date: Sat, 12 Apr 2025 16:41:01 +0000 Subject: [PATCH] PL/pgSQL should use `ELSIF`, not `ELSEIF` See https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS, although it's possible both work with Postgres, not all PG-compatible DBs allow `ELSEIF`. This specifically fails with CockroachDB. --- db/postgres/0001-comentario-v3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/postgres/0001-comentario-v3.sql b/db/postgres/0001-comentario-v3.sql index fbfe5776..42568936 100644 --- a/db/postgres/0001-comentario-v3.sql +++ b/db/postgres/0001-comentario-v3.sql @@ -31,7 +31,7 @@ begin migCount; -- Commento++ had 3 more migrations, which is OK too (they didn't add anything significant to impact the conversion) - elseif migCount > 30 and migCount != 33 then + elsif migCount > 30 and migCount != 33 then raise exception E'\n\nToo many database migrations installed: found %, expected 30 or 33.\n\n', migCount; -- GitLab