Created
November 18, 2015 01:15
-
-
Save cjsewell/319491b2976c5ad27103 to your computer and use it in GitHub Desktop.
Replace locales of dataobjects in Silverstripe. Handy if you want to duplicate a site in a new language, but want to keep the old content as a starting point
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
// Returns list of tables which has a Locale column | |
SELECT DISTINCT TABLE_NAME | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMN_NAME IN ('Locale') | |
AND TABLE_SCHEMA='SS_mydatabase'; | |
// Replace the locale en_NZ with en_US | |
UPDATE `ATableFromAbove` set `Locale` = "en_US" WHERE `Locale` = "en_NZ"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment