<?php

class m130501_102057_create_http_session extends MyDbMigration
{
  public function up()
  {
  	  	if($this->getTable('yii_session'))
  		return;
  	
    $this->createTable('yii_session',
      array(
        "id" => "char(32)",
        "expire" => "integer",
        "data" => "longblob",
        "id_user" => "integer",
      ),
      'ENGINE=MyISAM'
    );

    $this->addPrimaryKey('id_index', 'yii_session', 'id');
    $this->createIndex('id_user_index', 'yii_session', 'id_user');
  }

  public function down()
  {
    $this->dropTable('yii_session');
  }

}
