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

Version20180622095921::changeSchema()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 25
rs 9.52
c 0
b 0
f 0
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