From cdb0ff8ea8e26f25068ae9e4f99d0768f647f927 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Fri, 20 Oct 2023 08:43:16 -0500 Subject: [PATCH] Cisco ASA table add alert defaults (#15488) Fixes issue when values weren't set Can't set an upper limit since models are different Also, no way to set this in the webui and the default alert rule doesn't use the values, so yeah, probably could have deleted the fields. --- ...20_075853_cisco_asa_add_default_limits.php | 30 +++++++++++++++++++ misc/db_schema.yaml | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2023_10_20_075853_cisco_asa_add_default_limits.php diff --git a/database/migrations/2023_10_20_075853_cisco_asa_add_default_limits.php b/database/migrations/2023_10_20_075853_cisco_asa_add_default_limits.php new file mode 100644 index 0000000000..2739b6c112 --- /dev/null +++ b/database/migrations/2023_10_20_075853_cisco_asa_add_default_limits.php @@ -0,0 +1,30 @@ +bigInteger('high_alert')->default(-1)->change(); + $table->bigInteger('low_alert')->default(0)->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ciscoASA', function (Blueprint $table) { + $table->bigInteger('high_alert')->change(); + $table->bigInteger('low_alert')->change(); + }); + } +}; diff --git a/misc/db_schema.yaml b/misc/db_schema.yaml index 78d9214087..8181efde9d 100644 --- a/misc/db_schema.yaml +++ b/misc/db_schema.yaml @@ -428,8 +428,8 @@ ciscoASA: - { Field: device_id, Type: 'int unsigned', 'Null': false, Extra: '' } - { Field: oid, Type: varchar(255), 'Null': false, Extra: '' } - { Field: data, Type: bigint, 'Null': false, Extra: '' } - - { Field: high_alert, Type: bigint, 'Null': false, Extra: '' } - - { Field: low_alert, Type: bigint, 'Null': false, Extra: '' } + - { Field: high_alert, Type: bigint, 'Null': false, Extra: '', Default: '-1' } + - { Field: low_alert, Type: bigint, 'Null': false, Extra: '', Default: '0' } - { Field: disabled, Type: tinyint, 'Null': false, Extra: '', Default: '0' } Indexes: PRIMARY: { Name: PRIMARY, Columns: [ciscoASA_id], Unique: true, Type: BTREE }