Code Duplication    Length = 28-32 lines in 3 locations

lib/Migration/Version0021Date20210105123456.php 1 location

@@ 162-192 (lines=31) @@
159
			$table->addIndex(['href']);
160
		}
161
162
		if (!$schema->hasTable('circle_membership')) {
163
			$table = $schema->createTable('circle_membership');
164
165
			$table->addColumn(
166
				'id', 'string', [
167
						'notnull' => true,
168
						'length'  => 15,
169
					]
170
			);
171
			$table->addColumn(
172
				'circle_id', 'string', [
173
							   'notnull' => true,
174
							   'length'  => 15,
175
						   ]
176
			);
177
			$table->addColumn(
178
				'member_id', 'string', [
179
							   'notnull' => true,
180
							   'length'  => 15,
181
						   ]
182
			);
183
			$table->addColumn(
184
				'level', 'integer', [
185
						   'notnull'  => true,
186
						   'length'   => 1,
187
						   'unsigned' => true
188
					   ]
189
			);
190
191
			$table->addIndex(['id']);
192
		}
193
194
195
		if (!$schema->hasTable('circle_share_locks')) {

lib/Migration/Version0019Date20200603080001.php 2 locations

@@ 178-209 (lines=32) @@
175
//		}
176
177
178
		if (!$schema->hasTable('circle_groups')) {
179
			$table = $schema->createTable('circle_groups');
180
			$table->addColumn(
181
				'circle_id', 'string', [
182
							   'notnull' => true,
183
							   'length'  => 15,
184
						   ]
185
			);
186
			$table->addColumn(
187
				'group_id', 'string', [
188
							  'notnull' => true,
189
							  'length'  => 64,
190
						  ]
191
			);
192
			$table->addColumn(
193
				'level', 'smallint', [
194
						   'notnull' => true,
195
						   'length'  => 1,
196
					   ]
197
			);
198
			$table->addColumn(
199
				'note', 'text', [
200
						  'notnull' => false
201
					  ]
202
			);
203
			$table->addColumn(
204
				'joined', 'datetime', [
205
							'notnull' => false,
206
						]
207
			);
208
			$table->setPrimaryKey(['circle_id', 'group_id']);
209
		}
210
211
212
		if (!$schema->hasTable('circle_gsevents')) {
@@ 309-336 (lines=28) @@
306
		}
307
308
309
		if (!$schema->hasTable('circle_gsshares_mp')) {
310
			$table = $schema->createTable('circle_gsshares_mp');
311
			$table->addColumn(
312
				'share_id', 'integer', [
313
							  'length'  => 11,
314
							  'notnull' => false
315
						  ]
316
			);
317
			$table->addColumn(
318
				'user_id', 'string', [
319
							 'length'  => 127,
320
							 'notnull' => false
321
						 ]
322
			);
323
			$table->addColumn(
324
				'mountpoint', 'text', [
325
								'notnull' => false
326
							]
327
			);
328
			$table->addColumn(
329
				'mountpoint_hash', 'string', [
330
									 'length'  => 64,
331
									 'notnull' => false
332
								 ]
333
			);
334
			$table->setPrimaryKey(['share_id', 'user_id']);
335
			$table->addUniqueIndex(['share_id', 'mountpoint_hash']);
336
		}
337
338
339