

-- Team Members Table
CREATE TABLE IF NOT EXISTS `teamMembers` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(255) NOT NULL,
  `role` varchar(255) NOT NULL,
  `department` varchar(255) DEFAULT 'General',
  `bio` text,
  `imageUrl` varchar(500),
  `email` varchar(320),
  `phone` varchar(20),
  `isExecutive` tinyint(1) DEFAULT 0,
  `displayOrder` int DEFAULT 0,
  `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  INDEX `idx_isExecutive` (`isExecutive`),
  INDEX `idx_displayOrder` (`displayOrder`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Insert sample team members
INSERT INTO `teamMembers` (
  `name`,
  `role`,
  `department`,
  `bio`,
  `email`,
  `phone`,
  `isExecutive`,
  `displayOrder`
) VALUES
(
  'John Doe',
  'Chief Executive Officer',
  'Executive',
  'Leading Comarnet with 20+ years of IT industry experience.',
  'john.doe@comarnet.com',
  '+60-1-2158-8805',
  1,
  1
),
(
  'Jane Smith',
  'Chief Technology Officer',
  'Technology',
  'Driving innovation in network infrastructure and cloud solutions.',
  'jane.smith@comarnet.com',
  '+60-1-2158-8806',
  1,
  2
),
(
  'Mike Johnson',
  'Head of Sales',
  'Sales',
  'Building strong partnerships with enterprise clients across APAC.',
  'mike.johnson@comarnet.com',
  '+60-1-2158-8807',
  0,
  3
),
(
  'Sarah Williams',
  'Support Manager',
  'Support',
  'Ensuring 24/7 customer support excellence.',
  'sarah.williams@comarnet.com',
  '+60-1-2158-8808',
  0,
  4
);

-- ============================================================
-- VERIFICATION QUERIES
-- ============================================================

-- Check if tables were created successfully
SELECT 'Users table created' as status FROM information_schema.TABLES 
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'users'
UNION ALL
SELECT 'Team Members table created' as status FROM information_schema.TABLES 
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'teamMembers';
