Code Duplication    Length = 10-11 lines in 2 locations

ecrire/maj/legacy/v30.php 1 location

@@ 301-311 (lines=11) @@
298
						}
299
					}
300
				}
301
				foreach ($desc['field'] as $field => $type) {
302
					if ($desc['field'][$field] !== $desc_collate[$field]) {
303
						spip_log("Conversion COLLATE table $table", "maj." . _LOG_INFO_IMPORTANTE);
304
						sql_alter("table $table change $field $field " . $desc_collate[$field]);
305
						$trouver_table('');
306
						$new_desc = $trouver_table($table);
307
						spip_log("Apres conversion $table : " . var_export($new_desc['field'], true),
308
							"maj." . _LOG_INFO_IMPORTANTE);
309
						continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
310
					}
311
				}
312
			}
313
		}
314
	}

ecrire/maj/legacy/v40.php 1 location

@@ 65-74 (lines=10) @@
62
			$d = array_diff($desc['field'], $fields_corrected);
63
			if ($d) {
64
				spip_log("Table $table TIMESTAMP incorrect", "maj");
65
				foreach ($desc['field'] as $field => $type) {
66
					if ($desc['field'][$field] !== $fields_corrected[$field]) {
67
						spip_log("Adaptation TIMESTAMP table $table", "maj." . _LOG_INFO_IMPORTANTE);
68
						sql_alter("table $table change $field $field " . $fields_corrected[$field]);
69
						$trouver_table('');
70
						$new_desc = $trouver_table($table);
71
						spip_log("Apres conversion $table : " . var_export($new_desc['field'], true),
72
							"maj." . _LOG_INFO_IMPORTANTE);
73
					}
74
				}
75
			}
76
		}
77
	}