WebUI - Alert Rule Editor: new notes field (#15631)

* add a new notes field to the rule editor. use a bigger text field for sql queries to avoid mistakes...
* add api doc
* allow notes field from the collection
* add a sample notes to the collection
* lint and db schema
* unmix some schema changes from a nother PR
* unmix schema update No°2
* unmix schema update No°3 - silly me
* add strip_tags, minor optimisation, db default value
* apply linting
* db_schema empty '' as default
* update db_schema.yaml
* default value changed as 'BLOB, TEXT, GEOMETRY or JSON column 'notes' can't have a default value'
* better keep the migration in 2023...
* Update 2023_12_12_171400_alert_rule_note.php
* Update create-alert-item.inc.php

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
Stef
2024-01-17 09:09:19 +01:00
committed by GitHub
parent e9725358e3
commit 5733942aa2
10 changed files with 61 additions and 31 deletions

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('alert_rules', function (Blueprint $table) {
$table->text('notes')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('alert_rules', function (Blueprint $table) {
$table->dropColumn('notes');
});
}
};