<?php

defined('BASEPATH') OR exit('No direct script access allowed');
include_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'MY_Migration.php';

class Migration_Add_poscode extends MY_Migration {

    public function up() {
        $this->dbforge->add_field(static::id() + [
            'province' => static::text(), // provinsi
            'city' => static::text(), // kabupaten/kota
            'district' => static::text(), // kecamatan
            'sub_district' => static::text(), // kelurahan/desa
            'code' => static::text(),
            'status' => static::status('1 = ACTIVE, 2 = BANNED'),
            ] + static::default());
         $this->dbforge->add_key('id', true);
        $this->dbforge->create_table('poscode');
    }

    //--------------------------------------------------------------------

    public function down() {
        $this->dbforge->drop_table('poscode');
    }

}
