0001-migrations-create-immutable_unaccent-in-public-schem.patch
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 |
- |