Code Duplication    Length = 24-24 lines in 2 locations

core/Migrations/Version20170111103310.php 2 locations

@@ 74-97 (lines=24) @@
71
			$table->addUniqueIndex(['type', 'value', 'mount_id'], 'applicable_type_value_mount');
72
		}
73
74
		if (!$schema->hasTable("${prefix}external_config")) {
75
			$table = $schema->createTable("${prefix}external_config");
76
			$table->addColumn('config_id', 'bigint', [
77
				'autoincrement' => true,
78
				'notnull' => true,
79
				'length' => 20,
80
			]);
81
			// foreign key: external_mounts.mount_id
82
			$table->addColumn('mount_id', 'bigint', [
83
				'notnull' => true,
84
				'length' => 20,
85
			]);
86
			$table->addColumn('key', 'string', [
87
				'notnull' => true,
88
				'length' => 64,
89
			]);
90
			$table->addColumn('value', 'string', [
91
				'notnull' => true,
92
				'length' => 4096,
93
			]);
94
			$table->setPrimaryKey(['config_id']);
95
			$table->addIndex(['mount_id'], 'config_mount');
96
			$table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key');
97
		}
98
99
		if (!$schema->hasTable("${prefix}external_options")) {
100
			$table = $schema->createTable("${prefix}external_options");
@@ 99-122 (lines=24) @@
96
			$table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key');
97
		}
98
99
		if (!$schema->hasTable("${prefix}external_options")) {
100
			$table = $schema->createTable("${prefix}external_options");
101
			$table->addColumn('option_id', 'bigint', [
102
				'autoincrement' => true,
103
				'notnull' => true,
104
				'length' => 20,
105
			]);
106
			// foreign key: external_mounts.mount_id
107
			$table->addColumn('mount_id', 'bigint', [
108
				'notnull' => true,
109
				'length' => 20,
110
			]);
111
			$table->addColumn('key', 'string', [
112
				'notnull' => true,
113
				'length' => 64,
114
			]);
115
			$table->addColumn('value', 'string', [
116
				'notnull' => true,
117
				'length' => 256,
118
			]);
119
			$table->setPrimaryKey(['option_id']);
120
			$table->addIndex(['mount_id'], 'option_mount');
121
			$table->addUniqueIndex(['mount_id', 'key'], 'option_mount_key');
122
		}
123
	}
124
}
125