<?php

class m130822_085307_fields_for_blacklist_details_and_more extends MyDbMigration
{
	public function up()
	{
		if ($this->dbConnection->schema->getTable('event_reporting')->getColumn('event_note') == null)
			$this->addColumn('event_reporting', 'event_note', 'text');
		
		if ($this->dbConnection->schema->getTable('plate_list')->getColumn('title') == null)
			$this->addColumn('plate_list', 'title', 'string');
	}

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

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

	public function safeDown()
	{
	}
	*/
}