-- Royal Pass Team Ranking Table
-- Run this SQL to create the teams table

CREATE TABLE IF NOT EXISTS `rp_teams` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `team_uid` INT NOT NULL UNIQUE,
    `team_name` VARCHAR(32) NOT NULL,
    `level` INT DEFAULT 1,
    `members` INT DEFAULT 1,
    `leader_uid` INT DEFAULT 0,
    `leader_name` VARCHAR(32) DEFAULT '',
    `total_points` INT DEFAULT 0,
    `total_kills` INT DEFAULT 0,
    `total_deaths` INT DEFAULT 0,
    `created_at` INT DEFAULT 0,
    `updated_at` INT DEFAULT 0,
    INDEX `idx_total_points` (`total_points` DESC),
    INDEX `idx_level` (`level` DESC),
    INDEX `idx_team_name` (`team_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Optional: Insert sample data for testing
-- INSERT INTO rp_teams (team_uid, team_name, level, members, leader_name, total_points) VALUES
-- (1800, 'KINGS', 110, 1, 'BAIZIMING', 50000),
-- (1801, 'NOOBLARRR', 101, 1, 'timailesi@ ruB Za', 45000),
-- (1802, 'SOLO~', 101, 3, 'timailesi@ Fixed.', 42000);
