<?php

class m200204_165212_quantidade_licencas_mobile_contrato extends CDbMigration
{
	public function up()
	{
		$table = Yii::app()->db->schema->getTable('contratos');
		if(!isset($table->columns['COT_CLI_QTDLICENCAS_MOBILE'])) {
			$this->addColumn('contratos', 'COT_CLI_QTDLICENCAS_MOBILE', 'INT(2) NULL default 0');
			$this->refreshTableSchema('contratos');
		}
	}

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