Version20161122085340::changeSchema()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 8
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
namespace OCA\activity\Migrations;
4
5
use Doctrine\DBAL\Schema\Schema;
6
use OC\DB\MDB2SchemaReader;
7
use OCP\Migration\ISchemaMigration;
8
9
class Version20161122085340 implements ISchemaMigration {
10
	public function changeSchema(Schema $schema, array $options) {
11
		$prefix = $options['tablePrefix'];
12
		if ($schema->hasTable("{$prefix}activity")) {
13
			return;
14
		}
15
16
		// not that valid ....
17
		$schemaReader = new MDB2SchemaReader(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()->getDatabasePlatform());
18
		$schemaReader->loadSchemaFromFile(__DIR__ . '/../database.xml', $schema);
19
	}
20
}
21