mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
Elasticsearch: Support dropping aliases
This commit is contained in:
@@ -529,15 +529,18 @@ if (isset($_GET["elastic"])) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Drop types
|
||||
* @param list<string> $tables
|
||||
*/
|
||||
function drop_views(array $tables): bool {
|
||||
$return = connection()->rootQuery('_aliases', array('actions' => array_map(function ($table) {
|
||||
return array('remove' => array('index' => '*', 'alias' => $table));
|
||||
}, $tables)), 'POST');
|
||||
return $return && !$return['errors'];
|
||||
}
|
||||
|
||||
function drop_tables(array $tables): bool {
|
||||
$return = true;
|
||||
foreach ($tables as $table) { //! convert to bulk api
|
||||
$return = $return && connection()->rootQuery(urlencode($table), null, 'DELETE');
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user