CREATE TABLE `user_preference` (
    `id`         BINARY(16)  NOT NULL,
    `user_id`    BINARY(16)  NOT NULL,
    `key`        VARCHAR(64) NOT NULL,
    `value`      TEXT        NOT NULL,
    `created_at` DATETIME    NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` DATETIME    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `uniq_user_key` (`user_id`, `key`),
    CONSTRAINT `fk_user_preference_user`
        FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
