-- --------------------------------------------------------
-- Complete Bangladesh Districts Data
-- All 64 Districts for 8 Divisions
-- --------------------------------------------------------

-- Ensure Bangladesh and Divisions exist
INSERT INTO `countries` (`id`, `name`, `code`, `is_active`) VALUES
(1, 'Bangladesh', 'BD', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

INSERT INTO `divisions` (`id`, `country_id`, `name`, `code`, `is_active`) VALUES
(1, 1, 'Dhaka', 'DHK', 1),
(2, 1, 'Chittagong', 'CTG', 1),
(3, 1, 'Rajshahi', 'RAJ', 1),
(4, 1, 'Khulna', 'KHL', 1),
(5, 1, 'Barisal', 'BAR', 1),
(6, 1, 'Sylhet', 'SYL', 1),
(7, 1, 'Rangpur', 'RAN', 1),
(8, 1, 'Mymensingh', 'MYM', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- ============================================================
-- ALL DISTRICTS FOR ALL DIVISIONS (64 Districts)
-- ============================================================

-- Dhaka Division (13 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(1, 'Dhaka', 'DHK', 1),
(1, 'Gazipur', 'GZP', 1),
(1, 'Kishoreganj', 'KSG', 1),
(1, 'Manikganj', 'MKG', 1),
(1, 'Munshiganj', 'MSG', 1),
(1, 'Narayanganj', 'NRG', 1),
(1, 'Narsingdi', 'NSD', 1),
(1, 'Tangail', 'TGL', 1),
(1, 'Faridpur', 'FRP', 1),
(1, 'Gopalganj', 'GPG', 1),
(1, 'Madaripur', 'MDP', 1),
(1, 'Rajbari', 'RJB', 1),
(1, 'Shariatpur', 'SRP', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Chittagong Division (11 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(2, 'Chittagong', 'CTG', 1),
(2, 'Cox\'s Bazar', 'CXB', 1),
(2, 'Bandarban', 'BDB', 1),
(2, 'Rangamati', 'RGM', 1),
(2, 'Khagrachhari', 'KGC', 1),
(2, 'Feni', 'FNI', 1),
(2, 'Lakshmipur', 'LKP', 1),
(2, 'Noakhali', 'NKL', 1),
(2, 'Chandpur', 'CDP', 1),
(2, 'Comilla', 'CML', 1),
(2, 'Brahmanbaria', 'BRB', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Rajshahi Division (8 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(3, 'Rajshahi', 'RAJ', 1),
(3, 'Bogra', 'BGR', 1),
(3, 'Joypurhat', 'JPH', 1),
(3, 'Naogaon', 'NGN', 1),
(3, 'Natore', 'NTR', 1),
(3, 'Chapai Nawabganj', 'CNG', 1),
(3, 'Pabna', 'PBN', 1),
(3, 'Sirajganj', 'SRG', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Khulna Division (10 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(4, 'Khulna', 'KHL', 1),
(4, 'Bagerhat', 'BGH', 1),
(4, 'Chuadanga', 'CHD', 1),
(4, 'Jashore', 'JSR', 1),
(4, 'Jhenaidah', 'JND', 1),
(4, 'Kushtia', 'KST', 1),
(4, 'Magura', 'MGR', 1),
(4, 'Meherpur', 'MHP', 1),
(4, 'Narail', 'NRL', 1),
(4, 'Satkhira', 'SKR', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Barisal Division (6 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(5, 'Barisal', 'BAR', 1),
(5, 'Barguna', 'BGN', 1),
(5, 'Bhola', 'BHL', 1),
(5, 'Jhalokati', 'JHK', 1),
(5, 'Patuakhali', 'PTK', 1),
(5, 'Pirojpur', 'PRP', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Sylhet Division (4 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(6, 'Sylhet', 'SYL', 1),
(6, 'Habiganj', 'HBG', 1),
(6, 'Moulvibazar', 'MLV', 1),
(6, 'Sunamganj', 'SNG', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Rangpur Division (8 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(7, 'Rangpur', 'RAN', 1),
(7, 'Dinajpur', 'DNP', 1),
(7, 'Gaibandha', 'GBD', 1),
(7, 'Kurigram', 'KRM', 1),
(7, 'Lalmonirhat', 'LMH', 1),
(7, 'Nilphamari', 'NPM', 1),
(7, 'Panchagarh', 'PCG', 1),
(7, 'Thakurgaon', 'TKG', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Mymensingh Division (4 districts)
INSERT INTO `districts` (`division_id`, `name`, `code`, `is_active`) VALUES
(8, 'Mymensingh', 'MYM', 1),
(8, 'Jamalpur', 'JMP', 1),
(8, 'Netrokona', 'NTK', 1),
(8, 'Sherpur', 'SHP', 1)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `code` = VALUES(`code`);

-- Total: 13 + 11 + 8 + 10 + 6 + 4 + 8 + 4 = 64 Districts

