<?php

use Phalcon\Mvc\Model\Migration;

class KorsupgahTargetMigration_187 extends Migration
{
    public function up()
    {
        self::$connection->execute("ALTER TABLE jaga.korsupgah_target ADD COLUMN presentase_bobot INT");

        $this->batchInsert('korsupgah_target', [
            'id',
            'id_sub_indikator',
            'nama',
            'presentase_bobot',
            'info_nilai',
            'info_lampiran'
        ]);

        self::$connection->execute("SELECT setval('korsupgah_target_id_seq', (SELECT MAX(id) FROM jaga.korsupgah_target));");
    }

    public function down()
    {
        self::$connection->execute("ALTER TABLE jaga.korsupgah_target DROP COLUMN presentase_bobot");
    }

}