CREATE TABLE IF NOT EXISTS `virtual_servers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `main_server_id` int(11) NOT NULL DEFAULT 1,
  `name` varchar(255) NOT NULL,
  `port` int(11) DEFAULT NULL,
  `sid` int(11) DEFAULT NULL,
  `token` varchar(255) DEFAULT NULL,
  `slots` int(11) NOT NULL DEFAULT 32,
  `status` enum('pending','active','suspended','expired','rejected') NOT NULL DEFAULT 'pending',
  `admin_notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `installed_at` datetime DEFAULT NULL,
  `last_renewed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `main_server_id` (`main_server_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
