-- Revert to default collation (utf8mb4_0900_ai_ci on MySQL 8, utf8mb4_general_ci on older).
-- Adjust the target COLLATE if your server default differs.

ALTER TABLE parts
    MODIFY vendor_serial    VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL,
    MODIFY vendor           VARCHAR(255) CHARACTER SET utf8mb4 NULL,
    MODIFY model            VARCHAR(255) CHARACTER SET utf8mb4 NULL,
    MODIFY firmware_version VARCHAR(255) CHARACTER SET utf8mb4 NULL,
    MODIFY component_type   VARCHAR(128) CHARACTER SET utf8mb4 NULL;

ALTER TABLE machines
    MODIFY vendor_serial    VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL,
    MODIFY vendor           VARCHAR(255) CHARACTER SET utf8mb4 NULL,
    MODIFY model            VARCHAR(255) CHARACTER SET utf8mb4 NULL,
    MODIFY cpu_model        VARCHAR(255) CHARACTER SET utf8mb4 NULL;

ALTER TABLE observations
    MODIFY firmware_version VARCHAR(255) CHARACTER SET utf8mb4 NULL;

ALTER TABLE machine_firmware_states
    MODIFY device_name      VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL,
    MODIFY firmware_version VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL;
