Projet

Général

Profil

0001-migrations-create-immutable_unaccent-in-public-schem.patch

Valentin Deniaud, 05 octobre 2020 13:48

Télécharger (1,66 ko)

Voir les différences:

Subject: [PATCH] migrations: create immutable_unaccent in public schema
 (#47339)

 src/authentic2/migrations/0028_trigram_unaccent_index.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/authentic2/migrations/0028_trigram_unaccent_index.py
69 69
        TrigramExtension(),
70 70
        UnaccentExtension(),
71 71
        RunSQLIfExtension(
72
            sql=["CREATE OR REPLACE FUNCTION immutable_unaccent(text) RETURNS varchar AS $$ "
72
            sql=["CREATE OR REPLACE FUNCTION public.immutable_unaccent(text) RETURNS varchar AS $$ "
73 73
                 "SELECT public.unaccent('public.unaccent',$1::text); $$ LANGUAGE 'sql' IMMUTABLE"],
74
            reverse_sql=['DROP FUNCTION IF EXISTS immutable_unaccent(text)']
74
            reverse_sql=['DROP FUNCTION IF EXISTS public.immutable_unaccent(text)']
75 75
        ),
76 76
        RunSQLIfExtension(
77 77
            sql=["CREATE INDEX custom_user_name_gist_idx ON custom_user_user USING gist "
78
            "(LOWER(immutable_unaccent(first_name || ' ' || last_name)) public.gist_trgm_ops)"],
78
            "(LOWER(public.immutable_unaccent(first_name || ' ' || last_name)) public.gist_trgm_ops)"],
79 79
            reverse_sql=['DROP INDEX IF EXISTS custom_user_name_gist_idx'],
80 80
        ),
81 81
    ]
82
-