Created
July 1, 2016 12:03
-
-
Save wouldhide/2f37bf78f3db3821c2114df6009ea45c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# feel free to add new rows for other special characters | |
UPDATE table_to_update SET `slug` = lower(field_to_slugify), | |
slug = replace(slug, '.', ' '), | |
slug = replace(slug, ',', ''), | |
slug = replace(slug, '\'', '-'), | |
slug = replace(slug, '/', '-'), | |
slug = replace(slug,'á','a'), | |
slug = replace(slug,'é','e'), | |
slug = replace(slug,'í','i'), | |
slug = replace(slug,'ó','o'), | |
slug = replace(slug,'ö','o'), | |
slug = replace(slug,'ő','o'), | |
slug = replace(slug,'ú','u'), | |
slug = replace(slug,'ü','u'), | |
slug = replace(slug,'ű','u'), | |
slug = trim(slug), | |
slug = replace(slug, ' ', '-'), | |
slug = replace(slug, '--', '-'), | |
slug = replace(slug, '---', '-') | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment