<?php

class m140710_103801_add_autoconfirm_autoconfirm_wait_in_plate_list_table extends MyDbMigration
{
  public function up()
  {
    if ($this->dbConnection->schema->getTable('plate_list')->getColumn('autoconfirm') == null)
      $this->addColumn('plate_list', 'autoconfirm', 'boolean');
    if ($this->dbConnection->schema->getTable('plate_list')->getColumn('autoconfirm_wait') == null)
      $this->addColumn('plate_list', 'autoconfirm_wait', 'TIME');
  }

  public function down()
  {
    if ($this->dbConnection->schema->getTable('plate_list')->getColumn('autoconfirm_wait') != null)
      $this->dropColumn('plate_list', 'autoconfirm_wait');
    if ($this->dbConnection->schema->getTable('plate_list')->getColumn('autoconfirm') != null)
      $this->dropColumn('plate_list', 'autoconfirm');
    
    return true;
  }
}