diff --git a/migrations/versions/d84bc592584e_extension_unaccent.py b/migrations/versions/d84bc592584e_extension_unaccent.py index 041da64c..216ee4ee 100644 --- a/migrations/versions/d84bc592584e_extension_unaccent.py +++ b/migrations/versions/d84bc592584e_extension_unaccent.py @@ -25,7 +25,8 @@ def upgrade(): bind = op.get_bind() session = Session(bind=bind) # Ajout extension pour recherches sans accents: - session.execute(sa.text("""CREATE EXTENSION IF NOT EXISTS "unaccent";""")) + # erreur: doit s'executer en superuser + # session.execute(sa.text("""CREATE EXTENSION IF NOT EXISTS "unaccent";""")) # Clé étrangère sur identite session.execute( diff --git a/sco_version.py b/sco_version.py index 8d100883..cb65163a 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.84" +SCOVERSION = "9.4.85" SCONAME = "ScoDoc" diff --git a/tools/debian/postinst b/tools/debian/postinst index a5fcc1b1..dad8205e 100755 --- a/tools/debian/postinst +++ b/tools/debian/postinst @@ -97,13 +97,15 @@ fi init_postgres_user # ------------ BASE DE DONNEES -# gérées avec Flask-Migrate (Alembic/SQLAlchemy) # Si la base SCODOC existe, tente de la mettre à jour # (Ne gère pas les bases DEV et TEST) n=$(su -c "psql -l | grep -c -E '^[[:blank:]]*SCODOC[[:blank:]]*\|'" "$SCODOC_USER") if [ "$n" == 1 ] then echo "Upgrading existing SCODOC database..." + # Ajout extension unaccent (postgres superuser, ajout sur base SCODOC) + (cd /tmp; echo 'CREATE EXTENSION IF NOT EXISTS "unaccent";' | su -c psql postgres) + # Migrations gérées avec Flask-Migrate (Alembic/SQLAlchemy) # utilise les scripts dans migrations/version/ # pour mettre à jour notre base (en tant qu'utilisateur scodoc) export FLASK_ENV="production"