Completed
Pull Request — master (#583)
by Tom
326:15 queued 324:43
created

Version20170718101647   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 15
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A changeSchema() 0 12 3
1
<?php
2
namespace OCA\activity\Migrations;
3
4
use Doctrine\DBAL\Schema\Schema;
5
use Doctrine\DBAL\Types\Type;
6
use OCP\Migration\ISchemaMigration;
7
8
/**
9
 * Moves activity id to bigint
10
 */
11
class Version20170718101647 implements ISchemaMigration {
12
13
	public function changeSchema(Schema $schema, array $options) {
14
		$prefix = $options['tablePrefix'];
15
		if ($schema->hasTable("${prefix}activity")) {
16
			$table = $schema->getTable("{$prefix}activity");
17
			$idColumn = $table->getColumn('activity_id');
18
			if ($idColumn){
19
				$idColumn->setType(Type::getType(Type::BIGINT));
20
				$idColumn->setOptions(['length' => 20]);
21
			}
22
23
		}
24
    }
25
}
26