Last active
February 3, 2021 13:44
-
-
Save ColonelMoutarde/0a8e74d3ead9033df6ebf12b9726e5ed to your computer and use it in GitHub Desktop.
slugify SQL
This file contains 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
$this->addSql( | |
"UPDATE matable SET slug = | |
concat( | |
lower( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace(title,'\'','-') | |
, 'ù','u') | |
, 'ç','c') | |
,'û','u') | |
,'ô','o') | |
,'â','a') | |
, 'ï', 'i') | |
, 'î', 'i') | |
, 'ë', 'e') | |
, 'ê', 'e') | |
, 'à', 'a') | |
, 'è', 'e') | |
, ' ', '-') | |
, 'é', 'e') | |
, '.', '') | |
), SUBSTRING(id, 3, 3))" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment