Add utf8 to utfmb8 conversion api command
authoreileen <emcnaughton@wikimedia.org>
Wed, 27 Nov 2019 03:44:55 +0000 (16:44 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 10 Dec 2019 09:52:28 +0000 (22:52 +1300)
commita0a5d4da429476b4ec1541a8212067f0427fff81
treeb9b077b80cecde43324f9b76a056c5517c9008b2
parentb8e91433c6ea3f0c07fe726707e28eba2418eb0c
Add utf8 to utfmb8 conversion api command

This extracts from https://github.com/civicrm/civicrm-core/pull/13633 the portion that deals with the conversion
and switches it from an upgrade script (which is not agreed at this stage as there are concerns about
imposing this change) to an api command (which can be added with relatively little discussion as
it only affects those who choose to use it).

We don't expect this command to outlive apiv3 so adding there & not creating insta-tech-debt on
apiv4.

In order to add a unit test I had to alter to support reverting - doesn't seem like a bad thing all round.

As an aside - I like the way it changes the DB level charset & collation. I think I've seen these fail to be set
in the wild
CRM/Core/BAO/SchemaHandler.php
api/v3/System.php
tests/phpunit/api/v3/SystemTest.php