Code Duplication    Length = 31-32 lines in 2 locations

apps/dav/lib/Migration/Version1004Date20170825134824.php 1 location

@@ 448-478 (lines=31) @@
445
			$table->addIndex(['value'], 'calendarobject_value_index');
446
		}
447
448
		if (!$schema->hasTable('dav_shares')) {
449
			$table = $schema->createTable('dav_shares');
450
			$table->addColumn('id', 'bigint', [
451
				'autoincrement' => true,
452
				'notnull' => true,
453
				'length' => 11,
454
				'unsigned' => true,
455
			]);
456
			$table->addColumn('principaluri', 'string', [
457
				'notnull' => false,
458
				'length' => 255,
459
			]);
460
			$table->addColumn('type', 'string', [
461
				'notnull' => false,
462
				'length' => 255,
463
			]);
464
			$table->addColumn('access', 'smallint', [
465
				'notnull' => false,
466
				'length' => 1,
467
			]);
468
			$table->addColumn('resourceid', 'integer', [
469
				'notnull' => true,
470
				'unsigned' => true,
471
			]);
472
			$table->addColumn('publicuri', 'string', [
473
				'notnull' => false,
474
				'length' => 255,
475
			]);
476
			$table->setPrimaryKey(['id']);
477
			$table->addUniqueIndex(['principaluri', 'resourceid', 'type', 'publicuri'], 'dav_shares_index');
478
		}
479
		return $schema;
480
	}
481
}

core/Migrations/Version14000Date20180626223656.php 1 location

@@ 34-65 (lines=32) @@
31
	public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
32
		/** @var ISchemaWrapper $schema */
33
		$schema = $schemaClosure();
34
		if(!$schema->hasTable('whats_new')) {
35
			$table = $schema->createTable('whats_new');
36
			$table->addColumn('id', 'integer', [
37
				'autoincrement' => true,
38
				'notnull' => true,
39
				'length' => 4,
40
				'unsigned' => true,
41
			]);
42
			$table->addColumn('version', 'string', [
43
				'notnull' => true,
44
				'length' => 64,
45
				'default' => '11',
46
			]);
47
			$table->addColumn('etag', 'string', [
48
				'notnull' => true,
49
				'length' => 64,
50
				'default' => '',
51
			]);
52
			$table->addColumn('last_check', 'integer', [
53
				'notnull' => true,
54
				'length' => 4,
55
				'unsigned' => true,
56
				'default' => 0,
57
			]);
58
			$table->addColumn('data', 'text', [
59
				'notnull' => true,
60
				'default' => '',
61
			]);
62
			$table->setPrimaryKey(['id']);
63
			$table->addUniqueIndex(['version']);
64
			$table->addIndex(['version', 'etag'], 'version_etag_idx');
65
		}
66
67
		return $schema;
68
	}