chore(*.psql): update functions; add update_artist_key.psql for merging artists flow

This commit is contained in:
Cory Dransfeldt 2025-04-18 19:51:33 -07:00
parent 15982f220a
commit 678384d8d9
No known key found for this signature in database
8 changed files with 48 additions and 19 deletions

View file

@ -1,4 +1,13 @@
SELECT lower(regexp_replace(
unaccent(regexp_replace($1, '[^\\w\\s-]', '', 'g')),
'\\s+', '-', 'g'
));
CREATE OR REPLACE FUNCTION slugify(input TEXT)
RETURNS TEXT AS $$
BEGIN
RETURN lower(
regexp_replace(
unaccent(
regexp_replace(input, '[^\w\s-]', '', 'g')
),
'\s+', '-', 'g'
)
);
END;
$$ LANGUAGE plpgsql IMMUTABLE;