Completed
Push — master ( 721837...277496 )
by Victor
13:18
created

Version20170804201125   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A changeSchema() 0 23 2
1
<?php
2
3
namespace OCA\FederatedFileSharing\Migrations;
4
use Doctrine\DBAL\Schema\Schema;
5
use OCP\Migration\ISchemaMigration;
6
7
/** Creates initial schema */
8
class Version20170804201125 implements ISchemaMigration {
9
	public function changeSchema(Schema $schema, array $options) {
10
		$prefix = $options['tablePrefix'];
11
		if (!$schema->hasTable("{$prefix}federated_reshares")) {
12
			$table = $schema->createTable("{$prefix}federated_reshares");
13
			$table->addColumn('share_id', 'bigint', [
14
				'unsigned' => false,
15
				'notnull' => true,
16
				'length' => 11,
17
			]);
18
19
			$table->addColumn('remote_id', 'bigint', [
20
				'unsigned' => false,
21
				'notnull' => true,
22
				'length' => 11,
23
				'comment' => 'share ID at the remote server'
24
			]);
25
26
			$table->addUniqueIndex(
27
				['share_id'],
28
				'share_id_index'
29
			);
30
		}
31
	}
32
}
33