Skip to content

Instantly share code, notes, and snippets.

@kehh
Last active December 15, 2015 09:59
Show Gist options
  • Save kehh/5242853 to your computer and use it in GitHub Desktop.
Save kehh/5242853 to your computer and use it in GitHub Desktop.
ICA AtoM create en_AU locale see results in https://gist.github.com/kehh/5242861
select concat ("update `", table_name, "` set ", column_name, " = 'en_AU' where ", column_name, " = 'en';") as 'BEGIN;' from information_schema.columns where column_name = 'source_culture' and table_name not in ('taxonomy', 'term', 'setting', 'loan');
select 'SHOW WARNINGS;';
select concat("delete from `", table_name, "` where culture = 'en_AU'; replace into `", table_name,"` (", group_concat(column_name), ", culture) select ", group_concat(column_name), ", 'en_AU' as culture from `", table_name, "` where culture = 'en';") as 'begin;' from information_schema.columns where table_schema='qubit' and table_name like '%i18n' and column_name != 'culture' group by table_name order by table_name, column_name;
select 'SHOW WARNINGS;';
select 'COMMIT;';
@kehh
Copy link
Author

kehh commented Mar 26, 2013

you can load this by running something like
mysql -umysql_user -pmysqlpass qubit_db < add_en_AU_make_query.sql |mysql -umysql_user -pmysqlpass qubit_db
but entering the correcct value for mysql_user, mysqlpass, qubit_db (or setting those in your my.cnf file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment