-- Basit ve Çalışan Kurulum
-- Copy-paste çalıştırın

CREATE TABLE IF NOT EXISTS `announcement_announcement_groups` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `announcement_id` INT NOT NULL,
    `group_id` INT NOT NULL,
    `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY `unique_announcement_group` (`announcement_id`, `group_id`)
) ENGINE=InnoDB;

CREATE TABLE IF NOT EXISTS `announcement_reads` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `announcement_id` INT NOT NULL,
    `client_uuid` VARCHAR(36) NOT NULL,
    `read_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_client_uuid` (`client_uuid`),
    INDEX `idx_announcement_id` (`announcement_id`),
    UNIQUE KEY `unique_announcement_client` (`announcement_id`, `client_uuid`)
) ENGINE=InnoDB;

SELECT '✅ Kurulum tamamlandı!' AS mesaj;
