fix(usernames): sync index active collectible aliases
This commit is contained in:
parent
2f995f607a
commit
5156b17c1b
29 changed files with 657 additions and 112 deletions
1
deploy/migrations/0160_peer_username_search.down.sql
Normal file
1
deploy/migrations/0160_peer_username_search.down.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
DROP INDEX IF EXISTS public.peer_usernames_active_search_idx;
|
||||
6
deploy/migrations/0160_peer_username_search.up.sql
Normal file
6
deploy/migrations/0160_peer_username_search.up.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- Active usernames are searched by peer type and a case-normalized prefix.
|
||||
-- text_pattern_ops keeps the lookup indexable even when the database collation
|
||||
-- cannot use a regular btree index for LIKE 'prefix%'.
|
||||
CREATE INDEX peer_usernames_active_search_idx
|
||||
ON public.peer_usernames (peer_type, username_lower text_pattern_ops, peer_id)
|
||||
WHERE active;
|
||||
Loading…
Add table
Add a link
Reference in a new issue