<?php

use Phalcon\Mvc\Model\Migration;

class AlterTableProdukMigration_527 extends Migration {
    public function up()
    {
        self::$connection->execute("ALTER TABLE jaga.produk ADD COLUMN IF NOT EXISTS nama_en character varying(255);");

        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'General' WHERE id_index = 1;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Education - School' WHERE id_index = 2;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Health Facilities' WHERE id_index = 3;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Hospital' WHERE id_index = 4;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Licensing' WHERE id_index = 5;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Village' WHERE id_index = 6;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'News' WHERE id_index = 7;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Event' WHERE id_index = 8;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Complaint' WHERE id_index = 9;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Monitoring Center for Prevention' WHERE id_index = 10;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'E-LHKPN' WHERE id_index = 11;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Gratuity' WHERE id_index = 12;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Indonesia Integrity Survey (IIS)' WHERE id_index = 13;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'CEC Corruption Cases' WHERE id_index = 14;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Education - Higher Education' WHERE id_index = 15;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'National Strategy of Corruption Prevention' WHERE id_index = 16;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Mascot Design Challenge' WHERE id_index = 17;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Jaga Data Challenge' WHERE id_index = 18;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'SPI Data Challenge 2022' WHERE id_index = 19;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Harbor' WHERE id_index = 20;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'COVID-19 Handling' WHERE id_index = 21;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Public Lighting Tax' WHERE id_index = 22;");
        self::$connection->execute("UPDATE jaga.produk SET nama_en = 'Budget' WHERE id_index = 23;");
    }

    public function down()
    {
        self::$connection->execute("ALTER TABLE jaga.produk DROP COLUMN IF EXISTS nama_en;");

    }
}

