<?php

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

class Migration_Mod_user_profile_4 extends MY_Migration {

    public function up() {
        $fields = array(
            'location' => static::text(['after' => 'name']),
            'pax_name' => static::text(['after' => 'pax']),
            'pax_phone' => static::text(['after' => 'pax_name']),
            'pax_email' => static::text(['after' => 'pax_phone']),
            'province' => static::text(['after' => 'address']),
            'district' => static::text(['after' => 'city']),
            'sub_district' => static::text(['after' => 'district']),
            'poscode' => static::text(['after' => 'sub_district']),
        );
        $this->dbforge->add_column('user_profile', $fields);
    }

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

    public function down() {
        $this->dbforge->drop_column('user_profile', 'location');
        $this->dbforge->drop_column('user_profile', 'pax_name');
        $this->dbforge->drop_column('user_profile', 'pax_phone');
        $this->dbforge->drop_column('user_profile', 'pax_email');
        $this->dbforge->drop_column('user_profile', 'province');
        $this->dbforge->drop_column('user_profile', 'district');
        $this->dbforge->drop_column('user_profile', 'sub_district');
        $this->dbforge->drop_column('user_profile', 'poscode');
    }

}
