burningmantech / ranger-clubhouse-api

Ranger Secret Clubhouse API Service
Apache License 2.0
12 stars 8 forks source link

Convert string columns to utf8mb4 character set #129

Closed mikeburg closed 4 years ago

mikeburg commented 5 years ago

Various string columns in the database cannot handle certain unicode characters (most notably emojis) at present time due to the character set use. When a user enters an emoji, say into the camp location or in the Clubhouse message, mysql will get cranky.

The columns should be set to utf8mb4.

A partial recommended list of columns:

person.{first_name, mi, last_name} person.{address1,address2,apt,city,state} (country is an ISO-normalized 2 character code, not directly settable by the user) person.camp_location person.emergency_contact person_message.{subject,body} contact_log.{subject,message}

mikeburg commented 5 years ago

This pull request https://github.com/burningmantech/ranger-clubhouse-api/pull/215 changes the table collection to utf8mb4 to allows emojis.

Table adjusted are: broadcast_message contact_log help motd person_language person_message person slot

Any new tables created by Laravel migrations will automatically have the table collation set to utf8.

wsanchez commented 4 years ago

Can we close this?

mikeburg commented 4 years ago

Yes. The relevant tables have been fixed, and any new tables created through the Laravel migration will use utf8mb4 for encoding, and utf8mb4_unicode_ci for collation.