Files
oficial/app/resources/database/seeds/20141101080108_region_seeder.php
2024-12-18 20:33:15 -03:00

109 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use Phinx\Seed\AbstractSeed;
class RegionSeeder extends AbstractSeed
{
public function run(): void
{
$data = [
[
'id' => 1,
'descripcion' => 'Región de Tarapacá',
'numeral' => 'I',
'numeracion' => 1,
],
[
'id' => 2,
'descripcion' => 'Región de Antofagasta',
'numeral' => 'II',
'numeracion' => 2,
],
[
'id' => 3,
'descripcion' => 'Región de Atacama',
'numeral' => 'III',
'numeracion' => 3,
],
[
'id' => 4,
'descripcion' => 'Región de Coquimbo',
'numeral' => 'IV',
'numeracion' => 4,
],
[
'id' => 5,
'descripcion' => 'Región de Valparaíso',
'numeral' => 'V',
'numeracion' => 5,
],
[
'id' => 6,
'descripcion' => 'Región del Libertador Gral. Bernardo OHiggins',
'numeral' => 'VI',
'numeracion' => 6,
],
[
'id' => 7,
'descripcion' => 'Región del Maule',
'numeral' => 'VII',
'numeracion' => 7,
],
[
'id' => 8,
'descripcion' => 'Región del Biobío',
'numeral' => 'VIII',
'numeracion' => 8,
],
[
'id' => 9,
'descripcion' => 'Región de la Araucanía',
'numeral' => 'IX',
'numeracion' => 9,
],
[
'id' => 10,
'descripcion' => 'Región de Los Lagos',
'numeral' => 'X',
'numeracion' => 10,
],
[
'id' => 11,
'descripcion' => 'Región Aisén del Gral. Carlos Ibáñez del Campo',
'numeral' => 'XI',
'numeracion' => 11,
],
[
'id' => 12,
'descripcion' => 'Región de Magallanes y de la Antártica Chilena',
'numeral' => 'XII',
'numeracion' => 12,
],
[
'id' => 13,
'descripcion' => 'Región Metropolitana de Santiago',
'numeral' => 'RM',
'numeracion' => 13,
],
[
'id' => 14,
'descripcion' => 'Región de Los Ríos',
'numeral' => 'XIV',
'numeracion' => 14,
],
[
'id' => 15,
'descripcion' => 'Región de Arica y Parinacota',
'numeral' => 'XV',
'numeracion' => 15,
],
];
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->table('region')
->insert($data)
->saveData();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}