-- Migration: create notifications table (corrected: `read_by` nullable)
CREATE TABLE IF NOT EXISTS `notifications` (
  `id` BIGINT PRIMARY KEY AUTO_INCREMENT,
  `user_id` INT DEFAULT NULL,
  `event` VARCHAR(100) NOT NULL,
  `sub_feed` VARCHAR(100) DEFAULT NULL,
  `data` TEXT DEFAULT NULL,
  `target_url` VARCHAR(1024) DEFAULT NULL,
  `read_by` TEXT DEFAULT NULL,
  `time_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  INDEX (`user_id`),
  INDEX (`sub_feed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
