chore(*.psql): update functions; add update_artist_key.psql for merging artists flow
This commit is contained in:
parent
15982f220a
commit
678384d8d9
8 changed files with 48 additions and 19 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue