Completed
Pull Request — master (#546)
by Thomas
04:36
created

Version20161122092159   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 23
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 7 1
A down() 0 7 1
1
<?php
2
3
namespace OCA\activity\Migrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
use Doctrine\DBAL\Types\Type;
8
9
class Version20161122092159 extends AbstractMigration {
10
    /**
11
     * @param Schema $schema
12
     */
13
    public function up(Schema $schema) {
14
		$prefix = $this->connection->getPrefix();
15
		$table = $schema->getTable("{$prefix}activity");
16
		$table->changeColumn('app', ['length' => 32]);
17
		$table->changeColumn('subjectparams', ['type' => Type::getType('text')]);
18
		$table->changeColumn('messageparams', ['type' => Type::getType('text')]);
19
    }
20
21
    /**
22
     * @param Schema $schema
23
     */
24
    public function down(Schema $schema) {
25
		$prefix = $this->connection->getPrefix();
26
		$table = $schema->getTable("{$prefix}activity");
27
		$table->changeColumn('app', ['length' => 255]);
28
		$table->changeColumn('subjectparams', ['type' => Type::getType('string'), 'length' => '4000']);
29
		$table->changeColumn('messageparams', ['type' => Type::getType('string'), 'length' => '4000']);
30
    }
31
}
32