From e546b483a1bdf324ea1b3933b6daf1b0664e0c76 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 19 Sep 2018 11:29:57 +0200 Subject: [PATCH] Delete copy/pasted code --- adminer/drivers/clickhouse.inc.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/adminer/drivers/clickhouse.inc.php b/adminer/drivers/clickhouse.inc.php index 4058ce94..9882a1c5 100644 --- a/adminer/drivers/clickhouse.inc.php +++ b/adminer/drivers/clickhouse.inc.php @@ -154,33 +154,12 @@ if (isset($_GET["clickhouse"])) { } function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) { - $alter = array(); foreach ($fields as $field) { if ($field[1][2] === " NULL") { $field[1][1] = " Nullable({$field[1][1]})"; } unset($field[1][2]); - $alter[] = ($field[1] - ? ($table != "" ? ($field[0] != "" ? "CHANGE " . idf_escape($field[0]) : "ADD") : " ") . " " . implode($field[1]) - : "DROP " . idf_escape($field[0]) - ); } - $alter = array_merge($alter, $foreign); - $status = ($comment !== null ? " COMMENT=" . q($comment) : "") - . ($engine ? " ENGINE=" . q($engine) : "") - . ($collation ? " COLLATE " . q($collation) : "") - . ($auto_increment != "" ? " AUTO_INCREMENT=$auto_increment" : "") - ; - if ($table == "") { - return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status$partitioning"); - } - if ($table != $name) { - $alter[] = "RENAME TO " . table($name); - } - if ($status) { - $alter[] = ltrim($status); - } - return ($alter || $partitioning ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter) . $partitioning) : true); } function truncate_tables($tables) {