-- Add is_hidden and feedback_text to app_service_records
ALTER TABLE `app_service_records`
ADD COLUMN `is_hidden` TINYINT(1) DEFAULT 0,
ADD COLUMN `feedback_text` TEXT DEFAULT NULL;

-- Create analytics table
CREATE TABLE IF NOT EXISTS `user_app_analytics` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `tester_id` INT NOT NULL,
    `app_id` INT NOT NULL,
    `is_installed` TINYINT(1) DEFAULT 0,
    `last_checked` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    UNIQUE KEY `unique_record` (`tester_id`, `app_id`)
);