From abd03d1ac010500b42ecaa8c3d2871aefe2bd75d Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 11 May 2026 15:27:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(docs)=20run=20migration=200027=20w?= =?UTF-8?q?ithout=20superuser=20role?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The migration 00227 must be run with a postgres superuser, most af managed postgresql database can not be run using this kind of user. Ti fix this, we use postgresql unnacent function instead of accessing C function. --- CHANGELOG.md | 4 ++++ src/backend/core/migrations/0027_auto_20251120_0956.py | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb0ef777..86cf1aba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ and this project adheres to - ✨(backend) support creating subdoc from file #1987 +### Fixed + +- 🐛(docs) run migration 0027 without superuser role + ## [v5.1.0] - 2026-05-11 diff --git a/src/backend/core/migrations/0027_auto_20251120_0956.py b/src/backend/core/migrations/0027_auto_20251120_0956.py index fe795ff5f..615a66ce2 100644 --- a/src/backend/core/migrations/0027_auto_20251120_0956.py +++ b/src/backend/core/migrations/0027_auto_20251120_0956.py @@ -11,15 +11,10 @@ class Migration(migrations.Migration): operations = [ migrations.RunSQL( sql=""" - CREATE OR REPLACE FUNCTION public.immutable_unaccent(regdictionary, text) - RETURNS text - LANGUAGE c IMMUTABLE PARALLEL SAFE STRICT AS - '$libdir/unaccent', 'unaccent_dict'; - CREATE OR REPLACE FUNCTION public.f_unaccent(text) RETURNS text - LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT - RETURN public.immutable_unaccent(regdictionary 'public.unaccent', $1); + LANGUAGE sql IMMUTABLE PARALLEL SAFE strict + return unaccent($1); CREATE INDEX IF NOT EXISTS user_email_unaccent_trgm_idx ON impress_user