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

@@ 74-112 (lines=39) @@
71
			$table->setPrimaryKey(['circle_id', 'user_id', 'user_type', 'instance']);
72
		}
73
74
		if (!$schema->hasTable('circles_gsevents')) {
75
			$table = $schema->createTable('circles_gsevents');
76
			$table->addColumn(
77
				'token', 'string', [
78
						   'notnull' => false,
79
						   'length'  => 63,
80
					   ]
81
			);
82
			$table->addColumn(
83
				'event', 'text', [
84
						   'notnull' => false
85
					   ]
86
			);
87
			$table->addColumn(
88
				'instance', 'string', [
89
							  'length'  => 255,
90
							  'notnull' => false
91
						  ]
92
			);
93
			$table->addColumn(
94
				'severity', 'integer', [
95
							  'length'  => 3,
96
							  'notnull' => false
97
						  ]
98
			);
99
			$table->addColumn(
100
				'status', 'integer', [
101
							'length'  => 3,
102
							'notnull' => false
103
						]
104
			);
105
			$table->addColumn(
106
				'creation', 'bigint', [
107
							  'length'  => 14,
108
							  'notnull' => false
109
						  ]
110
			);
111
			$table->addUniqueIndex(['token', 'instance']);
112
		}
113
114
		if (!$schema->hasTable('circles_gsshares')) {
115
			$table = $schema->createTable('circles_gsshares');