CREATE TABLE IF NOT EXISTS `agency_reports` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `identifier` varchar(50) NOT NULL,
    `player_name` varchar(50) NOT NULL,
    `title` varchar(50) NOT NULL,
    `category` varchar(50) NOT NULL,
    `description` text NOT NULL,
    `status` varchar(20) NOT NULL DEFAULT 'open',
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `admin_identifier` varchar(50) DEFAULT NULL,
    `admin_name` varchar(50) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `agency_report_messages` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `report_id` int(11) NOT NULL,
    `sender_identifier` varchar(100) NOT NULL,
    `sender_name` varchar(100) NOT NULL,
    `sender_role` varchar(20) NOT NULL,
    `message` text NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    KEY `idx_report_id` (`report_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
