<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Mod_user_profile_1 extends CI_Migration {

    public function up() {
        $fields = array(
            'pax' => array(
                'type' => 'VARCHAR',
                'constraint' => 255,
                'null' => true,
                'after' => 'city'
            ),
            'table' => array(
                'type' => 'VARCHAR',
                'constraint' => 255,
                'null' => true,
                'after' => 'pax'
            ),
            'seat' => array(
                'type' => 'VARCHAR',
                'constraint' => 255,
                'null' => true,
                'after' => 'table'
            ),
            'optic' => array(
                'type' => 'VARCHAR',
                'constraint' => 255,
                'null' => true,
                'after' => 'seat'
            ),
            'privacy' => array(
                'type' => 'SMALLINT',
                'constraint' => 1,
                'null'=> true,
                'default' => 0,
                'after' => 'optic'
            ),
            'inform' => array(
                'type' => 'SMALLINT',
                'constraint' => 1,
                'null'=> true,
                'default' => 0,
                'after' => 'privacy'
            ),
        );
        $this->dbforge->add_column('user_profile', $fields);
    }

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

    public function down() {
        $this->dbforge->drop_column('user_profile', 'pax');
        $this->dbforge->drop_column('user_profile', 'table');
         $this->dbforge->drop_column('user_profile', 'seat');
        $this->dbforge->drop_column('user_profile', 'optic');
        $this->dbforge->drop_column('user_profile', 'privacy');
        $this->dbforge->drop_column('user_profile', 'inform');
    }

}
