mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Global search: search device display (#13583)
* Global search: search device display Add display field to search (also port_desc_descr, portName, and bgpPeerDescr) Rewrite backend update typeahead bundle update devices and ports indexes reduce some port field sizes so we can index them * Style fixes * remove nonsense
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ChangePortsTextFieldsToVarchar extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ports', function (Blueprint $table) {
|
||||
$table->string('ifAlias')->change();
|
||||
$table->string('ifType', 64)->change();
|
||||
$table->string('ifPhysAddress', 64)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ports', function (Blueprint $table) {
|
||||
$table->text('ifAlias')->change();
|
||||
$table->text('ifType')->change();
|
||||
$table->text('ifPhysAddress')->change();
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ImproveDevicesSearchIndex extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('devices', function (Blueprint $table) {
|
||||
$table->index(['hostname', 'sysName', 'display']);
|
||||
$table->dropIndex('devices_hostname_index');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('devices', function (Blueprint $table) {
|
||||
$table->index('hostname');
|
||||
$table->dropIndex('devices_hostname_sysname_display_index');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ImprovePortsSearchIndex extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ports', function (Blueprint $table) {
|
||||
$table->index(['ifAlias', 'port_descr_descr', 'portName']);
|
||||
$table->index(['ifDescr', 'ifName']);
|
||||
$table->dropIndex('ports_ifdescr_index');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ports', function (Blueprint $table) {
|
||||
$table->index('ifDescr');
|
||||
$table->dropIndex('ports_ifalias_port_descr_descr_portname_index');
|
||||
$table->dropIndex('ports_ifdescr_ifname_index');
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user