mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Fix missing collation in database migration (#18146)
This commit is contained in:
commit
2da35b6a38
3 changed files with 5 additions and 3 deletions
3
.github/pull_request_template.md
vendored
3
.github/pull_request_template.md
vendored
|
|
@ -9,10 +9,11 @@ If some of the following don't apply, delete the relevant line.
|
|||
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements)
|
||||
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.
|
||||
- [ ] Added/updated tests
|
||||
- [ ] If database migrations are included, checked table schema to confirm autoupdate
|
||||
- [ ] If database migrations are included, checked table schema to confirm autoupdate
|
||||
- For database migrations:
|
||||
- [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration.
|
||||
- [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects.
|
||||
- [ ] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`).
|
||||
- [ ] Manual QA for all new/changed functionality
|
||||
- For Orbit and Fleet Desktop changes:
|
||||
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux.
|
||||
|
|
|
|||
1
changes/18142-fix-migration-issue-related-to-collation
Normal file
1
changes/18142-fix-migration-issue-related-to-collation
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Fixed an issue with the `20240327115617_CreateTableNanoDDMRequests` database migration where it could fail if the database did not default to the `utf8mb4_unicode_ci` collation.
|
||||
|
|
@ -14,9 +14,9 @@ func Up_20240327115617(tx *sql.Tx) error {
|
|||
CREATE TABLE mdm_apple_declarative_requests (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
enrollment_id VARCHAR(255) NOT NULL,
|
||||
enrollment_id VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
-- Should be one of "tokens", "declaration-items", "status", or "declaration/…/…" where the ellipses reference a declaration on the server
|
||||
message_type VARCHAR(255) NOT NULL,
|
||||
message_type VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
-- json payload
|
||||
raw_json TEXT,
|
||||
PRIMARY KEY (id),
|
||||
|
|
|
|||
Loading…
Reference in a new issue