<?php 

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

/**
 * Class SekolahMigration_109
 */
class SekolahMigration_109 extends Migration
{
    /**
     * Define the table structure
     *
     * @return void
     */
    public function morph()
    {
        
    }

    /**
     * Run the migrations
     *
     * @return void
     */
    public function up()
    {
		self::$connection->execute('
			ALTER TABLE jaga.sekolah
			ADD COLUMN kecamatan_code char(6);
						   
			ALTER TABLE jaga.sekolah
				ADD FOREIGN KEY (kecamatan_code)
				REFERENCES jaga.master_kecamatan (kecamatan_code) MATCH SIMPLE
				ON UPDATE CASCADE
				ON DELETE NO ACTION;
		');
    }

    /**
     * Reverse the migrations
     *
     * @return void
     */
    public function down()
    {

    }

}
