<?php

namespace Ministra\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
class Version1535720096 extends \Doctrine\DBAL\Migrations\AbstractMigration
{
    public function up(\Doctrine\DBAL\Schema\Schema $schema)
    {
        if (!$schema->getTable('languages')->hasColumn('iso_639_3_code')) {
            $this->addSql('ALTER TABLE `languages` ADD COLUMN `iso_639_3_code` char(3) DEFAULT NULL;');
        }
        $this->addSql(<<<EOL
--

UPDATE `languages` SET `iso_639_3_code` = 'aar' WHERE `iso_639_code` = 'aa';
UPDATE `languages` SET `iso_639_3_code` = 'abk' WHERE `iso_639_code` = 'ab';
UPDATE `languages` SET `iso_639_3_code` = 'ave' WHERE `iso_639_code` = 'ae';
UPDATE `languages` SET `iso_639_3_code` = 'afr' WHERE `iso_639_code` = 'af';
UPDATE `languages` SET `iso_639_3_code` = 'aka' WHERE `iso_639_code` = 'ak';
UPDATE `languages` SET `iso_639_3_code` = 'amh' WHERE `iso_639_code` = 'am';
UPDATE `languages` SET `iso_639_3_code` = 'arg' WHERE `iso_639_code` = 'an';
UPDATE `languages` SET `iso_639_3_code` = 'ara' WHERE `iso_639_code` = 'ar';
UPDATE `languages` SET `iso_639_3_code` = 'asm' WHERE `iso_639_code` = 'as';
UPDATE `languages` SET `iso_639_3_code` = 'ava' WHERE `iso_639_code` = 'av';
UPDATE `languages` SET `iso_639_3_code` = 'aym' WHERE `iso_639_code` = 'ay';
UPDATE `languages` SET `iso_639_3_code` = 'aze' WHERE `iso_639_code` = 'az';
UPDATE `languages` SET `iso_639_3_code` = 'bak' WHERE `iso_639_code` = 'ba';
UPDATE `languages` SET `iso_639_3_code` = 'bel' WHERE `iso_639_code` = 'be';
UPDATE `languages` SET `iso_639_3_code` = 'bul' WHERE `iso_639_code` = 'bg';
UPDATE `languages` SET `iso_639_3_code` = 'bih' WHERE `iso_639_code` = 'bh';
UPDATE `languages` SET `iso_639_3_code` = 'bis' WHERE `iso_639_code` = 'bi';
UPDATE `languages` SET `iso_639_3_code` = 'bam' WHERE `iso_639_code` = 'bm';
UPDATE `languages` SET `iso_639_3_code` = 'ben' WHERE `iso_639_code` = 'bn';
UPDATE `languages` SET `iso_639_3_code` = 'bod' WHERE `iso_639_code` = 'bo';
UPDATE `languages` SET `iso_639_3_code` = 'bre' WHERE `iso_639_code` = 'br';
UPDATE `languages` SET `iso_639_3_code` = 'bos' WHERE `iso_639_code` = 'bs';
UPDATE `languages` SET `iso_639_3_code` = 'cat' WHERE `iso_639_code` = 'ca';
UPDATE `languages` SET `iso_639_3_code` = 'che' WHERE `iso_639_code` = 'ce';
UPDATE `languages` SET `iso_639_3_code` = 'cha' WHERE `iso_639_code` = 'ch';
UPDATE `languages` SET `iso_639_3_code` = 'cos' WHERE `iso_639_code` = 'co';
UPDATE `languages` SET `iso_639_3_code` = 'cre' WHERE `iso_639_code` = 'cr';
UPDATE `languages` SET `iso_639_3_code` = 'ces' WHERE `iso_639_code` = 'cs';
UPDATE `languages` SET `iso_639_3_code` = 'chu' WHERE `iso_639_code` = 'cu';
UPDATE `languages` SET `iso_639_3_code` = 'chv' WHERE `iso_639_code` = 'cv';
UPDATE `languages` SET `iso_639_3_code` = 'cym' WHERE `iso_639_code` = 'cy';
UPDATE `languages` SET `iso_639_3_code` = 'dan' WHERE `iso_639_code` = 'da';
UPDATE `languages` SET `iso_639_3_code` = 'deu' WHERE `iso_639_code` = 'de';
UPDATE `languages` SET `iso_639_3_code` = 'div' WHERE `iso_639_code` = 'dv';
UPDATE `languages` SET `iso_639_3_code` = 'dzo' WHERE `iso_639_code` = 'dz';
UPDATE `languages` SET `iso_639_3_code` = 'ewe' WHERE `iso_639_code` = 'ee';
UPDATE `languages` SET `iso_639_3_code` = 'ell' WHERE `iso_639_code` = 'el';
UPDATE `languages` SET `iso_639_3_code` = 'eng' WHERE `iso_639_code` = 'en';
UPDATE `languages` SET `iso_639_3_code` = 'epo' WHERE `iso_639_code` = 'eo';
UPDATE `languages` SET `iso_639_3_code` = 'spa' WHERE `iso_639_code` = 'es';
UPDATE `languages` SET `iso_639_3_code` = 'est' WHERE `iso_639_code` = 'et';
UPDATE `languages` SET `iso_639_3_code` = 'eus' WHERE `iso_639_code` = 'eu';
UPDATE `languages` SET `iso_639_3_code` = 'fas' WHERE `iso_639_code` = 'fa';
UPDATE `languages` SET `iso_639_3_code` = 'ful' WHERE `iso_639_code` = 'ff';
UPDATE `languages` SET `iso_639_3_code` = 'fin' WHERE `iso_639_code` = 'fi';
UPDATE `languages` SET `iso_639_3_code` = 'fij' WHERE `iso_639_code` = 'fj';
UPDATE `languages` SET `iso_639_3_code` = 'fao' WHERE `iso_639_code` = 'fo';
UPDATE `languages` SET `iso_639_3_code` = 'fra' WHERE `iso_639_code` = 'fr';
UPDATE `languages` SET `iso_639_3_code` = 'fry' WHERE `iso_639_code` = 'fy';
UPDATE `languages` SET `iso_639_3_code` = 'gle' WHERE `iso_639_code` = 'ga';
UPDATE `languages` SET `iso_639_3_code` = 'gla' WHERE `iso_639_code` = 'gd';
UPDATE `languages` SET `iso_639_3_code` = 'glg' WHERE `iso_639_code` = 'gl';
UPDATE `languages` SET `iso_639_3_code` = 'grn' WHERE `iso_639_code` = 'gn';
UPDATE `languages` SET `iso_639_3_code` = 'guj' WHERE `iso_639_code` = 'gu';
UPDATE `languages` SET `iso_639_3_code` = 'glv' WHERE `iso_639_code` = 'gv';
UPDATE `languages` SET `iso_639_3_code` = 'hau' WHERE `iso_639_code` = 'ha';
UPDATE `languages` SET `iso_639_3_code` = 'heb', `iso_639_code` = 'he' WHERE `iso_639_code` = 'iw';
UPDATE `languages` SET `iso_639_3_code` = 'hin' WHERE `iso_639_code` = 'hi';
UPDATE `languages` SET `iso_639_3_code` = 'hmo' WHERE `iso_639_code` = 'ho';
UPDATE `languages` SET `iso_639_3_code` = 'hrv' WHERE `iso_639_code` = 'hr';
UPDATE `languages` SET `iso_639_3_code` = 'hat' WHERE `iso_639_code` = 'ht';
UPDATE `languages` SET `iso_639_3_code` = 'hun' WHERE `iso_639_code` = 'hu';
UPDATE `languages` SET `iso_639_3_code` = 'hye' WHERE `iso_639_code` = 'hy';
UPDATE `languages` SET `iso_639_3_code` = 'her' WHERE `iso_639_code` = 'hz';
UPDATE `languages` SET `iso_639_3_code` = 'ina' WHERE `iso_639_code` = 'ia';
UPDATE `languages` SET `iso_639_3_code` = 'ind', `iso_639_code` = 'id' WHERE `iso_639_code` = 'in';
UPDATE `languages` SET `iso_639_3_code` = 'ile' WHERE `iso_639_code` = 'ie';
UPDATE `languages` SET `iso_639_3_code` = 'ibo' WHERE `iso_639_code` = 'ig';
UPDATE `languages` SET `iso_639_3_code` = 'iii' WHERE `iso_639_code` = 'ii';
UPDATE `languages` SET `iso_639_3_code` = 'ipk' WHERE `iso_639_code` = 'ik';
UPDATE `languages` SET `iso_639_3_code` = 'ido' WHERE `iso_639_code` = 'io';
UPDATE `languages` SET `iso_639_3_code` = 'isl' WHERE `iso_639_code` = 'is';
UPDATE `languages` SET `iso_639_3_code` = 'ita' WHERE `iso_639_code` = 'it';
UPDATE `languages` SET `iso_639_3_code` = 'iku' WHERE `iso_639_code` = 'iu';
UPDATE `languages` SET `iso_639_3_code` = 'jpn' WHERE `iso_639_code` = 'ja';
UPDATE `languages` SET `iso_639_3_code` = 'jav', `iso_639_code` = 'jv' WHERE `iso_639_code` = 'jw';
UPDATE `languages` SET `iso_639_3_code` = 'kat' WHERE `iso_639_code` = 'ka';
UPDATE `languages` SET `iso_639_3_code` = 'kon' WHERE `iso_639_code` = 'kg';
UPDATE `languages` SET `iso_639_3_code` = 'kik' WHERE `iso_639_code` = 'ki';
UPDATE `languages` SET `iso_639_3_code` = 'kua' WHERE `iso_639_code` = 'kj';
UPDATE `languages` SET `iso_639_3_code` = 'kaz' WHERE `iso_639_code` = 'kk';
UPDATE `languages` SET `iso_639_3_code` = 'kal' WHERE `iso_639_code` = 'kl';
UPDATE `languages` SET `iso_639_3_code` = 'khm' WHERE `iso_639_code` = 'km';
UPDATE `languages` SET `iso_639_3_code` = 'kan' WHERE `iso_639_code` = 'kn';
UPDATE `languages` SET `iso_639_3_code` = 'kor' WHERE `iso_639_code` = 'ko';
UPDATE `languages` SET `iso_639_3_code` = 'kau' WHERE `iso_639_code` = 'kr';
UPDATE `languages` SET `iso_639_3_code` = 'kas' WHERE `iso_639_code` = 'ks';
UPDATE `languages` SET `iso_639_3_code` = 'kur' WHERE `iso_639_code` = 'ku';
UPDATE `languages` SET `iso_639_3_code` = 'kom' WHERE `iso_639_code` = 'kv';
UPDATE `languages` SET `iso_639_3_code` = 'cor' WHERE `iso_639_code` = 'kw';
UPDATE `languages` SET `iso_639_3_code` = 'kir' WHERE `iso_639_code` = 'ky';
UPDATE `languages` SET `iso_639_3_code` = 'lat' WHERE `iso_639_code` = 'la';
UPDATE `languages` SET `iso_639_3_code` = 'ltz' WHERE `iso_639_code` = 'lb';
UPDATE `languages` SET `iso_639_3_code` = 'lug' WHERE `iso_639_code` = 'lg';
UPDATE `languages` SET `iso_639_3_code` = 'lim' WHERE `iso_639_code` = 'li';
UPDATE `languages` SET `iso_639_3_code` = 'lin' WHERE `iso_639_code` = 'ln';
UPDATE `languages` SET `iso_639_3_code` = 'lao' WHERE `iso_639_code` = 'lo';
UPDATE `languages` SET `iso_639_3_code` = 'lit' WHERE `iso_639_code` = 'lt';
UPDATE `languages` SET `iso_639_3_code` = 'lub' WHERE `iso_639_code` = 'lu';
UPDATE `languages` SET `iso_639_3_code` = 'lav' WHERE `iso_639_code` = 'lv';
UPDATE `languages` SET `iso_639_3_code` = 'mlg' WHERE `iso_639_code` = 'mg';
UPDATE `languages` SET `iso_639_3_code` = 'mah' WHERE `iso_639_code` = 'mh';
UPDATE `languages` SET `iso_639_3_code` = 'mri' WHERE `iso_639_code` = 'mi';
UPDATE `languages` SET `iso_639_3_code` = 'mkd' WHERE `iso_639_code` = 'mk';
UPDATE `languages` SET `iso_639_3_code` = 'mal' WHERE `iso_639_code` = 'ml';
UPDATE `languages` SET `iso_639_3_code` = 'mon' WHERE `iso_639_code` = 'mn';
UPDATE `languages` SET `iso_639_3_code` = 'mar' WHERE `iso_639_code` = 'mr';
UPDATE `languages` SET `iso_639_3_code` = 'msa' WHERE `iso_639_code` = 'ms';
UPDATE `languages` SET `iso_639_3_code` = 'mlt' WHERE `iso_639_code` = 'mt';
UPDATE `languages` SET `iso_639_3_code` = 'mya' WHERE `iso_639_code` = 'my';
UPDATE `languages` SET `iso_639_3_code` = 'nau' WHERE `iso_639_code` = 'na';
UPDATE `languages` SET `iso_639_3_code` = 'nob' WHERE `iso_639_code` = 'nb';
UPDATE `languages` SET `iso_639_3_code` = 'nde' WHERE `iso_639_code` = 'nd';
UPDATE `languages` SET `iso_639_3_code` = 'nep' WHERE `iso_639_code` = 'ne';
UPDATE `languages` SET `iso_639_3_code` = 'ndo' WHERE `iso_639_code` = 'ng';
UPDATE `languages` SET `iso_639_3_code` = 'nld' WHERE `iso_639_code` = 'nl';
UPDATE `languages` SET `iso_639_3_code` = 'nno' WHERE `iso_639_code` = 'nn';
UPDATE `languages` SET `iso_639_3_code` = 'nor' WHERE `iso_639_code` = 'no';
UPDATE `languages` SET `iso_639_3_code` = 'nbl' WHERE `iso_639_code` = 'nr';
UPDATE `languages` SET `iso_639_3_code` = 'nav' WHERE `iso_639_code` = 'nv';
UPDATE `languages` SET `iso_639_3_code` = 'nya' WHERE `iso_639_code` = 'ny';
UPDATE `languages` SET `iso_639_3_code` = 'oci' WHERE `iso_639_code` = 'oc';
UPDATE `languages` SET `iso_639_3_code` = 'oji' WHERE `iso_639_code` = 'oj';
UPDATE `languages` SET `iso_639_3_code` = 'orm' WHERE `iso_639_code` = 'om';
UPDATE `languages` SET `iso_639_3_code` = 'ori' WHERE `iso_639_code` = 'or';
UPDATE `languages` SET `iso_639_3_code` = 'oss' WHERE `iso_639_code` = 'os';
UPDATE `languages` SET `iso_639_3_code` = 'pan' WHERE `iso_639_code` = 'pa';
UPDATE `languages` SET `iso_639_3_code` = 'pli' WHERE `iso_639_code` = 'pi';
UPDATE `languages` SET `iso_639_3_code` = 'pol' WHERE `iso_639_code` = 'pl';
UPDATE `languages` SET `iso_639_3_code` = 'pus' WHERE `iso_639_code` = 'ps';
UPDATE `languages` SET `iso_639_3_code` = 'por' WHERE `iso_639_code` = 'pt';
UPDATE `languages` SET `iso_639_3_code` = 'que' WHERE `iso_639_code` = 'qu';
UPDATE `languages` SET `iso_639_3_code` = 'roh' WHERE `iso_639_code` = 'rm';
UPDATE `languages` SET `iso_639_3_code` = 'run' WHERE `iso_639_code` = 'rn';
UPDATE `languages` SET `iso_639_3_code` = 'ron', `iso_639_code` = 'ro' WHERE `iso_639_code` = 'mo';
UPDATE `languages` SET `iso_639_3_code` = 'rus' WHERE `iso_639_code` = 'ru';
UPDATE `languages` SET `iso_639_3_code` = 'kin' WHERE `iso_639_code` = 'rw';
UPDATE `languages` SET `iso_639_3_code` = 'san' WHERE `iso_639_code` = 'sa';
UPDATE `languages` SET `iso_639_3_code` = 'srd' WHERE `iso_639_code` = 'sc';
UPDATE `languages` SET `iso_639_3_code` = 'snd' WHERE `iso_639_code` = 'sd';
UPDATE `languages` SET `iso_639_3_code` = 'sme' WHERE `iso_639_code` = 'se';
UPDATE `languages` SET `iso_639_3_code` = 'sag' WHERE `iso_639_code` = 'sg';
UPDATE `languages` SET `iso_639_3_code` = 'hbs' WHERE `iso_639_code` = 'sh';
UPDATE `languages` SET `iso_639_3_code` = 'sin' WHERE `iso_639_code` = 'si';
UPDATE `languages` SET `iso_639_3_code` = 'slk' WHERE `iso_639_code` = 'sk';
UPDATE `languages` SET `iso_639_3_code` = 'slv' WHERE `iso_639_code` = 'sl';
UPDATE `languages` SET `iso_639_3_code` = 'smo' WHERE `iso_639_code` = 'sm';
UPDATE `languages` SET `iso_639_3_code` = 'sna' WHERE `iso_639_code` = 'sn';
UPDATE `languages` SET `iso_639_3_code` = 'som' WHERE `iso_639_code` = 'so';
UPDATE `languages` SET `iso_639_3_code` = 'sqi' WHERE `iso_639_code` = 'sq';
UPDATE `languages` SET `iso_639_3_code` = 'srp' WHERE `iso_639_code` = 'sr';
UPDATE `languages` SET `iso_639_3_code` = 'ssw' WHERE `iso_639_code` = 'ss';
UPDATE `languages` SET `iso_639_3_code` = 'sot' WHERE `iso_639_code` = 'st';
UPDATE `languages` SET `iso_639_3_code` = 'sun' WHERE `iso_639_code` = 'su';
UPDATE `languages` SET `iso_639_3_code` = 'swe' WHERE `iso_639_code` = 'sv';
UPDATE `languages` SET `iso_639_3_code` = 'swa' WHERE `iso_639_code` = 'sw';
UPDATE `languages` SET `iso_639_3_code` = 'tam' WHERE `iso_639_code` = 'ta';
UPDATE `languages` SET `iso_639_3_code` = 'tel' WHERE `iso_639_code` = 'te';
UPDATE `languages` SET `iso_639_3_code` = 'tgk' WHERE `iso_639_code` = 'tg';
UPDATE `languages` SET `iso_639_3_code` = 'tha' WHERE `iso_639_code` = 'th';
UPDATE `languages` SET `iso_639_3_code` = 'tir' WHERE `iso_639_code` = 'ti';
UPDATE `languages` SET `iso_639_3_code` = 'tuk' WHERE `iso_639_code` = 'tk';
UPDATE `languages` SET `iso_639_3_code` = 'tgl' WHERE `iso_639_code` = 'tl';
UPDATE `languages` SET `iso_639_3_code` = 'tsn' WHERE `iso_639_code` = 'tn';
UPDATE `languages` SET `iso_639_3_code` = 'ton' WHERE `iso_639_code` = 'to';
UPDATE `languages` SET `iso_639_3_code` = 'tur' WHERE `iso_639_code` = 'tr';
UPDATE `languages` SET `iso_639_3_code` = 'tso' WHERE `iso_639_code` = 'ts';
UPDATE `languages` SET `iso_639_3_code` = 'tat' WHERE `iso_639_code` = 'tt';
UPDATE `languages` SET `iso_639_3_code` = 'twi' WHERE `iso_639_code` = 'tw';
UPDATE `languages` SET `iso_639_3_code` = 'tah' WHERE `iso_639_code` = 'ty';
UPDATE `languages` SET `iso_639_3_code` = 'uig' WHERE `iso_639_code` = 'ug';
UPDATE `languages` SET `iso_639_3_code` = 'ukr' WHERE `iso_639_code` = 'uk';
UPDATE `languages` SET `iso_639_3_code` = 'urd' WHERE `iso_639_code` = 'ur';
UPDATE `languages` SET `iso_639_3_code` = 'uzb' WHERE `iso_639_code` = 'uz';
UPDATE `languages` SET `iso_639_3_code` = 'ven' WHERE `iso_639_code` = 've';
UPDATE `languages` SET `iso_639_3_code` = 'vie' WHERE `iso_639_code` = 'vi';
UPDATE `languages` SET `iso_639_3_code` = 'vol' WHERE `iso_639_code` = 'vo';
UPDATE `languages` SET `iso_639_3_code` = 'wln' WHERE `iso_639_code` = 'wa';
UPDATE `languages` SET `iso_639_3_code` = 'wol' WHERE `iso_639_code` = 'wo';
UPDATE `languages` SET `iso_639_3_code` = 'xho' WHERE `iso_639_code` = 'xh';
UPDATE `languages` SET `iso_639_3_code` = 'yid', `iso_639_code` = 'yi' WHERE `iso_639_code` = 'ji';
UPDATE `languages` SET `iso_639_3_code` = 'yor' WHERE `iso_639_code` = 'yo';
UPDATE `languages` SET `iso_639_3_code` = 'zha' WHERE `iso_639_code` = 'za';
UPDATE `languages` SET `iso_639_3_code` = 'zho' WHERE `iso_639_code` = 'zh';
UPDATE `languages` SET `iso_639_3_code` = 'zul' WHERE `iso_639_code` = 'zu';
INSERT INTO `adm_grp_action_access`
          (`controller_name`,         `action_name`, `is_ajax`, `description`)
VALUES    ('new-video-club',  'get-media-info-json',         1, 'Getting media-info from source');
EOL
);
    }
    public function down(\Doctrine\DBAL\Schema\Schema $schema)
    {
        $this->addSql(<<<EOL
ALTER TABLE `languages` DROP COLUMN `iso_639_3_code`;
--
EOL
);
    }
}
