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

Version20161122085340::changeSchema()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
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
11
	public function changeSchema(Schema $schema, array $options) {
12
		$prefix = $options['tablePrefix'];
13
		if ($schema->hasTable("{$prefix}activity")) {
14
			return;
15
		}
16
		$schemaReader = new MDB2SchemaReader(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()->getDatabasePlatform());
17
		$schemaReader->loadSchemaFromFile(__DIR__ . '/../database.xml', $schema);
18
	}
19
20
}
21