Database creation: add unaccent postgresql extension. Tests unitaires OK.

This commit is contained in:
Emmanuel Viennet 2023-06-20 07:51:40 +02:00
parent 027224a7b3
commit d1d83e0327
4 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.4.87" SCOVERSION = "9.4.88"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"

View File

@ -60,6 +60,7 @@ def test_permissions(api_headers):
"role_name": "Ens", "role_name": "Ens",
"start": "abc", "start": "abc",
"uid": 1, "uid": 1,
"validation_id": 1,
"version": "long", "version": "long",
} }
for rule in api_rules: for rule in api_rules:

View File

@ -31,4 +31,4 @@ source "$SCRIPT_DIR"/utils.sh || die "config.sh not found, exiting"
# --- # ---
echo 'Creating postgresql database ' "$db_name" echo 'Creating postgresql database ' "$db_name"
createdb -E UTF-8 -p "$POSTGRES_PORT" -O "$POSTGRES_USER" "$db_name" createdb -E UTF-8 -p "$POSTGRES_PORT" -O "$POSTGRES_USER" "$db_name"
echo 'CREATE EXTENSION IF NOT EXISTS "unaccent";' | psql -p "$POSTGRES_PORT" "$db_name" "$POSTGRES_USER"

View File

@ -104,7 +104,7 @@ if [ "$n" == 1 ]
then then
echo "Upgrading existing SCODOC database..." echo "Upgrading existing SCODOC database..."
# Ajout extension unaccent (postgres superuser, ajout sur base SCODOC) # Ajout extension unaccent (postgres superuser, ajout sur base SCODOC)
(cd /tmp; echo 'CREATE EXTENSION IF NOT EXISTS "unaccent";' | su -c psql postgres) (cd /tmp; echo 'CREATE EXTENSION IF NOT EXISTS "unaccent";' | su -c "psql SCODOC" postgres)
# Migrations gérées avec Flask-Migrate (Alembic/SQLAlchemy) # Migrations gérées avec Flask-Migrate (Alembic/SQLAlchemy)
# utilise les scripts dans migrations/version/ # utilise les scripts dans migrations/version/
# pour mettre à jour notre base (en tant qu'utilisateur scodoc) # pour mettre à jour notre base (en tant qu'utilisateur scodoc)