-- Agency-Blackmarket Reputation System Database Table
-- Import this file into your MySQL database to create the required table

CREATE TABLE IF NOT EXISTS `blackmarket_reputation` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `citizenid` VARCHAR(50) NOT NULL UNIQUE,
    `reputation` INT DEFAULT 0,
    `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX `idx_citizenid` (`citizenid`),
    INDEX `idx_reputation` (`reputation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Optional: Insert some test data
-- INSERT INTO `blackmarket_reputation` (`citizenid`, `reputation`) VALUES 
--     ('TEST12345', 50),
--     ('TEST67890', 100);
