<?php

class m200203_202709_mobile_voltar_licencas_mobile_cliente extends CDbMigration
{
	public function up()
	{
		$table = Yii::app()->db->schema->getTable('contratos');
		if(isset($table->columns['COT_CLI_LICENCAS_USO_MOBILE'])) {
			$this->renameColumn('contratos', 'COT_CLI_LICENCAS_USO_MOBILE', 'COT_CLI_MODULO_MOBILE');
		}
		$this->refreshTableSchema('contratos');
	}

	public function down()
	{
		$table = Yii::app()->db->schema->getTable('contratos');
		if(isset($table->columns['COT_CLI_MODULO_MOBILE'])) {
			$this->renameColumn('contratos', 'COT_CLI_MODULO_MOBILE', 'COT_CLI_LICENCAS_USO_MOBILE');
		}
		$this->refreshTableSchema('contratos');
	}
}