-- =============================================================================
-- Seed: comunas (346 comunas de Chile, datos públicos SUBDERE)
-- Sprint: 1.5a
-- provincia_id según 06_provincias.sql, region_id denormalizado.
-- Lista organizada norte → sur, agrupada por provincia.
-- =============================================================================

INSERT IGNORE INTO comunas (id, provincia_id, region_id, nombre, activo) VALUES
-- Arica (prov=1, reg=1)
(1,1,1,'Arica',1),(2,1,1,'Camarones',1),
-- Parinacota (prov=2, reg=1)
(3,2,1,'Putre',1),(4,2,1,'General Lagos',1),
-- Iquique (prov=3, reg=2)
(5,3,2,'Iquique',1),(6,3,2,'Alto Hospicio',1),
-- Tamarugal (prov=4, reg=2)
(7,4,2,'Pozo Almonte',1),(8,4,2,'Camiña',1),(9,4,2,'Colchane',1),(10,4,2,'Huara',1),(11,4,2,'Pica',1),
-- Antofagasta (prov=5, reg=3)
(12,5,3,'Antofagasta',1),(13,5,3,'Mejillones',1),(14,5,3,'Sierra Gorda',1),(15,5,3,'Taltal',1),
-- El Loa (prov=6, reg=3)
(16,6,3,'Calama',1),(17,6,3,'Ollagüe',1),(18,6,3,'San Pedro de Atacama',1),
-- Tocopilla (prov=7, reg=3)
(19,7,3,'Tocopilla',1),(20,7,3,'María Elena',1),
-- Copiapó (prov=8, reg=4)
(21,8,4,'Copiapó',1),(22,8,4,'Caldera',1),(23,8,4,'Tierra Amarilla',1),
-- Chañaral (prov=9, reg=4)
(24,9,4,'Chañaral',1),(25,9,4,'Diego de Almagro',1),
-- Huasco (prov=10, reg=4)
(26,10,4,'Vallenar',1),(27,10,4,'Alto del Carmen',1),(28,10,4,'Freirina',1),(29,10,4,'Huasco',1),
-- Elqui (prov=11, reg=5)
(30,11,5,'La Serena',1),(31,11,5,'Coquimbo',1),(32,11,5,'Andacollo',1),(33,11,5,'La Higuera',1),(34,11,5,'Paiguano',1),(35,11,5,'Vicuña',1),
-- Choapa (prov=12, reg=5)
(36,12,5,'Illapel',1),(37,12,5,'Canela',1),(38,12,5,'Los Vilos',1),(39,12,5,'Salamanca',1),
-- Limarí (prov=13, reg=5)
(40,13,5,'Ovalle',1),(41,13,5,'Combarbalá',1),(42,13,5,'Monte Patria',1),(43,13,5,'Punitaqui',1),(44,13,5,'Río Hurtado',1),
-- Valparaíso (prov=14, reg=6)
(45,14,6,'Valparaíso',1),(46,14,6,'Casablanca',1),(47,14,6,'Concón',1),(48,14,6,'Juan Fernández',1),(49,14,6,'Puchuncaví',1),(50,14,6,'Quintero',1),(51,14,6,'Viña del Mar',1),
-- San Antonio (prov=15, reg=6)
(52,15,6,'San Antonio',1),(53,15,6,'Algarrobo',1),(54,15,6,'Cartagena',1),(55,15,6,'El Quisco',1),(56,15,6,'El Tabo',1),(57,15,6,'Santo Domingo',1),
-- San Felipe de Aconcagua (prov=16, reg=6)
(58,16,6,'San Felipe',1),(59,16,6,'Catemu',1),(60,16,6,'Llaillay',1),(61,16,6,'Panquehue',1),(62,16,6,'Putaendo',1),(63,16,6,'Santa María',1),
-- Los Andes (prov=17, reg=6)
(64,17,6,'Los Andes',1),(65,17,6,'Calle Larga',1),(66,17,6,'Rinconada',1),(67,17,6,'San Esteban',1),
-- Petorca (prov=18, reg=6)
(68,18,6,'La Ligua',1),(69,18,6,'Cabildo',1),(70,18,6,'Papudo',1),(71,18,6,'Petorca',1),(72,18,6,'Zapallar',1),
-- Quillota (prov=19, reg=6)
(73,19,6,'Quillota',1),(74,19,6,'Calera',1),(75,19,6,'Hijuelas',1),(76,19,6,'La Cruz',1),(77,19,6,'Nogales',1),
-- Marga Marga (prov=20, reg=6)
(78,20,6,'Quilpué',1),(79,20,6,'Limache',1),(80,20,6,'Olmué',1),(81,20,6,'Villa Alemana',1),
-- Isla de Pascua (prov=21, reg=6)
(82,21,6,'Isla de Pascua',1),
-- Santiago (prov=22, reg=7) — 32 comunas
(83,22,7,'Santiago',1),(84,22,7,'Cerrillos',1),(85,22,7,'Cerro Navia',1),(86,22,7,'Conchalí',1),(87,22,7,'El Bosque',1),
(88,22,7,'Estación Central',1),(89,22,7,'Huechuraba',1),(90,22,7,'Independencia',1),(91,22,7,'La Cisterna',1),(92,22,7,'La Florida',1),
(93,22,7,'La Granja',1),(94,22,7,'La Pintana',1),(95,22,7,'La Reina',1),(96,22,7,'Las Condes',1),(97,22,7,'Lo Barnechea',1),
(98,22,7,'Lo Espejo',1),(99,22,7,'Lo Prado',1),(100,22,7,'Macul',1),(101,22,7,'Maipú',1),(102,22,7,'Ñuñoa',1),
(103,22,7,'Pedro Aguirre Cerda',1),(104,22,7,'Peñalolén',1),(105,22,7,'Providencia',1),(106,22,7,'Pudahuel',1),(107,22,7,'Quilicura',1),
(108,22,7,'Quinta Normal',1),(109,22,7,'Recoleta',1),(110,22,7,'Renca',1),(111,22,7,'San Joaquín',1),(112,22,7,'San Miguel',1),
(113,22,7,'San Ramón',1),(114,22,7,'Vitacura',1),
-- Cordillera (prov=23, reg=7)
(115,23,7,'Puente Alto',1),(116,23,7,'Pirque',1),(117,23,7,'San José de Maipo',1),
-- Chacabuco (prov=24, reg=7)
(118,24,7,'Colina',1),(119,24,7,'Lampa',1),(120,24,7,'Tiltil',1),
-- Maipo (prov=25, reg=7)
(121,25,7,'San Bernardo',1),(122,25,7,'Buin',1),(123,25,7,'Calera de Tango',1),(124,25,7,'Paine',1),
-- Melipilla (prov=26, reg=7)
(125,26,7,'Melipilla',1),(126,26,7,'Alhué',1),(127,26,7,'Curacaví',1),(128,26,7,'María Pinto',1),(129,26,7,'San Pedro',1),
-- Talagante (prov=27, reg=7)
(130,27,7,'Talagante',1),(131,27,7,'El Monte',1),(132,27,7,'Isla de Maipo',1),(133,27,7,'Padre Hurtado',1),(134,27,7,'Peñaflor',1),
-- Cachapoal (prov=28, reg=8) — O'Higgins
(135,28,8,'Rancagua',1),(136,28,8,'Codegua',1),(137,28,8,'Coínco',1),(138,28,8,'Coltauco',1),(139,28,8,'Doñihue',1),
(140,28,8,'Graneros',1),(141,28,8,'Las Cabras',1),(142,28,8,'Machalí',1),(143,28,8,'Malloa',1),(144,28,8,'Mostazal',1),
(145,28,8,'Olivar',1),(146,28,8,'Peumo',1),(147,28,8,'Pichidegua',1),(148,28,8,'Quinta de Tilcoco',1),(149,28,8,'Rengo',1),
(150,28,8,'Requínoa',1),(151,28,8,'San Vicente',1),
-- Colchagua (prov=29, reg=8)
(152,29,8,'San Fernando',1),(153,29,8,'Chépica',1),(154,29,8,'Chimbarongo',1),(155,29,8,'Lolol',1),(156,29,8,'Nancagua',1),
(157,29,8,'Palmilla',1),(158,29,8,'Peralillo',1),(159,29,8,'Placilla',1),(160,29,8,'Pumanque',1),(161,29,8,'Santa Cruz',1),
-- Cardenal Caro (prov=30, reg=8)
(162,30,8,'Pichilemu',1),(163,30,8,'La Estrella',1),(164,30,8,'Litueche',1),(165,30,8,'Marchihue',1),(166,30,8,'Navidad',1),(167,30,8,'Paredones',1),
-- Talca (prov=31, reg=9) — Maule
(168,31,9,'Talca',1),(169,31,9,'Constitución',1),(170,31,9,'Curepto',1),(171,31,9,'Empedrado',1),(172,31,9,'Maule',1),
(173,31,9,'Pelarco',1),(174,31,9,'Pencahue',1),(175,31,9,'Río Claro',1),(176,31,9,'San Clemente',1),(177,31,9,'San Rafael',1),
-- Curicó (prov=32, reg=9)
(178,32,9,'Curicó',1),(179,32,9,'Hualañé',1),(180,32,9,'Licantén',1),(181,32,9,'Molina',1),(182,32,9,'Rauco',1),
(183,32,9,'Romeral',1),(184,32,9,'Sagrada Familia',1),(185,32,9,'Teno',1),(186,32,9,'Vichuquén',1),
-- Linares (prov=33, reg=9)
(187,33,9,'Linares',1),(188,33,9,'Colbún',1),(189,33,9,'Longaví',1),(190,33,9,'Parral',1),(191,33,9,'Retiro',1),
(192,33,9,'San Javier',1),(193,33,9,'Villa Alegre',1),(194,33,9,'Yerbas Buenas',1),
-- Cauquenes (prov=34, reg=9)
(195,34,9,'Cauquenes',1),(196,34,9,'Chanco',1),(197,34,9,'Pelluhue',1),
-- Diguillín (prov=35, reg=10) — Ñuble
(198,35,10,'Chillán',1),(199,35,10,'Bulnes',1),(200,35,10,'Chillán Viejo',1),(201,35,10,'El Carmen',1),(202,35,10,'Pemuco',1),
(203,35,10,'Pinto',1),(204,35,10,'Quillón',1),(205,35,10,'San Ignacio',1),(206,35,10,'Yungay',1),
-- Itata (prov=36, reg=10)
(207,36,10,'Quirihue',1),(208,36,10,'Cobquecura',1),(209,36,10,'Coelemu',1),(210,36,10,'Ninhue',1),(211,36,10,'Portezuelo',1),
(212,36,10,'Ránquil',1),(213,36,10,'Treguaco',1),
-- Punilla (prov=37, reg=10)
(214,37,10,'San Carlos',1),(215,37,10,'Coihueco',1),(216,37,10,'Ñiquén',1),(217,37,10,'San Fabián',1),(218,37,10,'San Nicolás',1),
-- Concepción (prov=38, reg=11) — Biobío
(219,38,11,'Concepción',1),(220,38,11,'Coronel',1),(221,38,11,'Chiguayante',1),(222,38,11,'Florida',1),(223,38,11,'Hualpén',1),
(224,38,11,'Hualqui',1),(225,38,11,'Lota',1),(226,38,11,'Penco',1),(227,38,11,'San Pedro de la Paz',1),(228,38,11,'Santa Juana',1),
(229,38,11,'Talcahuano',1),(230,38,11,'Tomé',1),
-- Arauco (prov=39, reg=11)
(231,39,11,'Lebu',1),(232,39,11,'Arauco',1),(233,39,11,'Cañete',1),(234,39,11,'Contulmo',1),(235,39,11,'Curanilahue',1),
(236,39,11,'Los Álamos',1),(237,39,11,'Tirúa',1),
-- Biobío (prov=40, reg=11)
(238,40,11,'Los Ángeles',1),(239,40,11,'Antuco',1),(240,40,11,'Cabrero',1),(241,40,11,'Laja',1),(242,40,11,'Mulchén',1),
(243,40,11,'Nacimiento',1),(244,40,11,'Negrete',1),(245,40,11,'Quilaco',1),(246,40,11,'Quilleco',1),(247,40,11,'San Rosendo',1),
(248,40,11,'Santa Bárbara',1),(249,40,11,'Tucapel',1),(250,40,11,'Yumbel',1),(251,40,11,'Alto Biobío',1),
-- Cautín (prov=41, reg=12) — La Araucanía
(252,41,12,'Temuco',1),(253,41,12,'Carahue',1),(254,41,12,'Cunco',1),(255,41,12,'Curarrehue',1),(256,41,12,'Freire',1),
(257,41,12,'Galvarino',1),(258,41,12,'Gorbea',1),(259,41,12,'Lautaro',1),(260,41,12,'Loncoche',1),(261,41,12,'Melipeuco',1),
(262,41,12,'Nueva Imperial',1),(263,41,12,'Padre Las Casas',1),(264,41,12,'Perquenco',1),(265,41,12,'Pitrufquén',1),(266,41,12,'Pucón',1),
(267,41,12,'Saavedra',1),(268,41,12,'Teodoro Schmidt',1),(269,41,12,'Toltén',1),(270,41,12,'Vilcún',1),(271,41,12,'Villarrica',1),
(272,41,12,'Cholchol',1),
-- Malleco (prov=42, reg=12)
(273,42,12,'Angol',1),(274,42,12,'Collipulli',1),(275,42,12,'Curacautín',1),(276,42,12,'Ercilla',1),(277,42,12,'Lonquimay',1),
(278,42,12,'Los Sauces',1),(279,42,12,'Lumaco',1),(280,42,12,'Purén',1),(281,42,12,'Renaico',1),(282,42,12,'Traiguén',1),(283,42,12,'Victoria',1),
-- Valdivia (prov=43, reg=13) — Los Ríos
(284,43,13,'Valdivia',1),(285,43,13,'Corral',1),(286,43,13,'Lanco',1),(287,43,13,'Los Lagos',1),(288,43,13,'Máfil',1),
(289,43,13,'Mariquina',1),(290,43,13,'Paillaco',1),(291,43,13,'Panguipulli',1),
-- Ranco (prov=44, reg=13)
(292,44,13,'La Unión',1),(293,44,13,'Futrono',1),(294,44,13,'Lago Ranco',1),(295,44,13,'Río Bueno',1),
-- Llanquihue (prov=45, reg=14) — Los Lagos
(296,45,14,'Puerto Montt',1),(297,45,14,'Calbuco',1),(298,45,14,'Cochamó',1),(299,45,14,'Fresia',1),(300,45,14,'Frutillar',1),
(301,45,14,'Los Muermos',1),(302,45,14,'Llanquihue',1),(303,45,14,'Maullín',1),(304,45,14,'Puerto Varas',1),
-- Chiloé (prov=46, reg=14)
(305,46,14,'Castro',1),(306,46,14,'Ancud',1),(307,46,14,'Chonchi',1),(308,46,14,'Curaco de Vélez',1),(309,46,14,'Dalcahue',1),
(310,46,14,'Puqueldón',1),(311,46,14,'Queilén',1),(312,46,14,'Quellón',1),(313,46,14,'Quemchi',1),(314,46,14,'Quinchao',1),
-- Osorno (prov=47, reg=14)
(315,47,14,'Osorno',1),(316,47,14,'Puerto Octay',1),(317,47,14,'Purranque',1),(318,47,14,'Puyehue',1),(319,47,14,'Río Negro',1),(320,47,14,'San Juan de la Costa',1),(321,47,14,'San Pablo',1),
-- Palena (prov=48, reg=14)
(322,48,14,'Chaitén',1),(323,48,14,'Futaleufú',1),(324,48,14,'Hualaihué',1),(325,48,14,'Palena',1),
-- Coyhaique (prov=49, reg=15) — Aysén
(326,49,15,'Coyhaique',1),(327,49,15,'Lago Verde',1),
-- Aysén (prov=50, reg=15)
(328,50,15,'Aysén',1),(329,50,15,'Cisnes',1),(330,50,15,'Guaitecas',1),
-- General Carrera (prov=51, reg=15)
(331,51,15,'Chile Chico',1),(332,51,15,'Río Ibáñez',1),
-- Capitán Prat (prov=52, reg=15)
(333,52,15,'Cochrane',1),(334,52,15,'O''Higgins',1),(335,52,15,'Tortel',1),
-- Magallanes (prov=53, reg=16)
(336,53,16,'Punta Arenas',1),(337,53,16,'Laguna Blanca',1),(338,53,16,'Río Verde',1),(339,53,16,'San Gregorio',1),
-- Tierra del Fuego (prov=54, reg=16)
(340,54,16,'Porvenir',1),(341,54,16,'Primavera',1),(342,54,16,'Timaukel',1),
-- Última Esperanza (prov=55, reg=16)
(343,55,16,'Natales',1),(344,55,16,'Torres del Paine',1),
-- Antártica Chilena (prov=56, reg=16)
(345,56,16,'Cabo de Hornos',1),(346,56,16,'Antártica',1);
