<?php

class m140618_105822_add_whitelisttable_enabled_and_to_be_confirmed extends MyDbMigration
{
  public function up()
  {
		if ($this->dbConnection->schema->getTable('whitelisttable')->getColumn('enabled') == null)
			$this->addColumn('whitelisttable', 'enabled', 'boolean  DEFAULT 1');
		if ($this->dbConnection->schema->getTable('whitelisttable')->getColumn('to_be_confirmed') == null)
			$this->addColumn('whitelisttable', 'to_be_confirmed', 'boolean  DEFAULT 0');
  }

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