migrations: create immutable_unaccent in public schema (#47339)
This commit is contained in:
parent
37209c4870
commit
d0f26f3cb0
|
@ -69,13 +69,13 @@ class Migration(migrations.Migration):
|
|||
TrigramExtension(),
|
||||
UnaccentExtension(),
|
||||
RunSQLIfExtension(
|
||||
sql=["CREATE OR REPLACE FUNCTION immutable_unaccent(text) RETURNS varchar AS $$ "
|
||||
sql=["CREATE OR REPLACE FUNCTION public.immutable_unaccent(text) RETURNS varchar AS $$ "
|
||||
"SELECT public.unaccent('public.unaccent',$1::text); $$ LANGUAGE 'sql' IMMUTABLE"],
|
||||
reverse_sql=['DROP FUNCTION IF EXISTS immutable_unaccent(text)']
|
||||
reverse_sql=['DROP FUNCTION IF EXISTS public.immutable_unaccent(text)']
|
||||
),
|
||||
RunSQLIfExtension(
|
||||
sql=["CREATE INDEX custom_user_name_gist_idx ON custom_user_user USING gist "
|
||||
"(LOWER(immutable_unaccent(first_name || ' ' || last_name)) public.gist_trgm_ops)"],
|
||||
"(LOWER(public.immutable_unaccent(first_name || ' ' || last_name)) public.gist_trgm_ops)"],
|
||||
reverse_sql=['DROP INDEX IF EXISTS custom_user_name_gist_idx'],
|
||||
),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue