Code Duplication    Length = 26-28 lines in 3 locations

core/Migrations/Version13000Date20170718121200.php 3 locations

@@ 284-311 (lines=28) @@
281
			$table->setPrimaryKey(['userid', 'appid', 'configkey']);
282
		}
283
284
		if (!$schema->hasTable('properties')) {
285
			$table = $schema->createTable('properties');
286
			$table->addColumn('id', 'integer', [
287
				'autoincrement' => true,
288
				'notnull' => true,
289
				'length' => 4,
290
			]);
291
			$table->addColumn('userid', 'string', [
292
				'notnull' => true,
293
				'length' => 64,
294
				'default' => '',
295
			]);
296
			$table->addColumn('propertypath', 'string', [
297
				'notnull' => true,
298
				'length' => 255,
299
				'default' => '',
300
			]);
301
			$table->addColumn('propertyname', 'string', [
302
				'notnull' => true,
303
				'length' => 255,
304
				'default' => '',
305
			]);
306
			$table->addColumn('propertyvalue', 'text', [
307
				'notnull' => true,
308
			]);
309
			$table->setPrimaryKey(['id']);
310
			$table->addIndex(['userid'], 'property_index');
311
		}
312
313
		if (!$schema->hasTable('share')) {
314
			$table = $schema->createTable('share');
@@ 614-639 (lines=26) @@
611
			$table->addIndex(['objid', 'type'], 'vcategory_objectd_index');
612
		}
613
614
		if (!$schema->hasTable('systemtag')) {
615
			$table = $schema->createTable('systemtag');
616
			$table->addColumn('id', 'integer', [
617
				'autoincrement' => true,
618
				'notnull' => true,
619
				'length' => 4,
620
				'unsigned' => true,
621
			]);
622
			$table->addColumn('name', 'string', [
623
				'notnull' => true,
624
				'length' => 64,
625
				'default' => '',
626
			]);
627
			$table->addColumn('visibility', 'smallint', [
628
				'notnull' => true,
629
				'length' => 1,
630
				'default' => 1,
631
			]);
632
			$table->addColumn('editable', 'smallint', [
633
				'notnull' => true,
634
				'length' => 1,
635
				'default' => 1,
636
			]);
637
			$table->setPrimaryKey(['id']);
638
			$table->addUniqueIndex(['name', 'visibility', 'editable'], 'tag_ident');
639
		}
640
641
		if (!$schema->hasTable('systemtag_object_mapping')) {
642
			$table = $schema->createTable('systemtag_object_mapping');
@@ 676-701 (lines=26) @@
673
			$table->setPrimaryKey(['gid', 'systemtagid']);
674
		}
675
676
		if (!$schema->hasTable('file_locks')) {
677
			$table = $schema->createTable('file_locks');
678
			$table->addColumn('id', 'integer', [
679
				'autoincrement' => true,
680
				'notnull' => true,
681
				'length' => 4,
682
				'unsigned' => true,
683
			]);
684
			$table->addColumn('lock', 'integer', [
685
				'notnull' => true,
686
				'length' => 4,
687
				'default' => 0,
688
			]);
689
			$table->addColumn('key', 'string', [
690
				'notnull' => true,
691
				'length' => 64,
692
			]);
693
			$table->addColumn('ttl', 'integer', [
694
				'notnull' => true,
695
				'length' => 4,
696
				'default' => -1,
697
			]);
698
			$table->setPrimaryKey(['id']);
699
			$table->addUniqueIndex(['key'], 'lock_key_index');
700
			$table->addIndex(['ttl'], 'lock_ttl_index');
701
		}
702
703
		if (!$schema->hasTable('comments')) {
704
			$table = $schema->createTable('comments');