opensrp/playbooks

Use UTF-8 character set and collation when creating OpenMRS database

githengi opened this issue · 1 comments

Use UTF-8 character set and collation when creating OpenMRS database.

The maria db databases was installed with wrong collation and thus it was not possible to import names on Thai character set set.

When database are created using RDS also the character set need to be UTF-8.

Run the below queries to update the collation for the database
ALTER DATABASE openmrs COLLATE = 'utf8_general_ci';

Run the below queries to generate the commands to update the collation for all the tables
SELECT CONCAT('ALTER TABLE ', TABLE_NAME,' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') FROM INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='openmrs';

I think this can be achieved by specifying the collation in this task. The default collation can be set to utf8_general_ci;