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

Version20161122092159::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
crap 2
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