<?php

use Phalcon\Db\Column;
use Phalcon\Db\Index;
use Phalcon\Db\Reference;
use Phalcon\Mvc\Model\Migration;

/**
 * Class MasterProvinsiMigration_102
 */
class MasterProvinsiMigration_102 extends Migration
{
    /**
     * Run the migrations
     *
     * @return void
     */
    public function up()
    {
        self::$connection->execute('
            CREATE TABLE jaga.master_provinsi(
                provinsi_code char(2) primary key,
                provinsi_name varchar(255) not null,
                created_at timestamp without time zone NOT NULL DEFAULT now(),
                updated_at timestamp without time zone NOT NULL DEFAULT now(),
                deleted_at timestamp without time zone
            );');

        $this->batchInsert(
            'master_provinsi',
            [
                'provinsi_code',
                'provinsi_name',
                'created_at',
                'updated_at'
            ]
        );
    }

    /**
     * Reverse the migrations
     *
     * @return void
     */
    public function down()
    {
        //$this->batchDelete('master_provinsi');
    }
}
