getColumnName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 1
1
<?php
2
3
class m131004_175217_add_ipaddress_column extends AddColumnMigration
4
{
5
6
	protected function getColumnName()
7
	{
8
		return 'source_address';
9
	}
10
11
	protected function getColumnType()
12
	{
13
		return 'VARCHAR(45)';
14
	}
15
16
	protected function getTableName()
17
	{
18
		return 'log';
19
	}
20
	
21
	public function up()
22
	{
23
		// It's okay if the table doesn't exist, it is created correctly the 
24
		// first time the application is run
25
		if (Yii::app()->db->schema->getTable($this->getTableName()) === null)
26
			return;
27
28
		return parent::up();
29
	}
30
31
}
32