Code Duplication    Length = 7-8 lines in 7 locations

engine/schema/migrations/20170728010000_remove_site_guid.php 5 locations

@@ 153-160 (lines=8) @@
150
151
			$table = $this->table('access_collections');
152
153
			if (!$table->hasColumn('site_guid')) {
154
				$table->addColumn('site_guid', 'integer', [
155
					'null' => false,
156
					'limit' => MysqlAdapter::INT_BIG,
157
					'precision' => 20,
158
					'signed' => false,
159
				]);
160
			}
161
162
			if (!$table->hasIndex('site_guid')) {
163
				$table->addIndex(['site_guid'], [
@@ 184-191 (lines=8) @@
181
182
			$table = $this->table('api_users');
183
184
			if (!$table->hasColumn('site_guid')) {
185
				$table->addColumn('site_guid', 'integer', [
186
					'null' => false,
187
					'limit' => MysqlAdapter::INT_BIG,
188
					'precision' => 20,
189
					'signed' => false,
190
				]);
191
			}
192
193
			$table->save();
194
@@ 213-220 (lines=8) @@
210
				],
211
			]);
212
213
			if (!$table->hasColumn('site_guid')) {
214
				$table->addColumn('site_guid', 'integer', [
215
					'null' => false,
216
					'limit' => MysqlAdapter::INT_BIG,
217
					'precision' => 20,
218
					'signed' => false,
219
				]);
220
			}
221
222
			if (!$table->hasIndex('site_guid')) {
223
				$table->addIndex(['site_guid'], [
@@ 245-252 (lines=8) @@
242
			// remove site guid from entities
243
			$table = $this->table('entities');
244
245
			if (!$table->hasColumn('site_guid')) {
246
				$table->addColumn('site_guid', 'integer', [
247
					'null' => false,
248
					'limit' => MysqlAdapter::INT_BIG,
249
					'precision' => 20,
250
					'signed' => false,
251
				]);
252
			}
253
254
			if (!$table->hasIndex('site_guid')) {
255
				$table->addIndex(['site_guid'], [
@@ 296-303 (lines=8) @@
293
				$table->removeIndexByName('site_guid');
294
			}
295
296
			if (!$table->hasColumn('site_guid')) {
297
				$table->addColumn('site_guid', 'integer', [
298
					'null' => false,
299
					'limit' => MysqlAdapter::INT_BIG,
300
					'precision' => 20,
301
					'signed' => false,
302
				]);
303
			}
304
305
			if ($table->hasIndex('user_guid')) {
306
				$table->removeIndexByName('user_guid');

engine/schema/migrations/20170728030000_denormalize_metastrings.php 2 locations

@@ 139-145 (lines=7) @@
136
				 ] as $table) {
137
			$table = $this->table($table);
138
139
			if (!$table->hasColumn('name_id')) {
140
				$table->addColumn('name_id', 'integer', [
141
					'null' => false,
142
					'limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_REGULAR,
143
					'precision' => 11,
144
				]);
145
			}
146
147
			if (!$table->hasColumn('value_id')) {
148
				$table->addColumn('value_id', 'integer', [
@@ 147-153 (lines=7) @@
144
				]);
145
			}
146
147
			if (!$table->hasColumn('value_id')) {
148
				$table->addColumn('value_id', 'integer', [
149
					'null' => false,
150
					'limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_REGULAR,
151
					'precision' => 11,
152
				]);
153
			}
154
155
			if (!$table->hasIndex('name_id')) {
156
				$table->addIndex(['name_id'], [