Completed
Push — master ( 65e3b0...b26a8a )
by
unknown
31:46 queued 19:29
created

Version20180622095921   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A changeSchema() 0 25 2
1
<?php
2
namespace OCA\dav\Migrations;
3
4
use Doctrine\DBAL\Schema\Schema;
5
use Doctrine\DBAL\Types\Type;
6
use OCP\Migration\ISchemaMigration;
7
8
class Version20180622095921 implements ISchemaMigration {
9
	public function changeSchema(Schema $schema, array $options) {
10
		$prefix = $options['tablePrefix'];
11
		if ($schema->hasTable("${prefix}dav_job_status")) {
12
			return;
13
		}
14
		$table = $schema->createTable("${prefix}dav_job_status");
15
		$table->addColumn('id', Type::BIGINT, [
16
			'autoincrement' => true,
17
			'notnull' => true,
18
			'length' => 20,
19
		]);
20
		$table->addColumn('uuid', Type::GUID, [
21
			'notnull' => true,
22
		]);
23
		$table->addColumn('user_id', Type::STRING, [
24
			'notnull' => true,
25
			'length' => 64,
26
		]);
27
		$table->addColumn('status_info', Type::STRING, [
28
			'notnull' => true,
29
			'length' => 4000,
30
		]);
31
		$table->setPrimaryKey(['id']);
32
		$table->addUniqueIndex(['uuid']);
33
	}
34
}
35