<?php

class m150212_142146_add_gate_orderIndex extends CDbMigration
{
 public function up()
  {
    if ($this->dbConnection->schema->getTable('gatetable')->getColumn('orderIndex') == null)
      $this->addColumn('gatetable', 'orderIndex', 'int');
  }

  public function down()
  {
    if ($this->dbConnection->schema->getTable('gatetable')->getColumn('orderIndex') != null)
      $this->dropColumn('gatetable', 'orderIndex');

    return true;
  }
}