CREATE TABLE IF NOT EXISTS `work_orders` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `customer_name` VARCHAR(255) NOT NULL,
  `job_type` VARCHAR(255) NOT NULL,
  `status` VARCHAR(50) NOT NULL,
  `address` VARCHAR(255) NOT NULL,
  `technician` VARCHAR(255) NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Seed data
TRUNCATE TABLE `work_orders`;
INSERT INTO `work_orders` (`customer_name`, `job_type`, `status`, `address`, `technician`) VALUES
('John Doe', 'HVAC Repair', 'In Progress', '123 Main St, Anytown, USA', 'Mike R.'),
('Jane Smith', 'Plumbing', 'In Progress', '456 Oak Ave, Anytown, USA', 'Sarah J.'),
('ACME Corp', 'Network Install', 'Pending Dispatch', '789 Pine Ln, Anytown, USA', NULL),
('Big Biz Inc.', 'Server Maintenance', 'Pending Dispatch', '101 Maple Dr, Anytown, USA', NULL),
('Sam Wilson', 'Generator Check', 'Completed', '212 Birch Rd, Anytown, USA', 'Mike R.');
