<?php

class m170825_091641_migration_for_generate_by_service extends MyDbMigration
{
	public function up()
	{
		$this->addColumn('run', 'report_generation_date', "datetime"); 
		$this->addColumn('run', 'registration_status', "string DEFAULT 'unregistered'");
		$this->addColumn('run', 'report_user', "INT(11) DEFAULT '0'");
		
		$this->addColumn('report_archive', 'serviceID', "BIGINT(20) DEFAULT NULL");
		$this->alterColumn('report_archive', 'PeriodID', "BIGINT(20) DEFAULT NULL");
		
		return true;
	}

	public function down()
	{
		$this->dropColumn('run', 'report_generation_date'); 
		$this->dropColumn('run', 'registration_status'); 
		$this->dropColumn('run', 'report_user'); 
		$this->dropColumn('report_archive', 'serviceID'); 
		return true;
	}

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

	public function safeDown()
	{
	}
	*/
}