<?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_doorprize extends MY_Migration {

       public function up() {
              $this->dbforge->add_field(static::id() + [
                      'nama' => static::text(['constraint' => 50, 'null' => false]),
                      'slug' => static::text(['constraint' => 50, 'null' => false]),
                      'gambar' => static::longtext(),
                      'status' => static::status('1 = ACTIVE, 2 = VOTED, 3 = NAME_CHANGED')
              ] + static::default());
              $this->dbforge->add_key('id', true);
              $this->dbforge->create_table('doorprize');
       }

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

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

}
