Completed
Pull Request — master (#546)
by Thomas
03:39
created

Version20161122085340   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
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 14
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A changeSchema() 0 10 2
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
17
		// not that valid ....
18
		$schemaReader = new MDB2SchemaReader(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()->getDatabasePlatform());
19
		$schemaReader->loadSchemaFromFile(__DIR__ . '/../database.xml', $schema);
20
	}
21
22
}
23