fleet/changes
Roberto Dip 305392e7bb
enforce an uniform collation for all tables (#10515)
related to #10441, inspired by the prior work done in
https://github.com/kolide/fleet/pull/1360, this PR:

1. Adds a migration to use `utf8mb4_general_ci` as the default collation
for the database and all the tables. From [MySQL's documentation][1]:

> To change the table default character set and all character columns
    > (CHAR, VARCHAR, TEXT) to a new character set, use a statement like
    > this:
    >
    > ```
    > ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;
    > ```
> The statement also changes the collation of all character columns. If
> you specify no COLLATE clause to indicate which collation to use, the
    > statement uses default collation for the character set.

2. Changes the connection settings to use `utf8mb4_general_ci` as the
default collation, from the [driver docs][2]:

   > Sets the collation used for client-server interaction on
connection. In contrast to charset, collation does not issue additional
queries. If the specified collation is unavailable on the target server,
the connection will fail.

[1]: https://dev.mysql.com/doc/refman/5.7/en/alter-table.html
[2]: https://github.com/go-sql-driver/mysql


**TODO:** discuss how we can enforce this, is setting the database
default collation enough? should we add some kind of custom lint rule to
all migrations?

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2023-03-16 15:49:24 -03:00
..
.keep Issue 1009 calculate diff software (#1305) 2021-07-08 13:57:43 -03:00
8129-fleet-errors-uuid-and-internal Add UUID to Fleet errors and clean up error msgs (#10411) 2023-03-13 13:44:06 -03:00
8186-fix-bug-with-docker-false-positive Updated translation rules so that Docker Desktop can be mapped to the proper CPE (#10326) 2023-03-09 17:46:57 -04:00
8411-jit-provisioning-roles Allow setting user roles during JIT provisioning (#10193) 2023-03-01 20:18:40 -03:00
9106-critical-icon-policy-table Fleet UI: Critical icon on policy table (#10313) 2023-03-06 15:57:15 -05:00
9132-orbit-enroll-set-osquery-db-to-retrieve-uuid Orbit to set --database_path when invoking osquery to retrieve system info (#10308) 2023-03-13 18:54:18 -03:00
9406-disk-encryption-activity-items Disk encryption activity items (#10421) 2023-03-15 13:08:04 -07:00
9414-disk-encryption-banners UI: Disk encryption banners (#10329) 2023-03-13 14:15:55 -07:00
9415-aggregate-mac-settings-indicators UI: Aggregate mac settings indicators (#10303) 2023-03-08 11:43:00 -08:00
9486-pending-jobs-not-clearing-after-outage Run cleanup of cron_stats outside of the schedule package to prevent outages from breaking cron jobs (#10439) 2023-03-13 16:15:30 -03:00
9515-log-instance-id Add instanceID to schedule logging (#10413) 2023-03-13 15:37:03 -03:00
9567-macos_settings-hosts-filter Macos settings hosts filter (#10385) 2023-03-14 10:05:43 -07:00
9753-fix-bug-software-link-tooltip Fleet UI: Fix software table button tooltip to overflow (#10532) 2023-03-16 13:52:02 -04:00
9921-cis-win-10-2.3.10.x CIS - WIN10 - 2.3.10.X policies (#10178) 2023-03-01 10:28:45 -05:00
9924-cis-win-10-2.3.17.x CIS - WIN10 - 2.3.17.X (#10275) 2023-03-02 17:18:02 -05:00
9984-global-and-team-observers-can-view-team Observers can observe team settings (#10447) 2023-03-13 15:34:39 -03:00
10104-policy-tab-click-bug Fleet UI: Use app context currentTeam as source of truth for teamId (#10118) 2023-02-27 11:06:18 -06:00
10137-show-query-policy-results Fleet UI: Show query button added to policy results page (#10164) 2023-02-28 12:55:56 -05:00
10138-cis-win10-9-3-x CIS - WIN10 - 9.3.X policies (#10253) 2023-03-03 13:37:03 -05:00
10147-cis-win-10-18.x.x CIS - WIN10 - 18.X.X policies (#10286) 2023-03-03 12:52:18 -05:00
10228-okta-config-values add config values for MDM Okta integration (#10295) 2023-03-06 14:47:29 -03:00
10271-dep-okta allow to set up a DEP flow gated by Okta auth (#10338) 2023-03-13 10:33:32 -03:00
10299-mdm-no-abm allow to start Fleet MDM without configuring Apple BM (#10453) 2023-03-13 18:16:11 -03:00
10324-upsell-state UI: Add Upsell component including PremiumFeature icon (#10481) 2023-03-14 15:23:20 -07:00
10378-remove-attach-check Remove attach check on queries and return proper bad request error (#10427) 2023-03-13 11:42:26 -03:00
10441-collations enforce an uniform collation for all tables (#10515) 2023-03-16 15:49:24 -03:00
10456-add-more-distros-to-hostlinuxoss Add EndeavourOS, Manjaro, openSUSE Leap and Tumbleweed to HostLinuxOSs (#10456) 2023-03-14 07:50:28 -03:00
bugfix-mdm-settings-documentation Various mdm-related documentation fixes (#10398) 2023-03-09 09:53:40 -06:00
bugfix-trigger-release-lock Release schedule lock when triggered run spans schedule interval (#10240) 2023-03-03 12:14:10 -06:00
fleetd-chrome Fleetd for Chrome (#10281) 2023-03-16 09:01:10 -03:00
issue-9124-orbit-enroll-match-by-serial Support matching a host in orbit enrollment using the serial number (#9612) 2023-02-28 12:55:04 -05:00
issue-9400-add-disk-encryption-fleetctl-apply Add disk_encryption option to config and team YAML (#10185) 2023-02-28 15:34:46 -05:00
issue-9402-9409-implement-UI-for-disk-encryption-on-mdm Feat/disk encryption page (#10288) 2023-03-14 13:03:02 -07:00
issue-9433-support-modify-team-disk-encryption Allow updating enable_disk_encryption via the Modify Team endpoint (#10208) 2023-03-06 09:54:51 -05:00
issue-9435-disk-encryption-activities Add enabled/disabled disk encryption activities and trigger profiles generation (#10319) 2023-03-08 08:31:53 -05:00
issue-9437-add-host-disk-encryption-status Add mdm.macos_settings disk encryption fields to the response of GET /hosts/{id} and device. (#10371) 2023-03-08 15:42:23 -05:00
issue-9591-mdm-profiles-summary Create new API endpoint to provide aggregate status count of MDM profiles applying to hosts (#10194) 2023-03-01 18:36:59 -06:00
issue-9596-mdm-profile-filter Add mdm profiles status filter to hosts endpoints (#10246) 2023-03-03 18:19:46 -06:00
issue-10126-mdm-info Update API responses for hosts and labels endpoints to include host mdm info (#10141) 2023-02-27 18:40:34 -03:00
issue-10136-cis-win-10-9-2-x CIS - WIN10 - 9.2.X policies (#10254) 2023-03-03 13:13:09 -05:00
issue-10409-no-team-filter Update team id query parameter to filter hosts by "no team" assignment (#10444) 2023-03-14 15:41:55 -05:00
issue-10409-support-no-teams-in-aggregated-stats Update aggregated_stats to support "no team" in addition to "all teams" (#10466) 2023-03-14 17:01:16 -04:00
pin-dockerfiles Pin image SHA in Dockerfiles (#10205) 2023-03-01 11:37:00 -08:00