<?php

class m131112_082818_tranfer_table_with_gate_behavior extends MyDbMigration
{
	public function up()
	{
		if ($this->dbConnection->schema->getTable('gate_behavior')->getColumn('transfer_from_vt') == null)
			$this->addColumn('gate_behavior', 'transfer_from_vt', 'boolean  DEFAULT 0');

		if ($this->dbConnection->schema->getTable('gate_behavior')->getColumn('transfer_from_event') == null)
			$this->addColumn('gate_behavior', 'transfer_from_event', 'boolean  DEFAULT 0');
	}

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

		if ($this->dbConnection->schema->getTable('gate_behavior')->getColumn('transfer_from_event') != null)
			$this->dropColumn('gate_behavior', 'transfer_from_event');
		
		return true;
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}