Code Duplication    Length = 24-39 lines in 2 locations

lib/Migration/Version0017Date20191205153154.php 1 location

@@ 235-258 (lines=24) @@
232
			$table->setPrimaryKey(['id']);
233
		}
234
235
		if (!$schema->hasTable('circles_tokens')) {
236
			$table = $schema->createTable('circles_tokens');
237
			$table->addColumn('circle_id', 'string', [
238
				'notnull' => true,
239
				'length' => 31,
240
			]);
241
			$table->addColumn('user_id', 'string', [
242
				'notnull' => true,
243
				'length' => 255,
244
			]);
245
			$table->addColumn('share_id', 'bigint', [
246
				'notnull' => true,
247
				'length' => 14,
248
			]);
249
			$table->addColumn('token', 'string', [
250
				'notnull' => true,
251
				'length' => 31,
252
			]);
253
			$table->addColumn('password', 'string', [
254
				'notnull' => true,
255
				'length' => 127,
256
			]);
257
			$table->setPrimaryKey(['circle_id', 'user_id', 'share_id']);
258
		}
259
		return $schema;
260
	}
261

lib/Migration/Version0017Date20191210153032.php 1 location

@@ 62-100 (lines=39) @@
59
		/** @var ISchemaWrapper $schema */
60
		$schema = $schemaClosure();
61
		
62
		if (!$schema->hasTable('circles_gsevents')) {
63
			$table = $schema->createTable('circles_gsevents');
64
			$table->addColumn(
65
				'token', 'string', [
66
						   'notnull' => false,
67
						   'length'  => 63,
68
					   ]
69
			);
70
			$table->addColumn(
71
				'event', 'text', [
72
						   'notnull' => false
73
					   ]
74
			);
75
			$table->addColumn(
76
				'instance', 'string', [
77
							  'length'  => 255,
78
							  'notnull' => false
79
						  ]
80
			);
81
			$table->addColumn(
82
				'severity', 'integer', [
83
							  'length'  => 3,
84
							  'notnull' => false
85
						  ]
86
			);
87
			$table->addColumn(
88
				'status', 'integer', [
89
							'length'  => 3,
90
							'notnull' => false
91
						]
92
			);
93
			$table->addColumn(
94
				'creation', 'bigint', [
95
							  'length'  => 14,
96
							  'notnull' => false
97
						  ]
98
			);
99
			$table->addUniqueIndex(['token', 'instance']);
100
		}
101
102
		if (!$schema->hasTable('circles_gsshares')) {
103
			$table = $schema->createTable('circles_gsshares');