Revert "Switch to utf8mb4 (#12501)" (#12578)

This reverts commit 8e2e67d0ee.
This commit is contained in:
Tony Murray 2021-03-01 14:59:06 -06:00 committed by GitHub
parent c0060dc6ed
commit f5a0959181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1653 additions and 2152 deletions

View File

@ -164,7 +164,7 @@ jobs:
env:
PORT: ${{ job.services.database.ports[3306] }}
run: |
mysql -h"127.0.0.1" -P"$PORT" --user=librenms --password=librenms -e 'ALTER DATABASE librenms_phpunit_78hunjuybybh CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
mysql -h"127.0.0.1" -P"$PORT" --user=librenms --password=librenms -e 'ALTER DATABASE librenms_phpunit_78hunjuybybh CHARACTER SET utf8 COLLATE utf8_unicode_ci;'
-
name: Artisan serve
if: matrix.skip-web-check != '1'

View File

@ -136,8 +136,8 @@ class Eloquent
'username' => $db_user,
'password' => $db_pass,
'unix_socket' => $db_socket,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,

View File

@ -127,34 +127,34 @@ class Database extends BaseValidation
$db_collation_sql = "SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME
FROM information_schema.SCHEMATA S
WHERE schema_name = '$db_name' AND
( DEFAULT_CHARACTER_SET_NAME != 'utf8mb4' OR DEFAULT_COLLATION_NAME != 'utf8mb4_unicode_ci')";
( DEFAULT_CHARACTER_SET_NAME != 'utf8' OR DEFAULT_COLLATION_NAME != 'utf8_unicode_ci')";
$collation = dbFetchRows($db_collation_sql);
if (empty($collation) !== true) {
$validator->fail(
'MySQL Database collation is wrong: ' . implode(' ', $collation[0]),
'Check https://community.librenms.org/t/new-default-database-charset-collation/14956 for info on how to fix.'
'Check https://t.libren.ms/-zdwk for info on how to fix.'
);
}
$table_collation_sql = "SELECT T.TABLE_NAME, C.CHARACTER_SET_NAME, C.COLLATION_NAME
FROM information_schema.TABLES AS T, information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS C
WHERE C.collation_name = T.table_collation AND T.table_schema = '$db_name' AND
( C.CHARACTER_SET_NAME != 'utf8mb4' OR C.COLLATION_NAME != 'utf8mb4_unicode_ci' );";
( C.CHARACTER_SET_NAME != 'utf8' OR C.COLLATION_NAME != 'utf8_unicode_ci' );";
$collation_tables = dbFetchRows($table_collation_sql);
if (empty($collation_tables) !== true) {
$result = ValidationResult::fail('MySQL tables collation is wrong: ')
->setFix('Check https://community.librenms.org/t/new-default-database-charset-collation/14956 for info on how to fix.')
->setFix('Check http://bit.ly/2lAG9H8 for info on how to fix.')
->setList('Tables', $collation_tables);
$validator->result($result);
}
$column_collation_sql = "SELECT TABLE_NAME, COLUMN_NAME, CHARACTER_SET_NAME, COLLATION_NAME
FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '$db_name' AND
( CHARACTER_SET_NAME != 'utf8mb4' OR COLLATION_NAME != 'utf8mb4_unicode_ci' );";
( CHARACTER_SET_NAME != 'utf8' OR COLLATION_NAME != 'utf8_unicode_ci' );";
$collation_columns = dbFetchRows($column_collation_sql);
if (empty($collation_columns) !== true) {
$result = ValidationResult::fail('MySQL column collation is wrong: ')
->setFix('Check https://community.librenms.org/t/new-default-database-charset-collation/14956 for info on how to fix.')
->setFix('Check https://t.libren.ms/-zdwk for info on how to fix.')
->setList('Columns', $collation_columns);
$validator->result($result);
}

View File

@ -59,8 +59,8 @@ return [
'username' => env('DB_USERNAME', 'librenms'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
@ -78,8 +78,8 @@ return [
'username' => env('DB_TEST_USERNAME', 'root'),
'password' => env('DB_TEST_PASSWORD', ''),
'unix_socket' => env('DB_TEST_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,

View File

@ -1,81 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
class MigrateToUtf8mb4 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$this->migrateCharsetTo('utf8mb4', 'utf8mb4_unicode_ci');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->migrateCharsetTo('utf8', 'utf8_unicode_ci');
}
protected function migrateCharsetTo($charset, $collation)
{
if (\LibreNMS\DB\Eloquent::getDriver() != 'mysql') {
return;
}
$databaseName = DB::connection()->getDatabaseName();
// Change default charset and collation
DB::unprepared("ALTER SCHEMA `{$databaseName}` DEFAULT CHARACTER SET {$charset} DEFAULT COLLATE {$collation};");
// Get the list of all tables
$tableNames = DB::table('information_schema.tables')
->where('table_schema', $databaseName)
->get(['TABLE_NAME'])
->pluck('TABLE_NAME');
// Iterate through the list and alter each table
foreach ($tableNames as $tableName) {
DB::unprepared("ALTER TABLE `{$tableName}` CHARACTER SET {$charset} COLLATE {$collation};");
}
// Get the list of all columns that have a collation
$columns = DB::table('information_schema.columns')
->where('table_schema', $databaseName)
->whereNotNull('CHARACTER_SET_NAME')
->whereNotNull('COLLATION_NAME')
->where(function ($query) use ($charset, $collation) {
$query->where('CHARACTER_SET_NAME', '!=', $charset)
->orWhere('COLLATION_NAME', '!=', $collation);
})
->get();
// Iterate through the list and alter each column
foreach ($columns as $column) {
$null = $column->IS_NULLABLE == 'YES' ? 'NULL' : 'NOT NULL';
$default = null;
if (is_null($column->COLUMN_DEFAULT) || $column->COLUMN_DEFAULT == 'NULL') {
//
} else {
$default = "DEFAULT '" . trim($column->COLUMN_DEFAULT, '\'') . "'";
}
$sql = "ALTER TABLE `{$column->TABLE_NAME}`
MODIFY `{$column->COLUMN_NAME}`
{$column->COLUMN_TYPE}
CHARACTER SET {$charset}
COLLATE {$collation}
{$null} {$default};";
DB::unprepared($sql);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +1,49 @@
CREATE TABLE IF NOT EXISTS "migrations" ("id" integer not null primary key autoincrement, "migration" varchar not null, "batch" integer not null);
CREATE TABLE IF NOT EXISTS "access_points" ("accesspoint_id" integer not null primary key autoincrement, "device_id" integer not null, "name" varchar not null, "radio_number" integer, "type" varchar not null, "mac_addr" varchar not null, "deleted" tinyint(1) not null default '0', "channel" integer not null default '0', "txpow" integer not null default '0', "radioutil" integer not null default '0', "numasoclients" integer not null default '0', "nummonclients" integer not null default '0', "numactbssid" integer not null default '0', "nummonbssid" integer not null default '0', "interference" integer not null);
CREATE TABLE IF NOT EXISTS "access_points" ("accesspoint_id" integer not null primary key autoincrement, "device_id" integer not null, "name" varchar not null, "radio_number" integer null, "type" varchar not null, "mac_addr" varchar not null, "deleted" tinyint(1) not null default '0', "channel" integer not null default '0', "txpow" integer not null default '0', "radioutil" integer not null default '0', "numasoclients" integer not null default '0', "nummonclients" integer not null default '0', "numactbssid" integer not null default '0', "nummonbssid" integer not null default '0', "interference" integer not null);
CREATE INDEX "name" on "access_points" ("name", "radio_number");
CREATE INDEX "access_points_deleted_index" on "access_points" ("deleted");
CREATE TABLE IF NOT EXISTS "alert_device_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "device_id" integer not null);
CREATE UNIQUE INDEX "alert_device_map_rule_id_device_id_unique" on "alert_device_map" ("rule_id", "device_id");
CREATE TABLE IF NOT EXISTS "alert_group_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "group_id" integer not null);
CREATE UNIQUE INDEX "alert_group_map_rule_id_group_id_unique" on "alert_group_map" ("rule_id", "group_id");
CREATE TABLE IF NOT EXISTS "alert_log" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "device_id" integer not null, "state" integer not null, "details" blob, "time_logged" datetime default CURRENT_TIMESTAMP not null);
CREATE TABLE IF NOT EXISTS "alert_log" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "device_id" integer not null, "state" integer not null, "details" blob null, "time_logged" datetime default CURRENT_TIMESTAMP not null);
CREATE INDEX "alert_log_rule_id_index" on "alert_log" ("rule_id");
CREATE INDEX "alert_log_device_id_index" on "alert_log" ("device_id");
CREATE INDEX "alert_log_time_logged_index" on "alert_log" ("time_logged");
CREATE TABLE IF NOT EXISTS "alert_rules" ("id" integer not null primary key autoincrement, "rule" text not null, "severity" varchar check ("severity" in ('ok', 'warning', 'critical')) not null, "extra" varchar not null, "disabled" tinyint(1) not null, "name" varchar not null, "query" text not null, "builder" text not null, "proc" varchar, "invert_map" tinyint(1) not null default '0');
CREATE TABLE IF NOT EXISTS "alert_rules" ("id" integer not null primary key autoincrement, "rule" text not null, "severity" varchar check ("severity" in ('ok', 'warning', 'critical')) not null, "extra" varchar not null, "disabled" tinyint(1) not null, "name" varchar not null, "query" text not null, "builder" text not null, "proc" varchar null, "invert_map" tinyint(1) not null default '0');
CREATE UNIQUE INDEX "alert_rules_name_unique" on "alert_rules" ("name");
CREATE TABLE IF NOT EXISTS "alert_schedulables" ("item_id" integer not null primary key autoincrement, "schedule_id" integer not null, "alert_schedulable_id" integer not null, "alert_schedulable_type" varchar not null);
CREATE INDEX "schedulable_morph_index" on "alert_schedulables" ("alert_schedulable_type", "alert_schedulable_id");
CREATE INDEX "alert_schedulables_schedule_id_index" on "alert_schedulables" ("schedule_id");
CREATE TABLE IF NOT EXISTS "alert_template_map" ("id" integer not null primary key autoincrement, "alert_templates_id" integer not null, "alert_rule_id" integer not null);
CREATE INDEX "alert_templates_id" on "alert_template_map" ("alert_templates_id", "alert_rule_id");
CREATE TABLE IF NOT EXISTS "alert_templates" ("id" integer not null primary key autoincrement, "name" varchar not null, "template" text not null, "title" varchar, "title_rec" varchar);
CREATE TABLE IF NOT EXISTS "alert_templates" ("id" integer not null primary key autoincrement, "name" varchar not null, "template" text not null, "title" varchar null, "title_rec" varchar null);
CREATE TABLE IF NOT EXISTS "alert_transport_groups" ("transport_group_id" integer not null primary key autoincrement, "transport_group_name" varchar not null);
CREATE TABLE IF NOT EXISTS "alert_transport_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "transport_or_group_id" integer not null, "target_type" varchar not null);
CREATE TABLE IF NOT EXISTS "alert_transports" ("transport_id" integer not null primary key autoincrement, "transport_name" varchar not null, "transport_type" varchar not null default 'mail', "is_default" tinyint(1) not null default '0', "transport_config" text);
CREATE TABLE IF NOT EXISTS "alerts" ("id" integer not null primary key autoincrement, "device_id" integer not null, "rule_id" integer not null, "state" integer not null, "alerted" integer not null, "open" integer not null, "note" text, "timestamp" datetime default CURRENT_TIMESTAMP not null, "info" text not null);
CREATE TABLE IF NOT EXISTS "alert_transports" ("transport_id" integer not null primary key autoincrement, "transport_name" varchar not null, "transport_type" varchar not null default 'mail', "is_default" tinyint(1) not null default '0', "transport_config" text null);
CREATE TABLE IF NOT EXISTS "alerts" ("id" integer not null primary key autoincrement, "device_id" integer not null, "rule_id" integer not null, "state" integer not null, "alerted" integer not null, "open" integer not null, "note" text null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "info" text not null);
CREATE UNIQUE INDEX "alerts_device_id_rule_id_unique" on "alerts" ("device_id", "rule_id");
CREATE INDEX "alerts_device_id_index" on "alerts" ("device_id");
CREATE INDEX "alerts_rule_id_index" on "alerts" ("rule_id");
CREATE TABLE IF NOT EXISTS "api_tokens" ("id" integer not null primary key autoincrement, "user_id" integer not null, "token_hash" varchar, "description" varchar not null, "disabled" tinyint(1) not null default '0');
CREATE TABLE IF NOT EXISTS "api_tokens" ("id" integer not null primary key autoincrement, "user_id" integer not null, "token_hash" varchar null, "description" varchar not null, "disabled" tinyint(1) not null default '0');
CREATE UNIQUE INDEX "api_tokens_token_hash_unique" on "api_tokens" ("token_hash");
CREATE TABLE IF NOT EXISTS "applications" ("app_id" integer not null primary key autoincrement, "device_id" integer not null, "app_type" varchar not null, "app_state" varchar not null default 'UNKNOWN', "discovered" integer not null default '0', "app_state_prev" varchar, "app_status" varchar not null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "app_instance" varchar not null);
CREATE TABLE IF NOT EXISTS "applications" ("app_id" integer not null primary key autoincrement, "device_id" integer not null, "app_type" varchar not null, "app_state" varchar not null default 'UNKNOWN', "discovered" integer not null default '0', "app_state_prev" varchar null, "app_status" varchar not null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "app_instance" varchar not null);
CREATE UNIQUE INDEX "applications_device_id_app_type_unique" on "applications" ("device_id", "app_type");
CREATE TABLE IF NOT EXISTS "authlog" ("id" integer not null primary key autoincrement, "datetime" datetime default CURRENT_TIMESTAMP not null, "user" text not null, "address" text not null, "result" text not null);
CREATE TABLE IF NOT EXISTS "bgpPeers_cbgp" ("device_id" integer not null, "bgpPeerIdentifier" varchar not null, "afi" varchar not null, "safi" varchar not null, "AcceptedPrefixes" integer not null, "DeniedPrefixes" integer not null, "PrefixAdminLimit" integer not null, "PrefixThreshold" integer not null, "PrefixClearThreshold" integer not null, "AdvertisedPrefixes" integer not null, "SuppressedPrefixes" integer not null, "WithdrawnPrefixes" integer not null, "AcceptedPrefixes_delta" integer not null, "AcceptedPrefixes_prev" integer not null, "DeniedPrefixes_delta" integer not null, "DeniedPrefixes_prev" integer not null, "AdvertisedPrefixes_delta" integer not null, "AdvertisedPrefixes_prev" integer not null, "SuppressedPrefixes_delta" integer not null, "SuppressedPrefixes_prev" integer not null, "WithdrawnPrefixes_delta" integer not null, "WithdrawnPrefixes_prev" integer not null, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "bgpPeers_cbgp" ("device_id" integer not null, "bgpPeerIdentifier" varchar not null, "afi" varchar not null, "safi" varchar not null, "AcceptedPrefixes" integer not null, "DeniedPrefixes" integer not null, "PrefixAdminLimit" integer not null, "PrefixThreshold" integer not null, "PrefixClearThreshold" integer not null, "AdvertisedPrefixes" integer not null, "SuppressedPrefixes" integer not null, "WithdrawnPrefixes" integer not null, "AcceptedPrefixes_delta" integer not null, "AcceptedPrefixes_prev" integer not null, "DeniedPrefixes_delta" integer not null, "DeniedPrefixes_prev" integer not null, "AdvertisedPrefixes_delta" integer not null, "AdvertisedPrefixes_prev" integer not null, "SuppressedPrefixes_delta" integer not null, "SuppressedPrefixes_prev" integer not null, "WithdrawnPrefixes_delta" integer not null, "WithdrawnPrefixes_prev" integer not null, "context_name" varchar null);
CREATE UNIQUE INDEX "bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique" on "bgpPeers_cbgp" ("device_id", "bgpPeerIdentifier", "afi", "safi");
CREATE INDEX "bgppeers_cbgp_device_id_bgppeeridentifier_context_name_index" on "bgpPeers_cbgp" ("device_id", "bgpPeerIdentifier", "context_name");
CREATE TABLE IF NOT EXISTS "bgpPeers" ("bgpPeer_id" integer not null primary key autoincrement, "device_id" integer not null, "astext" varchar not null, "bgpPeerIdentifier" text not null, "bgpPeerRemoteAs" integer not null, "bgpPeerState" text not null, "bgpPeerAdminStatus" text not null, "bgpLocalAddr" text not null, "bgpPeerRemoteAddr" text not null, "bgpPeerDescr" varchar not null default '', "bgpPeerInUpdates" integer not null, "bgpPeerOutUpdates" integer not null, "bgpPeerInTotalMessages" integer not null, "bgpPeerOutTotalMessages" integer not null, "bgpPeerFsmEstablishedTime" integer not null, "bgpPeerInUpdateElapsedTime" integer not null, "context_name" varchar, "vrf_id" integer, "bgpPeerLastErrorCode" integer, "bgpPeerLastErrorSubCode" integer, "bgpPeerLastErrorText" varchar);
CREATE TABLE IF NOT EXISTS "bgpPeers" ("bgpPeer_id" integer not null primary key autoincrement, "device_id" integer not null, "astext" varchar not null, "bgpPeerIdentifier" text not null, "bgpPeerRemoteAs" integer not null, "bgpPeerState" text not null, "bgpPeerAdminStatus" text not null, "bgpLocalAddr" text not null, "bgpPeerRemoteAddr" text not null, "bgpPeerDescr" varchar not null default '', "bgpPeerInUpdates" integer not null, "bgpPeerOutUpdates" integer not null, "bgpPeerInTotalMessages" integer not null, "bgpPeerOutTotalMessages" integer not null, "bgpPeerFsmEstablishedTime" integer not null, "bgpPeerInUpdateElapsedTime" integer not null, "context_name" varchar null, "vrf_id" integer null, "bgpPeerLastErrorCode" integer null, "bgpPeerLastErrorSubCode" integer null, "bgpPeerLastErrorText" varchar null);
CREATE INDEX "bgppeers_device_id_context_name_index" on "bgpPeers" ("device_id", "context_name");
CREATE TABLE IF NOT EXISTS "bill_data" ("bill_id" integer not null, "timestamp" datetime not null, "period" integer not null, "delta" integer not null, "in_delta" integer not null, "out_delta" integer not null, primary key ("bill_id", "timestamp"));
CREATE INDEX "bill_data_bill_id_index" on "bill_data" ("bill_id");
CREATE TABLE IF NOT EXISTS "bill_history" ("bill_hist_id" integer not null primary key autoincrement, "bill_id" integer not null, "updated" datetime default CURRENT_TIMESTAMP not null, "bill_datefrom" datetime not null, "bill_dateto" datetime not null, "bill_type" text not null, "bill_allowed" integer not null, "bill_used" integer not null, "bill_overuse" integer not null, "bill_percent" numeric not null, "rate_95th_in" integer not null, "rate_95th_out" integer not null, "rate_95th" integer not null, "dir_95th" varchar not null, "rate_average" integer not null, "rate_average_in" integer not null, "rate_average_out" integer not null, "traf_in" integer not null, "traf_out" integer not null, "traf_total" integer not null, "pdf" blob);
CREATE TABLE IF NOT EXISTS "bill_history" ("bill_hist_id" integer not null primary key autoincrement, "bill_id" integer not null, "updated" datetime default CURRENT_TIMESTAMP not null, "bill_datefrom" datetime not null, "bill_dateto" datetime not null, "bill_type" text not null, "bill_allowed" integer not null, "bill_used" integer not null, "bill_overuse" integer not null, "bill_percent" numeric not null, "rate_95th_in" integer not null, "rate_95th_out" integer not null, "rate_95th" integer not null, "dir_95th" varchar not null, "rate_average" integer not null, "rate_average_in" integer not null, "rate_average_out" integer not null, "traf_in" integer not null, "traf_out" integer not null, "traf_total" integer not null, "pdf" blob null);
CREATE UNIQUE INDEX "bill_history_bill_id_bill_datefrom_bill_dateto_unique" on "bill_history" ("bill_id", "bill_datefrom", "bill_dateto");
CREATE INDEX "bill_history_bill_id_index" on "bill_history" ("bill_id");
CREATE TABLE IF NOT EXISTS "bill_perms" ("id" integer not null primary key autoincrement, "user_id" integer not null, "bill_id" integer not null);
CREATE TABLE IF NOT EXISTS "bill_port_counters" ("port_id" integer not null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "in_counter" integer, "in_delta" integer not null default '0', "out_counter" integer, "out_delta" integer not null default '0', "bill_id" integer not null, primary key ("port_id", "bill_id"));
CREATE TABLE IF NOT EXISTS "bill_port_counters" ("port_id" integer not null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "in_counter" integer null, "in_delta" integer not null default '0', "out_counter" integer null, "out_delta" integer not null default '0', "bill_id" integer not null, primary key ("port_id", "bill_id"));
CREATE TABLE IF NOT EXISTS "bill_ports" ("id" integer not null primary key autoincrement, "bill_id" integer not null, "port_id" integer not null, "bill_port_autoadded" tinyint(1) not null default '0');
CREATE TABLE IF NOT EXISTS "bills" ("bill_id" integer not null primary key autoincrement, "bill_name" text not null, "bill_type" text not null, "bill_cdr" integer, "bill_day" integer not null default '1', "bill_quota" integer, "rate_95th_in" integer not null, "rate_95th_out" integer not null, "rate_95th" integer not null, "dir_95th" varchar not null, "total_data" integer not null, "total_data_in" integer not null, "total_data_out" integer not null, "rate_average_in" integer not null, "rate_average_out" integer not null, "rate_average" integer not null, "bill_last_calc" datetime not null, "bill_custid" varchar not null, "bill_ref" varchar not null, "bill_notes" varchar not null, "bill_autoadded" tinyint(1) not null);
CREATE TABLE IF NOT EXISTS "bills" ("bill_id" integer not null primary key autoincrement, "bill_name" text not null, "bill_type" text not null, "bill_cdr" integer null, "bill_day" integer not null default '1', "bill_quota" integer null, "rate_95th_in" integer not null, "rate_95th_out" integer not null, "rate_95th" integer not null, "dir_95th" varchar not null, "total_data" integer not null, "total_data_in" integer not null, "total_data_out" integer not null, "rate_average_in" integer not null, "rate_average_out" integer not null, "rate_average" integer not null, "bill_last_calc" datetime not null, "bill_custid" varchar not null, "bill_ref" varchar not null, "bill_notes" varchar not null, "bill_autoadded" tinyint(1) not null);
CREATE TABLE IF NOT EXISTS "callback" ("callback_id" integer not null primary key autoincrement, "name" varchar not null, "value" varchar not null);
CREATE TABLE IF NOT EXISTS "cef_switching" ("cef_switching_id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" integer not null, "afi" varchar not null, "cef_index" integer not null, "cef_path" varchar not null, "drop" integer not null, "punt" integer not null, "punt2host" integer not null, "drop_prev" integer not null, "punt_prev" integer not null, "punt2host_prev" integer not null, "updated" integer not null, "updated_prev" integer not null);
CREATE UNIQUE INDEX "cef_switching_device_id_entphysicalindex_afi_cef_index_unique" on "cef_switching" ("device_id", "entPhysicalIndex", "afi", "cef_index");
@ -51,21 +51,21 @@ CREATE TABLE IF NOT EXISTS "ciscoASA" ("ciscoASA_id" integer not null primary ke
CREATE INDEX "ciscoasa_device_id_index" on "ciscoASA" ("device_id");
CREATE TABLE IF NOT EXISTS "component_prefs" ("id" integer not null primary key autoincrement, "component" integer not null, "attribute" varchar not null, "value" text not null);
CREATE INDEX "component_prefs_component_index" on "component_prefs" ("component");
CREATE TABLE IF NOT EXISTS "component_statuslog" ("id" integer not null primary key autoincrement, "component_id" integer not null, "status" tinyint(1) not null default '0', "message" text, "timestamp" datetime default CURRENT_TIMESTAMP not null);
CREATE TABLE IF NOT EXISTS "component_statuslog" ("id" integer not null primary key autoincrement, "component_id" integer not null, "status" tinyint(1) not null default '0', "message" text null, "timestamp" datetime default CURRENT_TIMESTAMP not null);
CREATE INDEX "component_statuslog_component_id_index" on "component_statuslog" ("component_id");
CREATE TABLE IF NOT EXISTS "component" ("id" integer not null primary key autoincrement, "device_id" integer not null, "type" varchar not null, "label" varchar, "status" tinyint(1) not null default '0', "disabled" tinyint(1) not null default '0', "ignore" tinyint(1) not null default '0', "error" varchar);
CREATE TABLE IF NOT EXISTS "component" ("id" integer not null primary key autoincrement, "device_id" integer not null, "type" varchar not null, "label" varchar null, "status" tinyint(1) not null default '0', "disabled" tinyint(1) not null default '0', "ignore" tinyint(1) not null default '0', "error" varchar null);
CREATE INDEX "component_device_id_index" on "component" ("device_id");
CREATE INDEX "component_type_index" on "component" ("type");
CREATE TABLE IF NOT EXISTS "customers" ("customer_id" integer not null primary key autoincrement, "username" varchar not null, "password" varchar not null, "string" varchar not null, "level" integer not null default '0');
CREATE UNIQUE INDEX "customers_username_unique" on "customers" ("username");
CREATE TABLE IF NOT EXISTS "dashboards" ("dashboard_id" integer not null primary key autoincrement, "user_id" integer not null default '0', "dashboard_name" varchar not null, "access" tinyint(1) not null default '0');
CREATE TABLE IF NOT EXISTS "dbSchema" ("version" integer not null default '0', primary key ("version"));
CREATE TABLE IF NOT EXISTS "device_graphs" ("id" integer not null primary key autoincrement, "device_id" integer not null, "graph" varchar);
CREATE TABLE IF NOT EXISTS "device_graphs" ("id" integer not null primary key autoincrement, "device_id" integer not null, "graph" varchar null);
CREATE INDEX "device_graphs_device_id_index" on "device_graphs" ("device_id");
CREATE TABLE IF NOT EXISTS "device_group_device" ("device_group_id" integer not null, "device_id" integer not null, primary key ("device_group_id", "device_id"));
CREATE INDEX "device_group_device_device_group_id_index" on "device_group_device" ("device_group_id");
CREATE INDEX "device_group_device_device_id_index" on "device_group_device" ("device_id");
CREATE TABLE IF NOT EXISTS "device_perf" ("id" integer not null primary key autoincrement, "device_id" integer not null, "timestamp" datetime not null, "xmt" integer not null, "rcv" integer not null, "loss" integer not null, "min" float not null, "max" float not null, "avg" float not null, "debug" text);
CREATE TABLE IF NOT EXISTS "device_perf" ("id" integer not null primary key autoincrement, "device_id" integer not null, "timestamp" datetime not null, "xmt" integer not null, "rcv" integer not null, "loss" integer not null, "min" float not null, "max" float not null, "avg" float not null, "debug" text null);
CREATE INDEX "device_perf_device_id_index" on "device_perf" ("device_id");
CREATE TABLE IF NOT EXISTS "device_relationships" ("parent_device_id" integer not null default '0', "child_device_id" integer not null, primary key ("parent_device_id", "child_device_id"));
CREATE INDEX "device_relationships_child_device_id_index" on "device_relationships" ("child_device_id");
@ -73,82 +73,82 @@ CREATE TABLE IF NOT EXISTS "devices_attribs" ("attrib_id" integer not null prima
CREATE INDEX "devices_attribs_device_id_index" on "devices_attribs" ("device_id");
CREATE TABLE IF NOT EXISTS "devices_perms" ("id" integer not null primary key autoincrement, "user_id" integer not null, "device_id" integer not null);
CREATE INDEX "devices_perms_user_id_index" on "devices_perms" ("user_id");
CREATE TABLE IF NOT EXISTS "entPhysical_state" ("id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" varchar not null, "subindex" varchar, "group" varchar not null, "key" varchar not null, "value" varchar not null);
CREATE TABLE IF NOT EXISTS "entPhysical_state" ("id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" varchar not null, "subindex" varchar null, "group" varchar not null, "key" varchar not null, "value" varchar not null);
CREATE INDEX "device_id_index" on "entPhysical_state" ("device_id", "entPhysicalIndex");
CREATE TABLE IF NOT EXISTS "entPhysical" ("entPhysical_id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" integer not null, "entPhysicalDescr" text not null, "entPhysicalClass" text not null, "entPhysicalName" text not null, "entPhysicalHardwareRev" varchar, "entPhysicalFirmwareRev" varchar, "entPhysicalSoftwareRev" varchar, "entPhysicalAlias" varchar, "entPhysicalAssetID" varchar, "entPhysicalIsFRU" varchar, "entPhysicalModelName" text not null, "entPhysicalVendorType" text, "entPhysicalSerialNum" text not null, "entPhysicalContainedIn" integer not null, "entPhysicalParentRelPos" integer not null, "entPhysicalMfgName" text not null, "ifIndex" integer);
CREATE TABLE IF NOT EXISTS "entPhysical" ("entPhysical_id" integer not null primary key autoincrement, "device_id" integer not null, "entPhysicalIndex" integer not null, "entPhysicalDescr" text not null, "entPhysicalClass" text not null, "entPhysicalName" text not null, "entPhysicalHardwareRev" varchar null, "entPhysicalFirmwareRev" varchar null, "entPhysicalSoftwareRev" varchar null, "entPhysicalAlias" varchar null, "entPhysicalAssetID" varchar null, "entPhysicalIsFRU" varchar null, "entPhysicalModelName" text not null, "entPhysicalVendorType" text null, "entPhysicalSerialNum" text not null, "entPhysicalContainedIn" integer not null, "entPhysicalParentRelPos" integer not null, "entPhysicalMfgName" text not null, "ifIndex" integer null);
CREATE INDEX "entphysical_device_id_index" on "entPhysical" ("device_id");
CREATE TABLE IF NOT EXISTS "entityState" ("entity_state_id" integer not null primary key autoincrement, "device_id" integer, "entPhysical_id" integer, "entStateLastChanged" datetime, "entStateAdmin" integer, "entStateOper" integer, "entStateUsage" integer, "entStateAlarm" text, "entStateStandby" integer);
CREATE TABLE IF NOT EXISTS "entityState" ("entity_state_id" integer not null primary key autoincrement, "device_id" integer null, "entPhysical_id" integer null, "entStateLastChanged" datetime null, "entStateAdmin" integer null, "entStateOper" integer null, "entStateUsage" integer null, "entStateAlarm" text null, "entStateStandby" integer null);
CREATE INDEX "entitystate_device_id_index" on "entityState" ("device_id");
CREATE TABLE IF NOT EXISTS "eventlog" ("event_id" integer not null primary key autoincrement, "device_id" integer, "datetime" datetime not null default '1970-01-02 00:00:01', "message" text, "type" varchar, "reference" varchar, "username" varchar, "severity" integer not null default '2');
CREATE TABLE IF NOT EXISTS "eventlog" ("event_id" integer not null primary key autoincrement, "device_id" integer null, "datetime" datetime not null default '1970-01-02 00:00:01', "message" text null, "type" varchar null, "reference" varchar null, "username" varchar null, "severity" integer not null default '2');
CREATE INDEX "eventlog_device_id_index" on "eventlog" ("device_id");
CREATE INDEX "eventlog_datetime_index" on "eventlog" ("datetime");
CREATE TABLE IF NOT EXISTS "graph_types" ("graph_type" varchar not null, "graph_subtype" varchar not null, "graph_section" varchar not null, "graph_descr" varchar, "graph_order" integer not null, primary key ("graph_type", "graph_subtype", "graph_section"));
CREATE TABLE IF NOT EXISTS "graph_types" ("graph_type" varchar not null, "graph_subtype" varchar not null, "graph_section" varchar not null, "graph_descr" varchar null, "graph_order" integer not null, primary key ("graph_type", "graph_subtype", "graph_section"));
CREATE INDEX "graph_types_graph_type_index" on "graph_types" ("graph_type");
CREATE INDEX "graph_types_graph_subtype_index" on "graph_types" ("graph_subtype");
CREATE INDEX "graph_types_graph_section_index" on "graph_types" ("graph_section");
CREATE TABLE IF NOT EXISTS "hrDevice" ("hrDevice_id" integer not null primary key autoincrement, "device_id" integer not null, "hrDeviceIndex" integer not null, "hrDeviceDescr" text not null, "hrDeviceType" text not null, "hrDeviceErrors" integer not null default '0', "hrDeviceStatus" text not null, "hrProcessorLoad" integer);
CREATE TABLE IF NOT EXISTS "hrDevice" ("hrDevice_id" integer not null primary key autoincrement, "device_id" integer not null, "hrDeviceIndex" integer not null, "hrDeviceDescr" text not null, "hrDeviceType" text not null, "hrDeviceErrors" integer not null default '0', "hrDeviceStatus" text not null, "hrProcessorLoad" integer null);
CREATE INDEX "hrdevice_device_id_index" on "hrDevice" ("device_id");
CREATE TABLE IF NOT EXISTS "ipsec_tunnels" ("tunnel_id" integer not null primary key autoincrement, "device_id" integer not null, "peer_port" integer not null, "peer_addr" varchar not null, "local_addr" varchar not null, "local_port" integer not null, "tunnel_name" varchar not null, "tunnel_status" varchar not null);
CREATE UNIQUE INDEX "ipsec_tunnels_device_id_peer_addr_unique" on "ipsec_tunnels" ("device_id", "peer_addr");
CREATE TABLE IF NOT EXISTS "ipv4_addresses" ("ipv4_address_id" integer not null primary key autoincrement, "ipv4_address" varchar not null, "ipv4_prefixlen" integer not null, "ipv4_network_id" varchar not null, "port_id" integer not null, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "ipv4_addresses" ("ipv4_address_id" integer not null primary key autoincrement, "ipv4_address" varchar not null, "ipv4_prefixlen" integer not null, "ipv4_network_id" varchar not null, "port_id" integer not null, "context_name" varchar null);
CREATE INDEX "ipv4_addresses_port_id_index" on "ipv4_addresses" ("port_id");
CREATE TABLE IF NOT EXISTS "ipv4_mac" ("id" integer not null primary key autoincrement, "port_id" integer not null, "device_id" integer, "mac_address" varchar not null, "ipv4_address" varchar not null, "context_name" varchar not null);
CREATE TABLE IF NOT EXISTS "ipv4_mac" ("id" integer not null primary key autoincrement, "port_id" integer not null, "device_id" integer null, "mac_address" varchar not null, "ipv4_address" varchar not null, "context_name" varchar not null);
CREATE INDEX "ipv4_mac_port_id_index" on "ipv4_mac" ("port_id");
CREATE INDEX "ipv4_mac_mac_address_index" on "ipv4_mac" ("mac_address");
CREATE TABLE IF NOT EXISTS "ipv4_networks" ("ipv4_network_id" integer not null primary key autoincrement, "ipv4_network" varchar not null, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "ipv6_addresses" ("ipv6_address_id" integer not null primary key autoincrement, "ipv6_address" varchar not null, "ipv6_compressed" varchar not null, "ipv6_prefixlen" integer not null, "ipv6_origin" varchar not null, "ipv6_network_id" varchar not null, "port_id" integer not null, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "ipv4_networks" ("ipv4_network_id" integer not null primary key autoincrement, "ipv4_network" varchar not null, "context_name" varchar null);
CREATE TABLE IF NOT EXISTS "ipv6_addresses" ("ipv6_address_id" integer not null primary key autoincrement, "ipv6_address" varchar not null, "ipv6_compressed" varchar not null, "ipv6_prefixlen" integer not null, "ipv6_origin" varchar not null, "ipv6_network_id" varchar not null, "port_id" integer not null, "context_name" varchar null);
CREATE INDEX "ipv6_addresses_port_id_index" on "ipv6_addresses" ("port_id");
CREATE TABLE IF NOT EXISTS "ipv6_networks" ("ipv6_network_id" integer not null primary key autoincrement, "ipv6_network" varchar not null, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "ipv6_networks" ("ipv6_network_id" integer not null primary key autoincrement, "ipv6_network" varchar not null, "context_name" varchar null);
CREATE TABLE IF NOT EXISTS "juniAtmVp" ("id" integer not null primary key autoincrement, "juniAtmVp_id" integer not null, "port_id" integer not null, "vp_id" integer not null, "vp_descr" varchar not null);
CREATE INDEX "juniatmvp_port_id_index" on "juniAtmVp" ("port_id");
CREATE TABLE IF NOT EXISTS "links" ("id" integer not null primary key autoincrement, "local_port_id" integer, "local_device_id" integer not null, "remote_port_id" integer, "active" tinyint(1) not null default '1', "protocol" varchar, "remote_hostname" varchar not null, "remote_device_id" integer not null, "remote_port" varchar not null, "remote_platform" varchar, "remote_version" varchar not null);
CREATE TABLE IF NOT EXISTS "links" ("id" integer not null primary key autoincrement, "local_port_id" integer null, "local_device_id" integer not null, "remote_port_id" integer null, "active" tinyint(1) not null default '1', "protocol" varchar null, "remote_hostname" varchar not null, "remote_device_id" integer not null, "remote_port" varchar not null, "remote_platform" varchar null, "remote_version" varchar not null);
CREATE INDEX "local_device_id" on "links" ("local_device_id", "remote_device_id");
CREATE INDEX "links_local_port_id_index" on "links" ("local_port_id");
CREATE INDEX "links_remote_port_id_index" on "links" ("remote_port_id");
CREATE TABLE IF NOT EXISTS "loadbalancer_rservers" ("rserver_id" integer not null primary key autoincrement, "farm_id" varchar not null, "device_id" integer not null, "StateDescr" varchar not null);
CREATE TABLE IF NOT EXISTS "loadbalancer_vservers" ("id" integer not null primary key autoincrement, "classmap_id" integer not null, "classmap" varchar not null, "serverstate" varchar not null, "device_id" integer not null);
CREATE INDEX "loadbalancer_vservers_device_id_index" on "loadbalancer_vservers" ("device_id");
CREATE TABLE IF NOT EXISTS "locations" ("id" integer not null primary key autoincrement, "location" varchar not null, "lat" float, "lng" float, "timestamp" datetime not null);
CREATE TABLE IF NOT EXISTS "locations" ("id" integer not null primary key autoincrement, "location" varchar not null, "lat" float null, "lng" float null, "timestamp" datetime not null);
CREATE UNIQUE INDEX "locations_location_unique" on "locations" ("location");
CREATE TABLE IF NOT EXISTS "mac_accounting" ("ma_id" integer not null primary key autoincrement, "port_id" integer not null, "mac" varchar not null, "in_oid" varchar not null, "out_oid" varchar not null, "bps_out" integer not null, "bps_in" integer not null, "cipMacHCSwitchedBytes_input" integer, "cipMacHCSwitchedBytes_input_prev" integer, "cipMacHCSwitchedBytes_input_delta" integer, "cipMacHCSwitchedBytes_input_rate" integer, "cipMacHCSwitchedBytes_output" integer, "cipMacHCSwitchedBytes_output_prev" integer, "cipMacHCSwitchedBytes_output_delta" integer, "cipMacHCSwitchedBytes_output_rate" integer, "cipMacHCSwitchedPkts_input" integer, "cipMacHCSwitchedPkts_input_prev" integer, "cipMacHCSwitchedPkts_input_delta" integer, "cipMacHCSwitchedPkts_input_rate" integer, "cipMacHCSwitchedPkts_output" integer, "cipMacHCSwitchedPkts_output_prev" integer, "cipMacHCSwitchedPkts_output_delta" integer, "cipMacHCSwitchedPkts_output_rate" integer, "poll_time" integer, "poll_prev" integer, "poll_period" integer);
CREATE TABLE IF NOT EXISTS "mac_accounting" ("ma_id" integer not null primary key autoincrement, "port_id" integer not null, "mac" varchar not null, "in_oid" varchar not null, "out_oid" varchar not null, "bps_out" integer not null, "bps_in" integer not null, "cipMacHCSwitchedBytes_input" integer null, "cipMacHCSwitchedBytes_input_prev" integer null, "cipMacHCSwitchedBytes_input_delta" integer null, "cipMacHCSwitchedBytes_input_rate" integer null, "cipMacHCSwitchedBytes_output" integer null, "cipMacHCSwitchedBytes_output_prev" integer null, "cipMacHCSwitchedBytes_output_delta" integer null, "cipMacHCSwitchedBytes_output_rate" integer null, "cipMacHCSwitchedPkts_input" integer null, "cipMacHCSwitchedPkts_input_prev" integer null, "cipMacHCSwitchedPkts_input_delta" integer null, "cipMacHCSwitchedPkts_input_rate" integer null, "cipMacHCSwitchedPkts_output" integer null, "cipMacHCSwitchedPkts_output_prev" integer null, "cipMacHCSwitchedPkts_output_delta" integer null, "cipMacHCSwitchedPkts_output_rate" integer null, "poll_time" integer null, "poll_prev" integer null, "poll_period" integer null);
CREATE INDEX "mac_accounting_port_id_index" on "mac_accounting" ("port_id");
CREATE TABLE IF NOT EXISTS "mefinfo" ("id" integer not null primary key autoincrement, "device_id" integer not null, "mefID" integer not null, "mefType" varchar not null, "mefIdent" varchar not null, "mefMTU" integer not null default '1500', "mefAdmState" varchar not null, "mefRowState" varchar not null);
CREATE INDEX "mefinfo_device_id_index" on "mefinfo" ("device_id");
CREATE INDEX "mefinfo_mefid_index" on "mefinfo" ("mefID");
CREATE TABLE IF NOT EXISTS "munin_plugins_ds" ("mplug_id" integer not null, "ds_name" varchar not null, "ds_type" varchar check ("ds_type" in ('COUNTER', 'ABSOLUTE', 'DERIVE', 'GAUGE')) not null default 'GAUGE', "ds_label" varchar not null, "ds_cdef" varchar not null, "ds_draw" varchar not null, "ds_graph" varchar check ("ds_graph" in ('no', 'yes')) not null default 'yes', "ds_info" varchar not null, "ds_extinfo" text not null, "ds_max" varchar not null, "ds_min" varchar not null, "ds_negative" varchar not null, "ds_warning" varchar not null, "ds_critical" varchar not null, "ds_colour" varchar not null, "ds_sum" text not null, "ds_stack" text not null, "ds_line" varchar not null);
CREATE UNIQUE INDEX "munin_plugins_ds_mplug_id_ds_name_unique" on "munin_plugins_ds" ("mplug_id", "ds_name");
CREATE TABLE IF NOT EXISTS "munin_plugins" ("mplug_id" integer not null primary key autoincrement, "device_id" integer not null, "mplug_type" varchar not null, "mplug_instance" varchar, "mplug_category" varchar, "mplug_title" varchar, "mplug_info" text, "mplug_vlabel" varchar, "mplug_args" varchar, "mplug_total" tinyint(1) not null default '0', "mplug_graph" tinyint(1) not null default '1');
CREATE TABLE IF NOT EXISTS "munin_plugins" ("mplug_id" integer not null primary key autoincrement, "device_id" integer not null, "mplug_type" varchar not null, "mplug_instance" varchar null, "mplug_category" varchar null, "mplug_title" varchar null, "mplug_info" text null, "mplug_vlabel" varchar null, "mplug_args" varchar null, "mplug_total" tinyint(1) not null default '0', "mplug_graph" tinyint(1) not null default '1');
CREATE UNIQUE INDEX "munin_plugins_device_id_mplug_type_unique" on "munin_plugins" ("device_id", "mplug_type");
CREATE INDEX "munin_plugins_device_id_index" on "munin_plugins" ("device_id");
CREATE TABLE IF NOT EXISTS "netscaler_vservers" ("vsvr_id" integer not null primary key autoincrement, "device_id" integer not null, "vsvr_name" varchar not null, "vsvr_ip" varchar not null, "vsvr_port" integer not null, "vsvr_type" varchar not null, "vsvr_state" varchar not null, "vsvr_clients" integer not null, "vsvr_server" integer not null, "vsvr_req_rate" integer not null, "vsvr_bps_in" integer not null, "vsvr_bps_out" integer not null);
CREATE TABLE IF NOT EXISTS "notifications_attribs" ("attrib_id" integer not null primary key autoincrement, "notifications_id" integer not null, "user_id" integer not null, "key" varchar not null default '', "value" varchar not null default '');
CREATE TABLE IF NOT EXISTS "notifications" ("notifications_id" integer not null primary key autoincrement, "title" varchar not null default '', "body" text not null, "severity" integer default '0', "source" varchar not null default '', "checksum" varchar not null, "datetime" datetime not null default '1970-01-02 00:00:00');
CREATE TABLE IF NOT EXISTS "notifications" ("notifications_id" integer not null primary key autoincrement, "title" varchar not null default '', "body" text not null, "severity" integer null default '0', "source" varchar not null default '', "checksum" varchar not null, "datetime" datetime not null default '1970-01-02 00:00:00');
CREATE INDEX "notifications_severity_index" on "notifications" ("severity");
CREATE UNIQUE INDEX "notifications_checksum_unique" on "notifications" ("checksum");
CREATE TABLE IF NOT EXISTS "ospf_instances" ("id" integer not null primary key autoincrement, "device_id" integer not null, "ospf_instance_id" integer not null, "ospfRouterId" varchar not null, "ospfAdminStat" varchar not null, "ospfVersionNumber" varchar not null, "ospfAreaBdrRtrStatus" varchar not null, "ospfASBdrRtrStatus" varchar not null, "ospfExternLsaCount" integer not null, "ospfExternLsaCksumSum" integer not null, "ospfTOSSupport" varchar not null, "ospfOriginateNewLsas" integer not null, "ospfRxNewLsas" integer not null, "ospfExtLsdbLimit" integer, "ospfMulticastExtensions" integer, "ospfExitOverflowInterval" integer, "ospfDemandExtensions" varchar, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "ospf_instances" ("id" integer not null primary key autoincrement, "device_id" integer not null, "ospf_instance_id" integer not null, "ospfRouterId" varchar not null, "ospfAdminStat" varchar not null, "ospfVersionNumber" varchar not null, "ospfAreaBdrRtrStatus" varchar not null, "ospfASBdrRtrStatus" varchar not null, "ospfExternLsaCount" integer not null, "ospfExternLsaCksumSum" integer not null, "ospfTOSSupport" varchar not null, "ospfOriginateNewLsas" integer not null, "ospfRxNewLsas" integer not null, "ospfExtLsdbLimit" integer null, "ospfMulticastExtensions" integer null, "ospfExitOverflowInterval" integer null, "ospfDemandExtensions" varchar null, "context_name" varchar null);
CREATE UNIQUE INDEX "ospf_instances_device_id_ospf_instance_id_context_name_unique" on "ospf_instances" ("device_id", "ospf_instance_id", "context_name");
CREATE TABLE IF NOT EXISTS "ospf_nbrs" ("id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer, "ospf_nbr_id" varchar not null, "ospfNbrIpAddr" varchar not null, "ospfNbrAddressLessIndex" integer not null, "ospfNbrRtrId" varchar not null, "ospfNbrOptions" integer not null, "ospfNbrPriority" integer not null, "ospfNbrState" varchar not null, "ospfNbrEvents" integer not null, "ospfNbrLsRetransQLen" integer not null, "ospfNbmaNbrStatus" varchar not null, "ospfNbmaNbrPermanence" varchar not null, "ospfNbrHelloSuppressed" varchar not null, "context_name" varchar);
CREATE TABLE IF NOT EXISTS "ospf_nbrs" ("id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer null, "ospf_nbr_id" varchar not null, "ospfNbrIpAddr" varchar not null, "ospfNbrAddressLessIndex" integer not null, "ospfNbrRtrId" varchar not null, "ospfNbrOptions" integer not null, "ospfNbrPriority" integer not null, "ospfNbrState" varchar not null, "ospfNbrEvents" integer not null, "ospfNbrLsRetransQLen" integer not null, "ospfNbmaNbrStatus" varchar not null, "ospfNbmaNbrPermanence" varchar not null, "ospfNbrHelloSuppressed" varchar not null, "context_name" varchar null);
CREATE UNIQUE INDEX "ospf_nbrs_device_id_ospf_nbr_id_context_name_unique" on "ospf_nbrs" ("device_id", "ospf_nbr_id", "context_name");
CREATE TABLE IF NOT EXISTS "ospf_ports" ("id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "ospf_port_id" varchar not null, "ospfIfIpAddress" varchar not null, "ospfAddressLessIf" integer not null, "ospfIfAreaId" varchar not null, "ospfIfType" varchar, "ospfIfAdminStat" varchar, "ospfIfRtrPriority" integer, "ospfIfTransitDelay" integer, "ospfIfRetransInterval" integer, "ospfIfHelloInterval" integer, "ospfIfRtrDeadInterval" integer, "ospfIfPollInterval" integer, "ospfIfState" varchar, "ospfIfDesignatedRouter" varchar, "ospfIfBackupDesignatedRouter" varchar, "ospfIfEvents" integer, "ospfIfAuthKey" varchar, "ospfIfStatus" varchar, "ospfIfMulticastForwarding" varchar, "ospfIfDemand" varchar, "ospfIfAuthType" varchar, "context_name" varchar, "ospfIfMetricIpAddress" varchar, "ospfIfMetricAddressLessIf" integer, "ospfIfMetricTOS" integer, "ospfIfMetricValue" integer, "ospfIfMetricStatus" varchar);
CREATE TABLE IF NOT EXISTS "ospf_ports" ("id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "ospf_port_id" varchar not null, "ospfIfIpAddress" varchar not null, "ospfAddressLessIf" integer not null, "ospfIfAreaId" varchar not null, "ospfIfType" varchar null, "ospfIfAdminStat" varchar null, "ospfIfRtrPriority" integer null, "ospfIfTransitDelay" integer null, "ospfIfRetransInterval" integer null, "ospfIfHelloInterval" integer null, "ospfIfRtrDeadInterval" integer null, "ospfIfPollInterval" integer null, "ospfIfState" varchar null, "ospfIfDesignatedRouter" varchar null, "ospfIfBackupDesignatedRouter" varchar null, "ospfIfEvents" integer null, "ospfIfAuthKey" varchar null, "ospfIfStatus" varchar null, "ospfIfMulticastForwarding" varchar null, "ospfIfDemand" varchar null, "ospfIfAuthType" varchar null, "context_name" varchar null);
CREATE UNIQUE INDEX "ospf_ports_device_id_ospf_port_id_context_name_unique" on "ospf_ports" ("device_id", "ospf_port_id", "context_name");
CREATE TABLE IF NOT EXISTS "packages" ("pkg_id" integer not null primary key autoincrement, "device_id" integer not null, "name" varchar not null, "manager" varchar not null default '1', "status" tinyint(1) not null, "version" varchar not null, "build" varchar not null, "arch" varchar not null, "size" integer);
CREATE TABLE IF NOT EXISTS "packages" ("pkg_id" integer not null primary key autoincrement, "device_id" integer not null, "name" varchar not null, "manager" varchar not null default '1', "status" tinyint(1) not null, "version" varchar not null, "build" varchar not null, "arch" varchar not null, "size" integer null);
CREATE UNIQUE INDEX "packages_device_id_name_manager_arch_version_build_unique" on "packages" ("device_id", "name", "manager", "arch", "version", "build");
CREATE INDEX "packages_device_id_index" on "packages" ("device_id");
CREATE TABLE IF NOT EXISTS "pdb_ix_peers" ("pdb_ix_peers_id" integer not null primary key autoincrement, "ix_id" integer not null, "peer_id" integer not null, "remote_asn" integer not null, "remote_ipaddr4" varchar, "remote_ipaddr6" varchar, "name" varchar, "timestamp" integer);
CREATE TABLE IF NOT EXISTS "pdb_ix_peers" ("pdb_ix_peers_id" integer not null primary key autoincrement, "ix_id" integer not null, "peer_id" integer not null, "remote_asn" integer not null, "remote_ipaddr4" varchar null, "remote_ipaddr6" varchar null, "name" varchar null, "timestamp" integer null);
CREATE TABLE IF NOT EXISTS "pdb_ix" ("pdb_ix_id" integer not null primary key autoincrement, "ix_id" integer not null, "name" varchar not null, "asn" integer not null, "timestamp" integer not null);
CREATE TABLE IF NOT EXISTS "perf_times" ("id" integer not null primary key autoincrement, "type" varchar not null, "doing" varchar not null, "start" integer not null, "duration" float not null, "devices" integer not null, "poller" varchar not null);
CREATE INDEX "perf_times_type_index" on "perf_times" ("type");
CREATE TABLE IF NOT EXISTS "plugins" ("plugin_id" integer not null primary key autoincrement, "plugin_name" varchar not null, "plugin_active" integer not null);
CREATE TABLE IF NOT EXISTS "poller_cluster_stats" ("id" integer not null primary key autoincrement, "parent_poller" integer not null default '0', "poller_type" varchar not null default '', "depth" integer not null, "devices" integer not null, "worker_seconds" float not null, "workers" integer not null, "frequency" integer not null);
CREATE UNIQUE INDEX "poller_cluster_stats_parent_poller_poller_type_unique" on "poller_cluster_stats" ("parent_poller", "poller_type");
CREATE TABLE IF NOT EXISTS "poller_cluster" ("id" integer not null primary key autoincrement, "node_id" varchar not null, "poller_name" varchar not null, "poller_version" varchar not null default '', "poller_groups" varchar not null default '', "last_report" datetime not null, "master" tinyint(1) not null, "poller_enabled" tinyint(1), "poller_frequency" integer, "poller_workers" integer, "poller_down_retry" integer, "discovery_enabled" tinyint(1), "discovery_frequency" integer, "discovery_workers" integer, "services_enabled" tinyint(1), "services_frequency" integer, "services_workers" integer, "billing_enabled" tinyint(1), "billing_frequency" integer, "billing_calculate_frequency" integer, "alerting_enabled" tinyint(1), "alerting_frequency" integer, "ping_enabled" tinyint(1), "ping_frequency" integer, "update_enabled" tinyint(1), "update_frequency" integer, "loglevel" varchar, "watchdog_enabled" tinyint(1), "watchdog_log" varchar);
CREATE TABLE IF NOT EXISTS "poller_cluster" ("id" integer not null primary key autoincrement, "node_id" varchar not null, "poller_name" varchar not null, "poller_version" varchar not null default '', "poller_groups" varchar not null default '', "last_report" datetime not null, "master" tinyint(1) not null, "poller_enabled" tinyint(1) null, "poller_frequency" integer null, "poller_workers" integer null, "poller_down_retry" integer null, "discovery_enabled" tinyint(1) null, "discovery_frequency" integer null, "discovery_workers" integer null, "services_enabled" tinyint(1) null, "services_frequency" integer null, "services_workers" integer null, "billing_enabled" tinyint(1) null, "billing_frequency" integer null, "billing_calculate_frequency" integer null, "alerting_enabled" tinyint(1) null, "alerting_frequency" integer null, "ping_enabled" tinyint(1) null, "ping_frequency" integer null, "update_enabled" tinyint(1) null, "update_frequency" integer null, "loglevel" varchar null, "watchdog_enabled" tinyint(1) null, "watchdog_log" varchar null);
CREATE UNIQUE INDEX "poller_cluster_node_id_unique" on "poller_cluster" ("node_id");
CREATE TABLE IF NOT EXISTS "poller_groups" ("id" integer not null primary key autoincrement, "group_name" varchar not null, "descr" varchar not null);
CREATE TABLE IF NOT EXISTS "pollers" ("id" integer not null primary key autoincrement, "poller_name" varchar not null, "last_polled" datetime not null, "devices" integer not null, "time_taken" float not null);
CREATE UNIQUE INDEX "pollers_poller_name_unique" on "pollers" ("poller_name");
CREATE TABLE IF NOT EXISTS "ports_adsl" ("port_id" integer not null, "port_adsl_updated" datetime default CURRENT_TIMESTAMP not null, "adslLineCoding" varchar not null, "adslLineType" varchar not null, "adslAtucInvVendorID" varchar not null, "adslAtucInvVersionNumber" varchar not null, "adslAtucCurrSnrMgn" numeric not null, "adslAtucCurrAtn" numeric not null, "adslAtucCurrOutputPwr" numeric not null, "adslAtucCurrAttainableRate" integer not null, "adslAtucChanCurrTxRate" integer not null, "adslAturInvSerialNumber" varchar not null, "adslAturInvVendorID" varchar not null, "adslAturInvVersionNumber" varchar not null, "adslAturChanCurrTxRate" integer not null, "adslAturCurrSnrMgn" numeric not null, "adslAturCurrAtn" numeric not null, "adslAturCurrOutputPwr" numeric not null, "adslAturCurrAttainableRate" integer not null);
CREATE UNIQUE INDEX "ports_adsl_port_id_unique" on "ports_adsl" ("port_id");
CREATE TABLE IF NOT EXISTS "ports_fdb" ("ports_fdb_id" integer not null primary key autoincrement, "port_id" integer not null, "mac_address" varchar not null, "vlan_id" integer not null, "device_id" integer not null, "created_at" datetime, "updated_at" datetime);
CREATE TABLE IF NOT EXISTS "ports_fdb" ("ports_fdb_id" integer not null primary key autoincrement, "port_id" integer not null, "mac_address" varchar not null, "vlan_id" integer not null, "device_id" integer not null, "created_at" datetime null, "updated_at" datetime null);
CREATE INDEX "ports_fdb_port_id_index" on "ports_fdb" ("port_id");
CREATE INDEX "ports_fdb_mac_address_index" on "ports_fdb" ("mac_address");
CREATE INDEX "ports_fdb_vlan_id_index" on "ports_fdb" ("vlan_id");
@ -156,30 +156,32 @@ CREATE INDEX "ports_fdb_device_id_index" on "ports_fdb" ("device_id");
CREATE TABLE IF NOT EXISTS "ports_perms" ("id" integer not null primary key autoincrement, "user_id" integer not null, "port_id" integer not null);
CREATE TABLE IF NOT EXISTS "ports_stack" ("device_id" integer not null, "port_id_high" integer not null, "port_id_low" integer not null, "ifStackStatus" varchar not null);
CREATE UNIQUE INDEX "ports_stack_device_id_port_id_high_port_id_low_unique" on "ports_stack" ("device_id", "port_id_high", "port_id_low");
CREATE TABLE IF NOT EXISTS "ports_statistics" ("port_id" integer not null, "ifInNUcastPkts" integer, "ifInNUcastPkts_prev" integer, "ifInNUcastPkts_delta" integer, "ifInNUcastPkts_rate" integer, "ifOutNUcastPkts" integer, "ifOutNUcastPkts_prev" integer, "ifOutNUcastPkts_delta" integer, "ifOutNUcastPkts_rate" integer, "ifInDiscards" integer, "ifInDiscards_prev" integer, "ifInDiscards_delta" integer, "ifInDiscards_rate" integer, "ifOutDiscards" integer, "ifOutDiscards_prev" integer, "ifOutDiscards_delta" integer, "ifOutDiscards_rate" integer, "ifInUnknownProtos" integer, "ifInUnknownProtos_prev" integer, "ifInUnknownProtos_delta" integer, "ifInUnknownProtos_rate" integer, "ifInBroadcastPkts" integer, "ifInBroadcastPkts_prev" integer, "ifInBroadcastPkts_delta" integer, "ifInBroadcastPkts_rate" integer, "ifOutBroadcastPkts" integer, "ifOutBroadcastPkts_prev" integer, "ifOutBroadcastPkts_delta" integer, "ifOutBroadcastPkts_rate" integer, "ifInMulticastPkts" integer, "ifInMulticastPkts_prev" integer, "ifInMulticastPkts_delta" integer, "ifInMulticastPkts_rate" integer, "ifOutMulticastPkts" integer, "ifOutMulticastPkts_prev" integer, "ifOutMulticastPkts_delta" integer, "ifOutMulticastPkts_rate" integer, primary key ("port_id"));
CREATE TABLE IF NOT EXISTS "ports_statistics" ("port_id" integer not null, "ifInNUcastPkts" integer null, "ifInNUcastPkts_prev" integer null, "ifInNUcastPkts_delta" integer null, "ifInNUcastPkts_rate" integer null, "ifOutNUcastPkts" integer null, "ifOutNUcastPkts_prev" integer null, "ifOutNUcastPkts_delta" integer null, "ifOutNUcastPkts_rate" integer null, "ifInDiscards" integer null, "ifInDiscards_prev" integer null, "ifInDiscards_delta" integer null, "ifInDiscards_rate" integer null, "ifOutDiscards" integer null, "ifOutDiscards_prev" integer null, "ifOutDiscards_delta" integer null, "ifOutDiscards_rate" integer null, "ifInUnknownProtos" integer null, "ifInUnknownProtos_prev" integer null, "ifInUnknownProtos_delta" integer null, "ifInUnknownProtos_rate" integer null, "ifInBroadcastPkts" integer null, "ifInBroadcastPkts_prev" integer null, "ifInBroadcastPkts_delta" integer null, "ifInBroadcastPkts_rate" integer null, "ifOutBroadcastPkts" integer null, "ifOutBroadcastPkts_prev" integer null, "ifOutBroadcastPkts_delta" integer null, "ifOutBroadcastPkts_rate" integer null, "ifInMulticastPkts" integer null, "ifInMulticastPkts_prev" integer null, "ifInMulticastPkts_delta" integer null, "ifInMulticastPkts_rate" integer null, "ifOutMulticastPkts" integer null, "ifOutMulticastPkts_prev" integer null, "ifOutMulticastPkts_delta" integer null, "ifOutMulticastPkts_rate" integer null, primary key ("port_id"));
CREATE TABLE IF NOT EXISTS "ports_stp" ("port_stp_id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "priority" integer not null, "state" varchar not null, "enable" varchar not null, "pathCost" integer not null, "designatedRoot" varchar not null, "designatedCost" integer not null, "designatedBridge" varchar not null, "designatedPort" integer not null, "forwardTransitions" integer not null);
CREATE UNIQUE INDEX "ports_stp_device_id_port_id_unique" on "ports_stp" ("device_id", "port_id");
CREATE TABLE IF NOT EXISTS "ports" ("port_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "port_descr_type" varchar, "port_descr_descr" varchar, "port_descr_circuit" varchar, "port_descr_speed" varchar, "port_descr_notes" varchar, "ifDescr" varchar, "ifName" varchar, "portName" varchar, "ifIndex" integer default '0', "ifSpeed" integer, "ifConnectorPresent" varchar, "ifPromiscuousMode" varchar, "ifHighSpeed" integer, "ifOperStatus" varchar, "ifOperStatus_prev" varchar, "ifAdminStatus" varchar, "ifAdminStatus_prev" varchar, "ifDuplex" varchar, "ifMtu" integer, "ifType" text, "ifAlias" text, "ifPhysAddress" text, "ifHardType" varchar, "ifLastChange" integer not null default '0', "ifVlan" varchar not null default '', "ifTrunk" varchar, "ifVrf" integer not null default '0', "counter_in" integer, "counter_out" integer, "ignore" tinyint(1) not null default '0', "disabled" tinyint(1) not null default '0', "detailed" tinyint(1) not null default '0', "deleted" tinyint(1) not null default '0', "pagpOperationMode" varchar, "pagpPortState" varchar, "pagpPartnerDeviceId" varchar, "pagpPartnerLearnMethod" varchar, "pagpPartnerIfIndex" integer, "pagpPartnerGroupIfIndex" integer, "pagpPartnerDeviceName" varchar, "pagpEthcOperationMode" varchar, "pagpDeviceId" varchar, "pagpGroupIfIndex" integer, "ifInUcastPkts" integer, "ifInUcastPkts_prev" integer, "ifInUcastPkts_delta" integer, "ifInUcastPkts_rate" integer, "ifOutUcastPkts" integer, "ifOutUcastPkts_prev" integer, "ifOutUcastPkts_delta" integer, "ifOutUcastPkts_rate" integer, "ifInErrors" integer, "ifInErrors_prev" integer, "ifInErrors_delta" integer, "ifInErrors_rate" integer, "ifOutErrors" integer, "ifOutErrors_prev" integer, "ifOutErrors_delta" integer, "ifOutErrors_rate" integer, "ifInOctets" integer, "ifInOctets_prev" integer, "ifInOctets_delta" integer, "ifInOctets_rate" integer, "ifOutOctets" integer, "ifOutOctets_prev" integer, "ifOutOctets_delta" integer, "ifOutOctets_rate" integer, "poll_time" integer, "poll_prev" integer, "poll_period" integer, "ifSpeed_prev" integer, "ifHighSpeed_prev" integer);
CREATE TABLE IF NOT EXISTS "ports" ("port_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "port_descr_type" varchar null, "port_descr_descr" varchar null, "port_descr_circuit" varchar null, "port_descr_speed" varchar null, "port_descr_notes" varchar null, "ifDescr" varchar null, "ifName" varchar null, "portName" varchar null, "ifIndex" integer null default '0', "ifSpeed" integer null, "ifConnectorPresent" varchar null, "ifPromiscuousMode" varchar null, "ifHighSpeed" integer null, "ifOperStatus" varchar null, "ifOperStatus_prev" varchar null, "ifAdminStatus" varchar null, "ifAdminStatus_prev" varchar null, "ifDuplex" varchar null, "ifMtu" integer null, "ifType" text null, "ifAlias" text null, "ifPhysAddress" text null, "ifHardType" varchar null, "ifLastChange" integer not null default '0', "ifVlan" varchar not null default '', "ifTrunk" varchar null, "ifVrf" integer not null default '0', "counter_in" integer null, "counter_out" integer null, "ignore" tinyint(1) not null default '0', "disabled" tinyint(1) not null default '0', "detailed" tinyint(1) not null default '0', "deleted" tinyint(1) not null default '0', "pagpOperationMode" varchar null, "pagpPortState" varchar null, "pagpPartnerDeviceId" varchar null, "pagpPartnerLearnMethod" varchar null, "pagpPartnerIfIndex" integer null, "pagpPartnerGroupIfIndex" integer null, "pagpPartnerDeviceName" varchar null, "pagpEthcOperationMode" varchar null, "pagpDeviceId" varchar null, "pagpGroupIfIndex" integer null, "ifInUcastPkts" integer null, "ifInUcastPkts_prev" integer null, "ifInUcastPkts_delta" integer null, "ifInUcastPkts_rate" integer null, "ifOutUcastPkts" integer null, "ifOutUcastPkts_prev" integer null, "ifOutUcastPkts_delta" integer null, "ifOutUcastPkts_rate" integer null, "ifInErrors" integer null, "ifInErrors_prev" integer null, "ifInErrors_delta" integer null, "ifInErrors_rate" integer null, "ifOutErrors" integer null, "ifOutErrors_prev" integer null, "ifOutErrors_delta" integer null, "ifOutErrors_rate" integer null, "ifInOctets" integer null, "ifInOctets_prev" integer null, "ifInOctets_delta" integer null, "ifInOctets_rate" integer null, "ifOutOctets" integer null, "ifOutOctets_prev" integer null, "ifOutOctets_delta" integer null, "ifOutOctets_rate" integer null, "poll_time" integer null, "poll_prev" integer null, "poll_period" integer null, "ifSpeed_prev" integer null, "ifHighSpeed_prev" integer null);
CREATE UNIQUE INDEX "ports_device_id_ifindex_unique" on "ports" ("device_id", "ifIndex");
CREATE INDEX "ports_ifdescr_index" on "ports" ("ifDescr");
CREATE TABLE IF NOT EXISTS "ports_vlans" ("port_vlan_id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "vlan" integer not null, "baseport" integer not null, "priority" integer not null, "state" varchar not null, "cost" integer not null, "untagged" tinyint(1) not null default '0');
CREATE UNIQUE INDEX "ports_vlans_device_id_port_id_vlan_unique" on "ports_vlans" ("device_id", "port_id", "vlan");
CREATE TABLE IF NOT EXISTS "processes" ("id" integer not null primary key autoincrement, "device_id" integer not null, "pid" integer not null, "vsz" integer not null, "rss" integer not null, "cputime" varchar not null, "user" varchar not null, "command" text not null);
CREATE INDEX "processes_device_id_index" on "processes" ("device_id");
CREATE TABLE IF NOT EXISTS "processors" ("processor_id" integer not null primary key autoincrement, "entPhysicalIndex" integer not null default '0', "hrDeviceIndex" integer, "device_id" integer not null, "processor_oid" varchar not null, "processor_index" varchar not null, "processor_type" varchar not null, "processor_usage" integer not null, "processor_descr" varchar not null, "processor_precision" integer not null default '1', "processor_perc_warn" integer default '75');
CREATE TABLE IF NOT EXISTS "processors" ("processor_id" integer not null primary key autoincrement, "entPhysicalIndex" integer not null default '0', "hrDeviceIndex" integer null, "device_id" integer not null, "processor_oid" varchar not null, "processor_index" varchar not null, "processor_type" varchar not null, "processor_usage" integer not null, "processor_descr" varchar not null, "processor_precision" integer not null default '1', "processor_perc_warn" integer null default '75');
CREATE INDEX "processors_device_id_index" on "processors" ("device_id");
CREATE TABLE IF NOT EXISTS "proxmox_ports" ("id" integer not null primary key autoincrement, "vm_id" integer not null, "port" varchar not null, "last_seen" datetime default CURRENT_TIMESTAMP not null);
CREATE UNIQUE INDEX "proxmox_ports_vm_id_port_unique" on "proxmox_ports" ("vm_id", "port");
CREATE TABLE IF NOT EXISTS "proxmox" ("id" integer not null primary key autoincrement, "device_id" integer not null default '0', "vmid" integer not null, "cluster" varchar not null, "description" varchar, "last_seen" datetime default CURRENT_TIMESTAMP not null);
CREATE TABLE IF NOT EXISTS "proxmox" ("id" integer not null primary key autoincrement, "device_id" integer not null default '0', "vmid" integer not null, "cluster" varchar not null, "description" varchar null, "last_seen" datetime default CURRENT_TIMESTAMP not null);
CREATE UNIQUE INDEX "proxmox_cluster_vmid_unique" on "proxmox" ("cluster", "vmid");
CREATE TABLE IF NOT EXISTS "pseudowires" ("pseudowire_id" integer not null primary key autoincrement, "device_id" integer not null, "port_id" integer not null, "peer_device_id" integer not null, "peer_ldp_id" integer not null, "cpwVcID" integer not null, "cpwOid" integer not null, "pw_type" varchar not null, "pw_psntype" varchar not null, "pw_local_mtu" integer not null, "pw_peer_mtu" integer not null, "pw_descr" varchar not null);
CREATE TABLE IF NOT EXISTS "sensors" ("sensor_id" integer not null primary key autoincrement, "sensor_deleted" tinyint(1) not null default '0', "sensor_class" varchar not null, "device_id" integer not null default '0', "poller_type" varchar not null default 'snmp', "sensor_oid" varchar not null, "sensor_index" varchar, "sensor_type" varchar not null, "sensor_descr" varchar, "group" varchar, "sensor_divisor" integer not null default '1', "sensor_multiplier" integer not null default '1', "sensor_current" float, "sensor_limit" float, "sensor_limit_warn" float, "sensor_limit_low" float, "sensor_limit_low_warn" float, "sensor_alert" tinyint(1) not null default '1', "sensor_custom" varchar check ("sensor_custom" in ('No', 'Yes')) not null default 'No', "entPhysicalIndex" varchar, "entPhysicalIndex_measured" varchar, "lastupdate" datetime default CURRENT_TIMESTAMP not null, "sensor_prev" float, "user_func" varchar);
CREATE TABLE IF NOT EXISTS "sensors" ("sensor_id" integer not null primary key autoincrement, "sensor_deleted" tinyint(1) not null default '0', "sensor_class" varchar not null, "device_id" integer not null default '0', "poller_type" varchar not null default 'snmp', "sensor_oid" varchar not null, "sensor_index" varchar null, "sensor_type" varchar not null, "sensor_descr" varchar null, "group" varchar null, "sensor_divisor" integer not null default '1', "sensor_multiplier" integer not null default '1', "sensor_current" float null, "sensor_limit" float null, "sensor_limit_warn" float null, "sensor_limit_low" float null, "sensor_limit_low_warn" float null, "sensor_alert" tinyint(1) not null default '1', "sensor_custom" varchar check ("sensor_custom" in ('No', 'Yes')) not null default 'No', "entPhysicalIndex" varchar null, "entPhysicalIndex_measured" varchar null, "lastupdate" datetime default CURRENT_TIMESTAMP not null, "sensor_prev" float null, "user_func" varchar null);
CREATE INDEX "sensors_sensor_class_index" on "sensors" ("sensor_class");
CREATE INDEX "sensors_device_id_index" on "sensors" ("device_id");
CREATE INDEX "sensors_sensor_type_index" on "sensors" ("sensor_type");
CREATE TABLE IF NOT EXISTS "sensors_to_state_indexes" ("sensors_to_state_translations_id" integer not null primary key autoincrement, "sensor_id" integer not null, "state_index_id" integer not null);
CREATE UNIQUE INDEX "sensors_to_state_indexes_sensor_id_state_index_id_unique" on "sensors_to_state_indexes" ("sensor_id", "state_index_id");
CREATE INDEX "sensors_to_state_indexes_state_index_id_index" on "sensors_to_state_indexes" ("state_index_id");
CREATE TABLE IF NOT EXISTS "services" ("service_id" integer not null primary key autoincrement, "device_id" integer not null, "service_ip" text not null, "service_type" varchar not null, "service_desc" text not null, "service_param" text not null, "service_ignore" tinyint(1) not null, "service_status" integer not null default '0', "service_changed" integer not null default '0', "service_message" text not null, "service_disabled" tinyint(1) not null default '0', "service_ds" text not null);
CREATE INDEX "services_device_id_index" on "services" ("device_id");
CREATE TABLE IF NOT EXISTS "session" ("session_id" integer not null primary key autoincrement, "session_username" varchar not null, "session_value" varchar not null, "session_token" varchar not null, "session_auth" varchar not null, "session_expiry" integer not null);
CREATE UNIQUE INDEX "session_session_value_unique" on "session" ("session_value");
CREATE TABLE IF NOT EXISTS "slas" ("sla_id" integer not null primary key autoincrement, "device_id" integer not null, "sla_nr" integer not null, "owner" varchar not null, "tag" varchar not null, "rtt_type" varchar not null, "status" tinyint(1) not null, "opstatus" tinyint(1) not null default '0', "deleted" tinyint(1) not null default '0');
@ -189,12 +191,12 @@ CREATE TABLE IF NOT EXISTS "state_indexes" ("state_index_id" integer not null pr
CREATE UNIQUE INDEX "state_indexes_state_name_unique" on "state_indexes" ("state_name");
CREATE TABLE IF NOT EXISTS "state_translations" ("state_translation_id" integer not null primary key autoincrement, "state_index_id" integer not null, "state_descr" varchar not null, "state_draw_graph" tinyint(1) not null, "state_value" integer not null default '0', "state_generic_value" tinyint(1) not null, "state_lastupdated" datetime default CURRENT_TIMESTAMP not null);
CREATE UNIQUE INDEX "state_translations_state_index_id_state_value_unique" on "state_translations" ("state_index_id", "state_value");
CREATE TABLE IF NOT EXISTS "storage" ("storage_id" integer not null primary key autoincrement, "device_id" integer not null, "storage_mib" varchar not null, "storage_index" varchar, "storage_type" varchar, "storage_descr" text not null, "storage_size" integer not null, "storage_units" integer not null, "storage_used" integer not null default '0', "storage_free" integer not null default '0', "storage_perc" integer not null default '0', "storage_perc_warn" integer default '60', "storage_deleted" tinyint(1) not null default '0');
CREATE TABLE IF NOT EXISTS "storage" ("storage_id" integer not null primary key autoincrement, "device_id" integer not null, "storage_mib" varchar not null, "storage_index" varchar null, "storage_type" varchar null, "storage_descr" text not null, "storage_size" integer not null, "storage_units" integer not null, "storage_used" integer not null default '0', "storage_free" integer not null default '0', "storage_perc" integer not null default '0', "storage_perc_warn" integer null default '60', "storage_deleted" tinyint(1) not null default '0');
CREATE UNIQUE INDEX "storage_device_id_storage_mib_storage_index_unique" on "storage" ("device_id", "storage_mib", "storage_index");
CREATE INDEX "storage_device_id_index" on "storage" ("device_id");
CREATE TABLE IF NOT EXISTS "stp" ("stp_id" integer not null primary key autoincrement, "device_id" integer not null, "rootBridge" tinyint(1) not null, "bridgeAddress" varchar not null, "protocolSpecification" varchar not null, "priority" integer not null, "timeSinceTopologyChange" varchar not null, "topChanges" integer not null, "designatedRoot" varchar not null, "rootCost" integer not null, "rootPort" integer, "maxAge" integer not null, "helloTime" integer not null, "holdTime" integer not null, "forwardDelay" integer not null, "bridgeMaxAge" integer not null, "bridgeHelloTime" integer not null, "bridgeForwardDelay" integer not null);
CREATE TABLE IF NOT EXISTS "stp" ("stp_id" integer not null primary key autoincrement, "device_id" integer not null, "rootBridge" tinyint(1) not null, "bridgeAddress" varchar not null, "protocolSpecification" varchar not null, "priority" integer not null, "timeSinceTopologyChange" varchar not null, "topChanges" integer not null, "designatedRoot" varchar not null, "rootCost" integer not null, "rootPort" integer null, "maxAge" integer not null, "helloTime" integer not null, "holdTime" integer not null, "forwardDelay" integer not null, "bridgeMaxAge" integer not null, "bridgeHelloTime" integer not null, "bridgeForwardDelay" integer not null);
CREATE INDEX "stp_device_id_index" on "stp" ("device_id");
CREATE TABLE IF NOT EXISTS "syslog" ("device_id" integer, "facility" varchar, "priority" varchar, "level" varchar, "tag" varchar, "timestamp" datetime default CURRENT_TIMESTAMP not null, "program" varchar, "msg" text, "seq" integer not null primary key autoincrement);
CREATE TABLE IF NOT EXISTS "syslog" ("device_id" integer null, "facility" varchar null, "priority" varchar null, "level" varchar null, "tag" varchar null, "timestamp" datetime default CURRENT_TIMESTAMP not null, "program" varchar null, "msg" text null, "seq" integer not null primary key autoincrement);
CREATE INDEX "syslog_priority_level_index" on "syslog" ("priority", "level");
CREATE INDEX "syslog_device_id_timestamp_index" on "syslog" ("device_id", "timestamp");
CREATE INDEX "syslog_device_id_index" on "syslog" ("device_id");
@ -203,59 +205,64 @@ CREATE INDEX "syslog_program_index" on "syslog" ("program");
CREATE TABLE IF NOT EXISTS "tnmsneinfo" ("id" integer not null primary key autoincrement, "device_id" integer not null, "neID" integer not null, "neType" varchar not null, "neName" varchar not null, "neLocation" varchar not null, "neAlarm" varchar not null, "neOpMode" varchar not null, "neOpState" varchar not null);
CREATE INDEX "tnmsneinfo_device_id_index" on "tnmsneinfo" ("device_id");
CREATE INDEX "tnmsneinfo_neid_index" on "tnmsneinfo" ("neID");
CREATE TABLE IF NOT EXISTS "toner" ("toner_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "toner_index" integer not null, "toner_type" varchar not null, "toner_oid" varchar not null, "toner_descr" varchar not null default '', "toner_capacity" integer not null default '0', "toner_current" integer not null default '0', "toner_capacity_oid" varchar);
CREATE TABLE IF NOT EXISTS "toner" ("toner_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "toner_index" integer not null, "toner_type" varchar not null, "toner_oid" varchar not null, "toner_descr" varchar not null default '', "toner_capacity" integer not null default '0', "toner_current" integer not null default '0', "toner_capacity_oid" varchar null);
CREATE INDEX "toner_device_id_index" on "toner" ("device_id");
CREATE TABLE IF NOT EXISTS "transport_group_transport" ("id" integer not null primary key autoincrement, "transport_group_id" integer not null, "transport_id" integer not null);
CREATE TABLE IF NOT EXISTS "ucd_diskio" ("diskio_id" integer not null primary key autoincrement, "device_id" integer not null, "diskio_index" integer not null, "diskio_descr" varchar not null);
CREATE INDEX "ucd_diskio_device_id_index" on "ucd_diskio" ("device_id");
CREATE TABLE IF NOT EXISTS "users_prefs" ("user_id" integer not null, "pref" varchar not null, "value" varchar not null);
CREATE UNIQUE INDEX "users_prefs_user_id_pref_unique" on "users_prefs" ("user_id", "pref");
CREATE TABLE IF NOT EXISTS "users" ("user_id" integer not null primary key autoincrement, "auth_type" varchar, "auth_id" integer, "username" varchar not null, "password" varchar, "realname" varchar not null, "email" varchar not null, "descr" varchar not null, "level" integer not null default '0', "can_modify_passwd" tinyint(1) not null default '1', "created_at" datetime not null default '1970-01-02 00:00:01', "updated_at" datetime default CURRENT_TIMESTAMP not null, "remember_token" varchar, "enabled" tinyint(1) not null default '1');
CREATE TABLE IF NOT EXISTS "users" ("user_id" integer not null primary key autoincrement, "auth_type" varchar null, "auth_id" integer null, "username" varchar not null, "password" varchar null, "realname" varchar not null, "email" varchar not null, "descr" varchar not null, "level" integer not null default '0', "can_modify_passwd" tinyint(1) not null default '1', "created_at" datetime not null default '1970-01-02 00:00:01', "updated_at" datetime default CURRENT_TIMESTAMP not null, "remember_token" varchar null, "enabled" tinyint(1) not null default '1');
CREATE UNIQUE INDEX "users_auth_type_username_unique" on "users" ("auth_type", "username");
CREATE TABLE IF NOT EXISTS "users_widgets" ("user_widget_id" integer not null primary key autoincrement, "user_id" integer not null, "widget_id" integer not null, "col" integer not null, "row" integer not null, "size_x" integer not null, "size_y" integer not null, "title" varchar not null, "refresh" integer not null default '60', "settings" text not null, "dashboard_id" integer not null);
CREATE INDEX "user_id" on "users_widgets" ("user_id", "widget_id");
CREATE TABLE IF NOT EXISTS "vlans" ("vlan_id" integer not null primary key autoincrement, "device_id" integer, "vlan_vlan" integer, "vlan_domain" integer, "vlan_name" varchar, "vlan_type" varchar, "vlan_mtu" integer);
CREATE TABLE IF NOT EXISTS "vlans" ("vlan_id" integer not null primary key autoincrement, "device_id" integer null, "vlan_vlan" integer null, "vlan_domain" integer null, "vlan_name" varchar null, "vlan_type" varchar null, "vlan_mtu" integer null);
CREATE INDEX "device_id" on "vlans" ("device_id", "vlan_vlan");
CREATE TABLE IF NOT EXISTS "vrf_lite_cisco" ("vrf_lite_cisco_id" integer not null primary key autoincrement, "device_id" integer not null, "context_name" varchar not null, "intance_name" varchar default '', "vrf_name" varchar default 'Default');
CREATE TABLE IF NOT EXISTS "vminfo" ("id" integer not null primary key autoincrement, "device_id" integer not null, "vm_type" varchar not null default 'vmware', "vmwVmVMID" integer not null, "vmwVmDisplayName" varchar not null, "vmwVmGuestOS" varchar not null, "vmwVmMemSize" integer not null, "vmwVmCpus" integer not null, "vmwVmState" varchar not null);
CREATE INDEX "vminfo_device_id_index" on "vminfo" ("device_id");
CREATE INDEX "vminfo_vmwvmvmid_index" on "vminfo" ("vmwVmVMID");
CREATE TABLE IF NOT EXISTS "vrf_lite_cisco" ("vrf_lite_cisco_id" integer not null primary key autoincrement, "device_id" integer not null, "context_name" varchar not null, "intance_name" varchar null default '', "vrf_name" varchar null default 'Default');
CREATE INDEX "vrf_lite_cisco_device_id_context_name_vrf_name_index" on "vrf_lite_cisco" ("device_id", "context_name", "vrf_name");
CREATE INDEX "vrf_lite_cisco_device_id_index" on "vrf_lite_cisco" ("device_id");
CREATE INDEX "vrf_lite_cisco_context_name_index" on "vrf_lite_cisco" ("context_name");
CREATE INDEX "vrf_lite_cisco_vrf_name_index" on "vrf_lite_cisco" ("vrf_name");
CREATE TABLE IF NOT EXISTS "vrfs" ("vrf_id" integer not null primary key autoincrement, "vrf_oid" varchar not null, "vrf_name" varchar, "mplsVpnVrfRouteDistinguisher" varchar, "mplsVpnVrfDescription" text not null, "device_id" integer not null, "bgpLocalAs" integer);
CREATE TABLE IF NOT EXISTS "vrfs" ("vrf_id" integer not null primary key autoincrement, "vrf_oid" varchar not null, "vrf_name" varchar null, "mplsVpnVrfRouteDistinguisher" varchar null, "mplsVpnVrfDescription" text not null, "device_id" integer not null, "bgpLocalAs" integer null);
CREATE INDEX "vrfs_device_id_index" on "vrfs" ("device_id");
CREATE TABLE IF NOT EXISTS "widgets" ("widget_id" integer not null primary key autoincrement, "widget_title" varchar not null, "widget" varchar not null, "base_dimensions" varchar not null);
CREATE UNIQUE INDEX "widgets_widget_unique" on "widgets" ("widget");
CREATE TABLE IF NOT EXISTS "wireless_sensors" ("sensor_id" integer not null primary key autoincrement, "sensor_deleted" tinyint(1) not null default '0', "sensor_class" varchar not null, "device_id" integer not null default '0', "sensor_index" varchar, "sensor_type" varchar not null, "sensor_descr" varchar, "sensor_divisor" integer not null default '1', "sensor_multiplier" integer not null default '1', "sensor_aggregator" varchar not null default 'sum', "sensor_current" float, "sensor_prev" float, "sensor_limit" float, "sensor_limit_warn" float, "sensor_limit_low" float, "sensor_limit_low_warn" float, "sensor_alert" tinyint(1) not null default '1', "sensor_custom" varchar check ("sensor_custom" in ('No', 'Yes')) not null default 'No', "entPhysicalIndex" varchar, "entPhysicalIndex_measured" varchar, "lastupdate" datetime default CURRENT_TIMESTAMP not null, "sensor_oids" text not null, "access_point_id" integer);
CREATE TABLE IF NOT EXISTS "wireless_sensors" ("sensor_id" integer not null primary key autoincrement, "sensor_deleted" tinyint(1) not null default '0', "sensor_class" varchar not null, "device_id" integer not null default '0', "sensor_index" varchar null, "sensor_type" varchar not null, "sensor_descr" varchar null, "sensor_divisor" integer not null default '1', "sensor_multiplier" integer not null default '1', "sensor_aggregator" varchar not null default 'sum', "sensor_current" float null, "sensor_prev" float null, "sensor_limit" float null, "sensor_limit_warn" float null, "sensor_limit_low" float null, "sensor_limit_low_warn" float null, "sensor_alert" tinyint(1) not null default '1', "sensor_custom" varchar check ("sensor_custom" in ('No', 'Yes')) not null default 'No', "entPhysicalIndex" varchar null, "entPhysicalIndex_measured" varchar null, "lastupdate" datetime default CURRENT_TIMESTAMP not null, "sensor_oids" text not null, "access_point_id" integer null);
CREATE INDEX "wireless_sensors_sensor_class_index" on "wireless_sensors" ("sensor_class");
CREATE INDEX "wireless_sensors_device_id_index" on "wireless_sensors" ("device_id");
CREATE INDEX "wireless_sensors_sensor_type_index" on "wireless_sensors" ("sensor_type");
CREATE TABLE ports_nac (ports_nac_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, auth_id VARCHAR(255) NOT NULL COLLATE BINARY, device_id INTEGER NOT NULL, port_id INTEGER NOT NULL, domain VARCHAR(255) NOT NULL COLLATE BINARY, username VARCHAR(255) NOT NULL COLLATE BINARY, mac_address VARCHAR(255) NOT NULL COLLATE BINARY, ip_address VARCHAR(255) NOT NULL COLLATE BINARY, host_mode VARCHAR(255) NOT NULL COLLATE BINARY, authz_status VARCHAR(255) NOT NULL COLLATE BINARY, authz_by VARCHAR(255) NOT NULL COLLATE BINARY, authc_status VARCHAR(255) NOT NULL COLLATE BINARY, method VARCHAR(255) NOT NULL COLLATE BINARY, timeout VARCHAR(255) NOT NULL COLLATE BINARY, time_left VARCHAR(50) DEFAULT NULL COLLATE BINARY, "vlan" integer, "time_elapsed" varchar);
CREATE TABLE ports_nac (ports_nac_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, auth_id VARCHAR(255) NOT NULL COLLATE BINARY, device_id INTEGER NOT NULL, port_id INTEGER NOT NULL, domain VARCHAR(255) NOT NULL COLLATE BINARY, username VARCHAR(255) NOT NULL COLLATE BINARY, mac_address VARCHAR(255) NOT NULL COLLATE BINARY, ip_address VARCHAR(255) NOT NULL COLLATE BINARY, host_mode VARCHAR(255) NOT NULL COLLATE BINARY, authz_status VARCHAR(255) NOT NULL COLLATE BINARY, authz_by VARCHAR(255) NOT NULL COLLATE BINARY, authc_status VARCHAR(255) NOT NULL COLLATE BINARY, method VARCHAR(255) NOT NULL COLLATE BINARY, timeout VARCHAR(255) NOT NULL COLLATE BINARY, time_left VARCHAR(50) DEFAULT NULL COLLATE BINARY, "vlan" integer null, "time_elapsed" varchar null);
CREATE INDEX ports_nac_device_id_index ON ports_nac (device_id);
CREATE INDEX ports_nac_port_id_mac_address_index ON ports_nac (port_id, mac_address);
CREATE TABLE config (config_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, config_name VARCHAR(255) NOT NULL COLLATE BINARY, config_value VARCHAR(255) NOT NULL COLLATE BINARY);
CREATE UNIQUE INDEX config_config_name_unique ON config (config_name);
CREATE TABLE IF NOT EXISTS "route" ("route_id" integer not null primary key autoincrement, "created_at" datetime, "updated_at" datetime, "device_id" integer not null, "port_id" integer not null, "context_name" varchar, "inetCidrRouteIfIndex" integer not null, "inetCidrRouteType" integer not null, "inetCidrRouteProto" integer not null, "inetCidrRouteNextHopAS" integer not null, "inetCidrRouteMetric1" integer not null, "inetCidrRouteDestType" varchar not null, "inetCidrRouteDest" varchar not null, "inetCidrRouteNextHopType" varchar not null, "inetCidrRouteNextHop" varchar not null, "inetCidrRoutePolicy" varchar not null, "inetCidrRoutePfxLen" integer not null);
CREATE TABLE IF NOT EXISTS "mpls_lsps" ("lsp_id" integer not null primary key autoincrement, "vrf_oid" integer not null, "lsp_oid" integer not null, "device_id" integer not null, "mplsLspRowStatus" varchar check ("mplsLspRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) not null, "mplsLspLastChange" integer, "mplsLspName" varchar not null, "mplsLspAdminState" varchar check ("mplsLspAdminState" in ('noop', 'inService', 'outOfService')) not null, "mplsLspOperState" varchar check ("mplsLspOperState" in ('unknown', 'inService', 'outOfService', 'transition')) not null, "mplsLspFromAddr" varchar not null, "mplsLspToAddr" varchar not null, "mplsLspType" varchar check ("mplsLspType" in ('unknown', 'dynamic', 'static', 'bypassOnly', 'p2mpLsp', 'p2mpAuto', 'mplsTp', 'meshP2p', 'oneHopP2p', 'srTe', 'meshP2pSrTe', 'oneHopP2pSrTe')) not null, "mplsLspFastReroute" varchar check ("mplsLspFastReroute" in ('true', 'false')) not null, "mplsLspAge" integer, "mplsLspTimeUp" integer, "mplsLspTimeDown" integer, "mplsLspPrimaryTimeUp" integer, "mplsLspTransitions" integer, "mplsLspLastTransition" integer, "mplsLspConfiguredPaths" integer, "mplsLspStandbyPaths" integer, "mplsLspOperationalPaths" integer);
CREATE TABLE IF NOT EXISTS "route" ("route_id" integer not null primary key autoincrement, "created_at" datetime null, "updated_at" datetime null, "device_id" integer not null, "port_id" integer not null, "context_name" varchar null, "inetCidrRouteIfIndex" integer not null, "inetCidrRouteType" integer not null, "inetCidrRouteProto" integer not null, "inetCidrRouteNextHopAS" integer not null, "inetCidrRouteMetric1" integer not null, "inetCidrRouteDestType" varchar not null, "inetCidrRouteDest" varchar not null, "inetCidrRouteNextHopType" varchar not null, "inetCidrRouteNextHop" varchar not null, "inetCidrRoutePolicy" varchar not null, "inetCidrRoutePfxLen" integer not null);
CREATE TABLE IF NOT EXISTS "mpls_lsps" ("lsp_id" integer not null primary key autoincrement, "vrf_oid" integer not null, "lsp_oid" integer not null, "device_id" integer not null, "mplsLspRowStatus" varchar check ("mplsLspRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) not null, "mplsLspLastChange" integer null, "mplsLspName" varchar not null, "mplsLspAdminState" varchar check ("mplsLspAdminState" in ('noop', 'inService', 'outOfService')) not null, "mplsLspOperState" varchar check ("mplsLspOperState" in ('unknown', 'inService', 'outOfService', 'transition')) not null, "mplsLspFromAddr" varchar not null, "mplsLspToAddr" varchar not null, "mplsLspType" varchar check ("mplsLspType" in ('unknown', 'dynamic', 'static', 'bypassOnly', 'p2mpLsp', 'p2mpAuto', 'mplsTp', 'meshP2p', 'oneHopP2p', 'srTe', 'meshP2pSrTe', 'oneHopP2pSrTe')) not null, "mplsLspFastReroute" varchar check ("mplsLspFastReroute" in ('true', 'false')) not null, "mplsLspAge" integer null, "mplsLspTimeUp" integer null, "mplsLspTimeDown" integer null, "mplsLspPrimaryTimeUp" integer null, "mplsLspTransitions" integer null, "mplsLspLastTransition" integer null, "mplsLspConfiguredPaths" integer null, "mplsLspStandbyPaths" integer null, "mplsLspOperationalPaths" integer null);
CREATE INDEX "mpls_lsps_device_id_index" on "mpls_lsps" ("device_id");
CREATE TABLE device_groups (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) DEFAULT '' NOT NULL COLLATE BINARY, "desc" VARCHAR(255) DEFAULT '' NOT NULL COLLATE BINARY, pattern CLOB DEFAULT NULL COLLATE BINARY);
CREATE UNIQUE INDEX device_groups_name_unique ON device_groups (name);
CREATE TABLE IF NOT EXISTS "mpls_sdps" ("sdp_id" integer not null primary key autoincrement, "sdp_oid" integer not null, "device_id" integer not null, "sdpRowStatus" varchar check ("sdpRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')), "sdpDelivery" varchar check ("sdpDelivery" in ('gre', 'mpls', 'l2tpv3', 'greethbridged')), "sdpDescription" varchar, "sdpAdminStatus" varchar check ("sdpAdminStatus" in ('up', 'down')), "sdpOperStatus" varchar check ("sdpOperStatus" in ('up', 'notAlive', 'notReady', 'invalidEgressInterface', 'transportTunnelDown', 'down')), "sdpAdminPathMtu" integer, "sdpOperPathMtu" integer, "sdpLastMgmtChange" integer, "sdpLastStatusChange" integer, "sdpActiveLspType" varchar check ("sdpActiveLspType" in ('not-applicable', 'rsvp', 'ldp', 'bgp', 'none', 'mplsTp', 'srIsis', 'srOspf', 'srTeLsp', 'fpe')), "sdpFarEndInetAddressType" varchar check ("sdpFarEndInetAddressType" in ('ipv4', 'ipv6')), "sdpFarEndInetAddress" varchar);
CREATE TABLE IF NOT EXISTS "mpls_sdps" ("sdp_id" integer not null primary key autoincrement, "sdp_oid" integer not null, "device_id" integer not null, "sdpRowStatus" varchar check ("sdpRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "sdpDelivery" varchar check ("sdpDelivery" in ('gre', 'mpls', 'l2tpv3', 'greethbridged')) null, "sdpDescription" varchar null, "sdpAdminStatus" varchar check ("sdpAdminStatus" in ('up', 'down')) null, "sdpOperStatus" varchar check ("sdpOperStatus" in ('up', 'notAlive', 'notReady', 'invalidEgressInterface', 'transportTunnelDown', 'down')) null, "sdpAdminPathMtu" integer null, "sdpOperPathMtu" integer null, "sdpLastMgmtChange" integer null, "sdpLastStatusChange" integer null, "sdpActiveLspType" varchar check ("sdpActiveLspType" in ('not-applicable', 'rsvp', 'ldp', 'bgp', 'none', 'mplsTp', 'srIsis', 'srOspf', 'srTeLsp', 'fpe')) null, "sdpFarEndInetAddressType" varchar check ("sdpFarEndInetAddressType" in ('ipv4', 'ipv6')) null, "sdpFarEndInetAddress" varchar null);
CREATE INDEX "mpls_sdps_device_id_index" on "mpls_sdps" ("device_id");
CREATE TABLE IF NOT EXISTS "mpls_sdp_binds" ("bind_id" integer not null primary key autoincrement, "sdp_id" integer not null, "svc_id" integer not null, "sdp_oid" integer not null, "svc_oid" integer not null, "device_id" integer not null, "sdpBindRowStatus" varchar check ("sdpBindRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')), "sdpBindAdminStatus" varchar check ("sdpBindAdminStatus" in ('up', 'down')), "sdpBindOperStatus" varchar check ("sdpBindOperStatus" in ('up', 'down')), "sdpBindLastMgmtChange" integer, "sdpBindLastStatusChange" integer, "sdpBindType" varchar check ("sdpBindType" in ('spoke', 'mesh')), "sdpBindVcType" varchar check ("sdpBindVcType" in ('undef', 'ether', 'vlan', 'mirrior', 'atmSduatmCell', 'atmVcc', 'atmVpc', 'frDlci', 'ipipe', 'satopE1', 'satopT1', 'satopE3', 'satopT3', 'cesopsn', 'cesopsnCas')), "sdpBindBaseStatsIngFwdPackets" integer, "sdpBindBaseStatsIngFwdOctets" integer, "sdpBindBaseStatsEgrFwdPackets" integer, "sdpBindBaseStatsEgrFwdOctets" integer);
CREATE TABLE IF NOT EXISTS "mpls_sdp_binds" ("bind_id" integer not null primary key autoincrement, "sdp_id" integer not null, "svc_id" integer not null, "sdp_oid" integer not null, "svc_oid" integer not null, "device_id" integer not null, "sdpBindRowStatus" varchar check ("sdpBindRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "sdpBindAdminStatus" varchar check ("sdpBindAdminStatus" in ('up', 'down')) null, "sdpBindOperStatus" varchar check ("sdpBindOperStatus" in ('up', 'down')) null, "sdpBindLastMgmtChange" integer null, "sdpBindLastStatusChange" integer null, "sdpBindType" varchar check ("sdpBindType" in ('spoke', 'mesh')) null, "sdpBindVcType" varchar check ("sdpBindVcType" in ('undef', 'ether', 'vlan', 'mirrior', 'atmSduatmCell', 'atmVcc', 'atmVpc', 'frDlci', 'ipipe', 'satopE1', 'satopT1', 'satopE3', 'satopT3', 'cesopsn', 'cesopsnCas')) null, "sdpBindBaseStatsIngFwdPackets" integer null, "sdpBindBaseStatsIngFwdOctets" integer null, "sdpBindBaseStatsEgrFwdPackets" integer null, "sdpBindBaseStatsEgrFwdOctets" integer null);
CREATE INDEX "mpls_sdp_binds_device_id_index" on "mpls_sdp_binds" ("device_id");
CREATE TABLE IF NOT EXISTS "mpls_services" ("svc_id" integer not null primary key autoincrement, "svc_oid" integer not null, "device_id" integer not null, "svcRowStatus" varchar check ("svcRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')), "svcType" varchar check ("svcType" in ('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls')), "svcCustId" integer, "svcAdminStatus" varchar check ("svcAdminStatus" in ('up', 'down')), "svcOperStatus" varchar check ("svcOperStatus" in ('up', 'down')), "svcDescription" varchar, "svcMtu" integer, "svcNumSaps" integer, "svcNumSdps" integer, "svcLastMgmtChange" integer, "svcLastStatusChange" integer, "svcVRouterId" integer, "svcTlsMacLearning" varchar check ("svcTlsMacLearning" in ('enabled', 'disabled')), "svcTlsStpAdminStatus" varchar check ("svcTlsStpAdminStatus" in ('enabled', 'disabled')), "svcTlsStpOperStatus" varchar check ("svcTlsStpOperStatus" in ('up', 'down')), "svcTlsFdbTableSize" integer, "svcTlsFdbNumEntries" integer);
CREATE TABLE IF NOT EXISTS "mpls_services" ("svc_id" integer not null primary key autoincrement, "svc_oid" integer not null, "device_id" integer not null, "svcRowStatus" varchar check ("svcRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "svcType" varchar check ("svcType" in ('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls')) null, "svcCustId" integer null, "svcAdminStatus" varchar check ("svcAdminStatus" in ('up', 'down')) null, "svcOperStatus" varchar check ("svcOperStatus" in ('up', 'down')) null, "svcDescription" varchar null, "svcMtu" integer null, "svcNumSaps" integer null, "svcNumSdps" integer null, "svcLastMgmtChange" integer null, "svcLastStatusChange" integer null, "svcVRouterId" integer null, "svcTlsMacLearning" varchar check ("svcTlsMacLearning" in ('enabled', 'disabled')) null, "svcTlsStpAdminStatus" varchar check ("svcTlsStpAdminStatus" in ('enabled', 'disabled')) null, "svcTlsStpOperStatus" varchar check ("svcTlsStpOperStatus" in ('up', 'down')) null, "svcTlsFdbTableSize" integer null, "svcTlsFdbNumEntries" integer null);
CREATE INDEX "mpls_services_device_id_index" on "mpls_services" ("device_id");
CREATE TABLE IF NOT EXISTS "mpls_saps" ("sap_id" integer not null primary key autoincrement, "svc_id" integer not null, "svc_oid" integer not null, "sapPortId" integer not null, "ifName" varchar, "device_id" integer not null, "sapEncapValue" varchar, "sapRowStatus" varchar check ("sapRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')), "sapType" varchar check ("sapType" in ('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls')), "sapDescription" varchar, "sapAdminStatus" varchar check ("sapAdminStatus" in ('up', 'down')), "sapOperStatus" varchar check ("sapOperStatus" in ('up', 'down')), "sapLastMgmtChange" integer, "sapLastStatusChange" integer);
CREATE TABLE IF NOT EXISTS "mpls_saps" ("sap_id" integer not null primary key autoincrement, "svc_id" integer not null, "svc_oid" integer not null, "sapPortId" integer not null, "ifName" varchar null, "device_id" integer not null, "sapEncapValue" varchar null, "sapRowStatus" varchar check ("sapRowStatus" in ('active', 'notInService', 'notReady', 'createAndGo', 'createAndWait', 'destroy')) null, "sapType" varchar check ("sapType" in ('unknown', 'epipe', 'tls', 'vprn', 'ies', 'mirror', 'apipe', 'fpipe', 'ipipe', 'cpipe', 'intTls', 'evpnIsaTls')) null, "sapDescription" varchar null, "sapAdminStatus" varchar check ("sapAdminStatus" in ('up', 'down')) null, "sapOperStatus" varchar check ("sapOperStatus" in ('up', 'down')) null, "sapLastMgmtChange" integer null, "sapLastStatusChange" integer null);
CREATE INDEX "mpls_saps_device_id_index" on "mpls_saps" ("device_id");
CREATE INDEX "notifications_attribs_notifications_id_user_id_index" on "notifications_attribs" ("notifications_id", "user_id");
CREATE TABLE mempools (mempool_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, mempool_index VARCHAR(255) NOT NULL COLLATE BINARY, entPhysicalIndex INTEGER DEFAULT NULL, hrDeviceIndex INTEGER DEFAULT NULL, mempool_type VARCHAR(255) NOT NULL COLLATE BINARY, mempool_precision INTEGER DEFAULT 1 NOT NULL, mempool_descr VARCHAR(255) NOT NULL COLLATE BINARY, device_id INTEGER NOT NULL, mempool_perc INTEGER NOT NULL, mempool_used INTEGER NOT NULL, mempool_free INTEGER NOT NULL, mempool_total INTEGER NOT NULL, mempool_largestfree INTEGER DEFAULT NULL, mempool_lowestfree INTEGER DEFAULT NULL, mempool_deleted BOOLEAN DEFAULT '0' NOT NULL, mempool_perc_warn INTEGER DEFAULT NULL);
CREATE INDEX mempools_device_id_index ON mempools (device_id);
CREATE TABLE IF NOT EXISTS "devices_group_perms" ("user_id" integer not null, "device_group_id" integer not null, primary key ("device_group_id", "user_id"));
CREATE INDEX "devices_group_perms_user_id_index" on "devices_group_perms" ("user_id");
CREATE INDEX "devices_group_perms_device_group_id_index" on "devices_group_perms" ("device_group_id");
CREATE TABLE IF NOT EXISTS "mpls_tunnel_ar_hops" ("ar_hop_id" integer not null primary key autoincrement, "mplsTunnelARHopListIndex" integer not null, "mplsTunnelARHopIndex" integer not null, "device_id" integer not null, "lsp_path_id" integer not null, "mplsTunnelARHopAddrType" varchar check ("mplsTunnelARHopAddrType" in ('unknown', 'ipV4', 'ipV6', 'asNumber', 'lspid', 'unnum')), "mplsTunnelARHopIpv4Addr" varchar, "mplsTunnelARHopIpv6Addr" varchar, "mplsTunnelARHopAsNumber" integer, "mplsTunnelARHopStrictOrLoose" varchar check ("mplsTunnelARHopStrictOrLoose" in ('strict', 'loose')), "mplsTunnelARHopRouterId" varchar, "localProtected" varchar check ("localProtected" in ('false', 'true')) not null default 'false', "linkProtectionInUse" varchar check ("linkProtectionInUse" in ('false', 'true')) not null default 'false', "bandwidthProtected" varchar check ("bandwidthProtected" in ('false', 'true')) not null default 'false', "nextNodeProtected" varchar check ("nextNodeProtected" in ('false', 'true')) not null default 'false');
CREATE TABLE IF NOT EXISTS "mpls_tunnel_ar_hops" ("ar_hop_id" integer not null primary key autoincrement, "mplsTunnelARHopListIndex" integer not null, "mplsTunnelARHopIndex" integer not null, "device_id" integer not null, "lsp_path_id" integer not null, "mplsTunnelARHopAddrType" varchar check ("mplsTunnelARHopAddrType" in ('unknown', 'ipV4', 'ipV6', 'asNumber', 'lspid', 'unnum')) null, "mplsTunnelARHopIpv4Addr" varchar null, "mplsTunnelARHopIpv6Addr" varchar null, "mplsTunnelARHopAsNumber" integer null, "mplsTunnelARHopStrictOrLoose" varchar check ("mplsTunnelARHopStrictOrLoose" in ('strict', 'loose')) null, "mplsTunnelARHopRouterId" varchar null, "localProtected" varchar check ("localProtected" in ('false', 'true')) not null default 'false', "linkProtectionInUse" varchar check ("linkProtectionInUse" in ('false', 'true')) not null default 'false', "bandwidthProtected" varchar check ("bandwidthProtected" in ('false', 'true')) not null default 'false', "nextNodeProtected" varchar check ("nextNodeProtected" in ('false', 'true')) not null default 'false');
CREATE INDEX "mpls_tunnel_ar_hops_device_id_index" on "mpls_tunnel_ar_hops" ("device_id");
CREATE TABLE IF NOT EXISTS "mpls_tunnel_c_hops" ("c_hop_id" integer not null primary key autoincrement, "mplsTunnelCHopListIndex" integer not null, "mplsTunnelCHopIndex" integer not null, "device_id" integer not null, "lsp_path_id" integer, "mplsTunnelCHopAddrType" varchar check ("mplsTunnelCHopAddrType" in ('unknown', 'ipV4', 'ipV6', 'asNumber', 'lspid', 'unnum')), "mplsTunnelCHopIpv4Addr" varchar, "mplsTunnelCHopIpv6Addr" varchar, "mplsTunnelCHopAsNumber" integer, "mplsTunnelCHopStrictOrLoose" varchar check ("mplsTunnelCHopStrictOrLoose" in ('strict', 'loose')), "mplsTunnelCHopRouterId" varchar);
CREATE TABLE IF NOT EXISTS "mpls_tunnel_c_hops" ("c_hop_id" integer not null primary key autoincrement, "mplsTunnelCHopListIndex" integer not null, "mplsTunnelCHopIndex" integer not null, "device_id" integer not null, "lsp_path_id" integer null, "mplsTunnelCHopAddrType" varchar check ("mplsTunnelCHopAddrType" in ('unknown', 'ipV4', 'ipV6', 'asNumber', 'lspid', 'unnum')) null, "mplsTunnelCHopIpv4Addr" varchar null, "mplsTunnelCHopIpv6Addr" varchar null, "mplsTunnelCHopAsNumber" integer null, "mplsTunnelCHopStrictOrLoose" varchar check ("mplsTunnelCHopStrictOrLoose" in ('strict', 'loose')) null, "mplsTunnelCHopRouterId" varchar null);
CREATE INDEX "mpls_tunnel_c_hops_device_id_index" on "mpls_tunnel_c_hops" ("device_id");
CREATE TABLE IF NOT EXISTS "customoids" ("customoid_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "customoid_descr" varchar default '', "customoid_deleted" integer not null default '0', "customoid_current" float, "customoid_prev" float, "customoid_oid" varchar, "customoid_datatype" varchar not null default 'GAUGE', "customoid_unit" varchar, "customoid_divisor" integer not null default '1', "customoid_multiplier" integer not null default '1', "customoid_limit" float, "customoid_limit_warn" float, "customoid_limit_low" float, "customoid_limit_low_warn" float, "customoid_alert" integer not null default '0', "customoid_passed" integer not null default '0', "lastupdate" datetime default CURRENT_TIMESTAMP not null, "user_func" varchar);
CREATE TABLE IF NOT EXISTS "customoids" ("customoid_id" integer not null primary key autoincrement, "device_id" integer not null default '0', "customoid_descr" varchar null default '', "customoid_deleted" integer not null default '0', "customoid_current" float null, "customoid_prev" float null, "customoid_oid" varchar null, "customoid_datatype" varchar not null default 'GAUGE', "customoid_unit" varchar null, "customoid_divisor" integer not null default '1', "customoid_multiplier" integer not null default '1', "customoid_limit" float null, "customoid_limit_warn" float null, "customoid_limit_low" float null, "customoid_limit_low_warn" float null, "customoid_alert" integer not null default '0', "customoid_passed" integer not null default '0', "lastupdate" datetime default CURRENT_TIMESTAMP not null, "user_func" varchar null);
CREATE TABLE mpls_lsp_paths (lsp_path_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, lsp_id INTEGER NOT NULL, path_oid INTEGER NOT NULL, device_id INTEGER NOT NULL, mplsLspPathRowStatus VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathLastChange INTEGER NOT NULL, mplsLspPathType VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathBandwidth INTEGER NOT NULL, mplsLspPathOperBandwidth INTEGER NOT NULL, mplsLspPathAdminState VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathOperState VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathState VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathFailCode VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathFailNodeAddr VARCHAR(255) NOT NULL COLLATE BINARY, mplsLspPathMetric INTEGER NOT NULL, mplsLspPathOperMetric INTEGER UNSIGNED DEFAULT NULL, mplsLspPathTimeUp INTEGER DEFAULT NULL, mplsLspPathTimeDown INTEGER DEFAULT NULL, mplsLspPathTransitionCount INTEGER DEFAULT NULL, mplsLspPathTunnelARHopListIndex INTEGER DEFAULT NULL, mplsLspPathTunnelCHopListIndex INTEGER DEFAULT NULL);
CREATE INDEX mpls_lsp_paths_device_id_index ON mpls_lsp_paths (device_id);
CREATE TABLE IF NOT EXISTS "alert_location_map" ("id" integer not null primary key autoincrement, "rule_id" integer not null, "location_id" integer not null);
@ -279,25 +286,11 @@ CREATE INDEX device_outages_device_id_index ON device_outages (device_id);
CREATE UNIQUE INDEX device_outages_device_id_going_down_unique ON device_outages (device_id, going_down);
CREATE TABLE IF NOT EXISTS "cache" ("key" varchar not null, "value" text not null, "expiration" integer not null);
CREATE UNIQUE INDEX "cache_key_unique" on "cache" ("key");
CREATE TABLE IF NOT EXISTS "service_templates_device_group" ("service_template_id" integer not null, "device_group_id" integer not null, primary key ("service_template_id", "device_group_id"));
CREATE INDEX "service_templates_device_group_service_template_id_index" on "service_templates_device_group" ("service_template_id");
CREATE INDEX "service_templates_device_group_device_group_id_index" on "service_templates_device_group" ("device_group_id");
CREATE TABLE IF NOT EXISTS "service_templates_device" ("service_template_id" integer not null, "device_id" integer not null, primary key ("service_template_id", "device_id"));
CREATE INDEX "service_templates_device_service_template_id_index" on "service_templates_device" ("service_template_id");
CREATE INDEX "service_templates_device_device_id_index" on "service_templates_device" ("device_id");
CREATE TABLE IF NOT EXISTS "service_templates" ("id" integer not null primary key autoincrement, "ip" text, "type" varchar not null, "dtype" varchar not null default 'static', "dgtype" varchar not null default 'static', "drules" text, "dgrules" text, "desc" text, "param" text, "ignore" tinyint(1) not null default '0', "changed" datetime default CURRENT_TIMESTAMP not null, "disabled" tinyint(1) not null default '0', "name" varchar not null);
CREATE TABLE services (service_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, device_id INTEGER NOT NULL, service_type VARCHAR(255) NOT NULL COLLATE BINARY, service_status INTEGER DEFAULT 0 NOT NULL, service_changed INTEGER DEFAULT 0 NOT NULL, service_disabled BOOLEAN DEFAULT '0' NOT NULL, service_ip CLOB DEFAULT NULL COLLATE BINARY, service_desc CLOB DEFAULT NULL COLLATE BINARY, service_param CLOB DEFAULT NULL COLLATE BINARY, service_ignore BOOLEAN DEFAULT '0' NOT NULL, service_message CLOB DEFAULT NULL COLLATE BINARY, service_ds CLOB DEFAULT NULL COLLATE BINARY, "service_template_id" integer not null default '0', "service_name" varchar);
CREATE INDEX services_device_id_index ON services (device_id);
CREATE INDEX "alert_log_rule_id_device_id_index" on "alert_log" ("rule_id", "device_id");
CREATE INDEX "alert_log_rule_id_device_id_state_index" on "alert_log" ("rule_id", "device_id", "state");
CREATE TABLE IF NOT EXISTS "cache_locks" ("key" varchar not null, "owner" varchar not null, "expiration" integer not null, primary key ("key"));
CREATE TABLE mempools (mempool_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, mempool_index VARCHAR(255) NOT NULL COLLATE BINARY, entPhysicalIndex INTEGER DEFAULT NULL, mempool_type VARCHAR(255) NOT NULL COLLATE BINARY, mempool_precision INTEGER DEFAULT 1 NOT NULL, mempool_descr VARCHAR(255) NOT NULL COLLATE BINARY, device_id INTEGER NOT NULL, mempool_perc INTEGER NOT NULL, mempool_used INTEGER NOT NULL, mempool_free INTEGER NOT NULL, mempool_total INTEGER NOT NULL, mempool_largestfree INTEGER DEFAULT NULL, mempool_lowestfree INTEGER DEFAULT NULL, mempool_deleted BOOLEAN DEFAULT '0' NOT NULL, mempool_perc_warn INTEGER DEFAULT NULL);
CREATE INDEX mempools_device_id_index ON mempools (device_id);
CREATE TABLE ospf_areas (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, device_id INTEGER NOT NULL, ospfAreaId VARCHAR(255) NOT NULL COLLATE BINARY, ospfAuthType VARCHAR(64) DEFAULT NULL COLLATE BINARY, ospfImportAsExtern VARCHAR(255) NOT NULL COLLATE BINARY, ospfSpfRuns INTEGER NOT NULL, ospfAreaBdrRtrCount INTEGER NOT NULL, ospfAsBdrRtrCount INTEGER NOT NULL, ospfAreaLsaCount INTEGER NOT NULL, ospfAreaLsaCksumSum INTEGER NOT NULL, ospfAreaSummary VARCHAR(255) NOT NULL COLLATE BINARY, ospfAreaStatus VARCHAR(255) NOT NULL COLLATE BINARY, context_name VARCHAR(255) DEFAULT NULL COLLATE BINARY);
CREATE UNIQUE INDEX ospf_areas_device_id_ospfareaid_context_name_unique ON ospf_areas (device_id, ospfAreaId, context_name);
CREATE TABLE vminfo (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, device_id INTEGER NOT NULL, vm_type VARCHAR(255) DEFAULT 'vmware' NOT NULL COLLATE BINARY, vmwVmVMID INTEGER NOT NULL, vmwVmDisplayName VARCHAR(255) NOT NULL COLLATE BINARY, vmwVmGuestOS VARCHAR(255) NOT NULL COLLATE BINARY, vmwVmMemSize INTEGER NOT NULL, vmwVmCpus INTEGER NOT NULL, vmwVmState SMALLINT UNSIGNED NOT NULL);
CREATE INDEX vminfo_vmwvmvmid_index ON vminfo (vmwVmVMID);
CREATE INDEX vminfo_device_id_index ON vminfo (device_id);
INSERT INTO migrations VALUES(1,'2018_07_03_091314_create_access_points_table',1);
INSERT INTO migrations VALUES(2,'2018_07_03_091314_create_alert_device_map_table',1);
INSERT INTO migrations VALUES(3,'2018_07_03_091314_create_alert_group_map_table',1);
@ -473,25 +466,16 @@ INSERT INTO migrations VALUES(172,'2020_07_27_00522_alter_devices_snmp_algo_colu
INSERT INTO migrations VALUES(173,'2020_07_29_143221_add_device_perf_index',1);
INSERT INTO migrations VALUES(174,'2020_08_28_212054_drop_uptime_column_outages',1);
INSERT INTO migrations VALUES(175,'2020_09_18_223431_create_cache_table',1);
INSERT INTO migrations VALUES(176,'2020_09_18_230114_create_service_templates_device_group_table',1);
INSERT INTO migrations VALUES(177,'2020_09_18_230114_create_service_templates_device_table',1);
INSERT INTO migrations VALUES(178,'2020_09_18_230114_create_service_templates_table',1);
INSERT INTO migrations VALUES(179,'2020_09_18_230114_extend_services_table_for_service_templates_table',1);
INSERT INTO migrations VALUES(180,'2020_09_19_230114_add_foreign_keys_to_service_templates_device_group_table',1);
INSERT INTO migrations VALUES(181,'2020_09_19_230114_add_foreign_keys_to_service_templates_device_table',1);
INSERT INTO migrations VALUES(182,'2020_09_22_172321_add_alert_log_index',1);
INSERT INTO migrations VALUES(183,'2020_09_24_000500_create_cache_locks_table',1);
INSERT INTO migrations VALUES(184,'2020_10_03_1000_add_primary_key_bill_perms',1);
INSERT INTO migrations VALUES(185,'2020_10_03_1000_add_primary_key_bill_ports',1);
INSERT INTO migrations VALUES(186,'2020_10_03_1000_add_primary_key_devices_perms',1);
INSERT INTO migrations VALUES(187,'2020_10_03_1000_add_primary_key_entPhysical_state',1);
INSERT INTO migrations VALUES(188,'2020_10_03_1000_add_primary_key_ipv4_mac',1);
INSERT INTO migrations VALUES(189,'2020_10_03_1000_add_primary_key_juniAtmVp',1);
INSERT INTO migrations VALUES(190,'2020_10_03_1000_add_primary_key_loadbalancer_vservers',1);
INSERT INTO migrations VALUES(191,'2020_10_03_1000_add_primary_key_ports_perms',1);
INSERT INTO migrations VALUES(192,'2020_10_03_1000_add_primary_key_processes',1);
INSERT INTO migrations VALUES(193,'2020_10_03_1000_add_primary_key_transport_group_transport',1);
INSERT INTO migrations VALUES(194,'2020_10_12_095504_mempools_add_oids',1);
INSERT INTO migrations VALUES(195,'2020_10_21_124101_allow_nullable_ospf_columns',1);
INSERT INTO migrations VALUES(196,'2020_10_30_093601_add_tos_to_ospf_ports',1);
INSERT INTO migrations VALUES(197,'2020_11_02_164331_add_powerstate_enum_to_vminfo',1);
INSERT INTO migrations VALUES(176,'2020_09_22_172321_add_alert_log_index',1);
INSERT INTO migrations VALUES(177,'2020_09_24_000500_create_cache_locks_table',1);
INSERT INTO migrations VALUES(178,'2020_10_03_1000_add_primary_key_bill_perms',1);
INSERT INTO migrations VALUES(179,'2020_10_03_1000_add_primary_key_bill_ports',1);
INSERT INTO migrations VALUES(180,'2020_10_03_1000_add_primary_key_devices_perms',1);
INSERT INTO migrations VALUES(181,'2020_10_03_1000_add_primary_key_entPhysical_state',1);
INSERT INTO migrations VALUES(182,'2020_10_03_1000_add_primary_key_ipv4_mac',1);
INSERT INTO migrations VALUES(183,'2020_10_03_1000_add_primary_key_juniAtmVp',1);
INSERT INTO migrations VALUES(184,'2020_10_03_1000_add_primary_key_loadbalancer_vservers',1);
INSERT INTO migrations VALUES(185,'2020_10_03_1000_add_primary_key_ports_perms',1);
INSERT INTO migrations VALUES(186,'2020_10_03_1000_add_primary_key_processes',1);
INSERT INTO migrations VALUES(187,'2020_10_03_1000_add_primary_key_transport_group_transport',1);
INSERT INTO migrations VALUES(188,'2020_10_21_124101_allow_nullable_ospf_columns',1);

View File

@ -160,7 +160,7 @@ mysql -u root
> NOTE: Change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -52,7 +52,7 @@ Enter the MySQL/MariaDB root password to enter the command-line interface.
Create database.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -100,7 +100,7 @@ mysql -u root
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -70,7 +70,7 @@ mysql -u root
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -57,7 +57,7 @@ mysql -uroot -p
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -40,7 +40,7 @@ mysql -uroot -p
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -40,7 +40,7 @@ mysql -uroot -p
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -60,7 +60,7 @@ mysql -uroot -p
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -61,7 +61,7 @@ mysql -uroot -p
> NOTE: Please change the 'password' below to something secure.
```sql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

View File

@ -62,8 +62,8 @@ function dbConnect($db_host = null, $db_user = '', $db_pass = '', $db_name = '',
'username' => $db_user,
'password' => $db_pass,
'unix_socket' => $db_socket,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,

View File

@ -1748,7 +1748,7 @@ services:
- { Field: service_type, Type: varchar(255), 'Null': false, Extra: '' }
- { Field: service_desc, Type: text, 'Null': true, Extra: '' }
- { Field: service_param, Type: text, 'Null': true, Extra: '' }
- { Field: service_ignore, Type: tinyint, 'Null': false, Extra: '', Default: '0' }
- { Field: service_ignore, Type: tinyint, 'Null': false, Extra: '', Default: '0' }
- { Field: service_status, Type: tinyint, 'Null': false, Extra: '', Default: '0' }
- { Field: service_changed, Type: 'int unsigned', 'Null': false, Extra: '', Default: '0' }
- { Field: service_message, Type: text, 'Null': true, Extra: '' }
@ -1771,7 +1771,7 @@ service_templates:
- { Field: desc, Type: text, 'Null': true, Extra: '' }
- { Field: param, Type: text, 'Null': true, Extra: '' }
- { Field: ignore, Type: tinyint, 'Null': false, Extra: '', Default: '0' }
- { Field: changed, Type: timestamp, 'Null': false, Extra: 'on update CURRENT_TIMESTAMP', Default: CURRENT_TIMESTAMP }
- { Field: changed, Type: 'timestamp', 'Null': false, , Extra: 'on update CURRENT_TIMESTAMP', Default: CURRENT_TIMESTAMP }
- { Field: disabled, Type: tinyint, 'Null': false, Extra: '', Default: '0' }
- { Field: name, Type: varchar(255), 'Null': false, Extra: '' }
Indexes:
@ -1782,22 +1782,22 @@ service_templates_device:
- { Field: device_id, Type: 'int unsigned', 'Null': false, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [service_template_id, device_id], Unique: true, Type: BTREE }
service_templates_device_device_id_index: { Name: service_templates_device_device_id_index, Columns: [device_id], Unique: false, Type: BTREE }
service_templates_device_service_template_id_index: { Name: service_templates_device_service_template_id_index, Columns: [service_template_id], Unique: false, Type: BTREE }
service_templates_device_device_id_index: { Name: service_templates_device_device_id_index, Columns: [device_id], Unique: false, Type: BTREE }
Constraints:
service_templates_device_device_id_foreign: { name: service_templates_device_device_id_foreign, foreign_key: device_id, table: devices, key: device_id, extra: 'ON DELETE CASCADE' }
service_templates_device_service_template_id_foreign: { name: service_templates_device_service_template_id_foreign, foreign_key: service_template_id, table: service_templates, key: id, extra: 'ON DELETE CASCADE' }
service_templates_device_device_id_foreign: { name: service_templates_device_device_id_foreign, foreign_key: device_id, table: devices, key: device_id, extra: 'ON DELETE CASCADE' }
service_templates_device_group:
Columns:
- { Field: service_template_id, Type: 'int unsigned', 'Null': false, Extra: '' }
- { Field: device_group_id, Type: 'int unsigned', 'Null': false, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [service_template_id, device_group_id], Unique: true, Type: BTREE }
service_templates_device_group_device_group_id_index: { Name: service_templates_device_group_device_group_id_index, Columns: [device_group_id], Unique: false, Type: BTREE }
service_templates_device_group_service_template_id_index: { Name: service_templates_device_group_service_template_id_index, Columns: [service_template_id], Unique: false, Type: BTREE }
service_templates_device_group_device_group_id_index: { Name: service_templates_device_group_device_group_id_index, Columns: [device_group_id], Unique: false, Type: BTREE }
Constraints:
service_templates_device_group_device_group_id_foreign: { name: service_templates_device_group_device_group_id_foreign, foreign_key: device_group_id, table: device_groups, key: id, extra: 'ON DELETE CASCADE' }
service_templates_device_group_service_template_id_foreign: { name: service_templates_device_group_service_template_id_foreign, foreign_key: service_template_id, table: service_templates, key: id, extra: 'ON DELETE CASCADE' }
service_templates_device_group_device_group_id_foreign: { name: service_templates_device_group_device_group_id_foreign, foreign_key: device_group_id, table: device_groups, key: id, extra: 'ON DELETE CASCADE' }
session:
Columns:
- { Field: session_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment }

View File

@ -75,9 +75,9 @@ class DBSetupTest extends DBTestCase
public function testCheckDBCollation()
{
$collation = DB::connection($this->connection)->select(DB::raw("SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA S WHERE schema_name = '$this->db_name' AND ( DEFAULT_CHARACTER_SET_NAME != 'utf8mb4' OR DEFAULT_COLLATION_NAME != 'utf8mb4_unicode_ci')"));
$collation = DB::connection($this->connection)->select(DB::raw("SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA S WHERE schema_name = '$this->db_name' AND ( DEFAULT_CHARACTER_SET_NAME != 'utf8' OR DEFAULT_COLLATION_NAME != 'utf8_unicode_ci')"));
if (isset($collation[0])) {
$error = implode(' ', (array) $collation[0]);
$error = implode(' ', $collation[0]);
} else {
$error = '';
}
@ -86,20 +86,20 @@ class DBSetupTest extends DBTestCase
public function testCheckTableCollation()
{
$collation = DB::connection($this->connection)->select(DB::raw("SELECT T.TABLE_NAME, C.CHARACTER_SET_NAME, C.COLLATION_NAME FROM information_schema.TABLES AS T, information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS C WHERE C.collation_name = T.table_collation AND T.table_schema = '$this->db_name' AND ( C.CHARACTER_SET_NAME != 'utf8mb4' OR C.COLLATION_NAME != 'utf8mb4_unicode_ci' );"));
$collation = DB::connection($this->connection)->select(DB::raw("SELECT T.TABLE_NAME, C.CHARACTER_SET_NAME, C.COLLATION_NAME FROM information_schema.TABLES AS T, information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS C WHERE C.collation_name = T.table_collation AND T.table_schema = '$this->db_name' AND ( C.CHARACTER_SET_NAME != 'utf8' OR C.COLLATION_NAME != 'utf8_unicode_ci' );"));
$error = '';
foreach ($collation as $data) {
$error .= implode(' ', (array) $data) . PHP_EOL;
foreach ($collation as $id => $data) {
$error .= implode(' ', $data) . PHP_EOL;
}
$this->assertEmpty($collation, 'Wrong Table Collation or Character set: ' . $error);
}
public function testCheckColumnCollation()
{
$collation = DB::connection($this->connection)->select(DB::raw("SELECT TABLE_NAME, COLUMN_NAME, CHARACTER_SET_NAME, COLLATION_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '$this->db_name' AND ( CHARACTER_SET_NAME != 'utf8mb4' OR COLLATION_NAME != 'utf8mb4_unicode_ci' );"));
$collation = DB::connection($this->connection)->select(DB::raw("SELECT TABLE_NAME, COLUMN_NAME, CHARACTER_SET_NAME, COLLATION_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '$this->db_name' AND ( CHARACTER_SET_NAME != 'utf8' OR COLLATION_NAME != 'utf8_unicode_ci' );"));
$error = '';
foreach ($collation as $data) {
$error .= implode(' ', (array) $data) . PHP_EOL;
foreach ($collation as $id => $data) {
$error .= implode(' ', $data) . PHP_EOL;
}
$this->assertEmpty($collation, 'Wrong Column Collation or Character set: ' . $error);
}

View File

@ -55,7 +55,7 @@ if (getenv('DBTEST')) {
// create testing table if needed
$db_config = \config('database.connections.testing');
$connection = new PDO("mysql:host={$db_config['host']};port={$db_config['port']}", $db_config['username'], $db_config['password']);
$result = $connection->query("CREATE DATABASE IF NOT EXISTS {$db_config['database']} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
$result = $connection->query("CREATE DATABASE IF NOT EXISTS {$db_config['database']} CHARACTER SET utf8 COLLATE utf8_unicode_ci");
if ($connection->errorCode() == '42000') {
echo implode(' ', $connection->errorInfo()) . PHP_EOL;
echo "Either create database {$db_config['database']} or populate DB_TEST_USERNAME and DB_TEST_PASSWORD in your .env with credentials that can" . PHP_EOL;