Skip to content

Commit

Permalink
[Ref. #62] Add missing 'category' column to table 'ynh_osquery_rules'…
Browse files Browse the repository at this point in the history
… and update database seeder accordingly.
  • Loading branch information
csavelief committed Aug 26, 2024
1 parent b921378 commit baaba6d
Show file tree
Hide file tree
Showing 6 changed files with 1,467 additions and 386 deletions.
1 change: 1 addition & 0 deletions app/Enums/OsqueryPlatformEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ enum OsqueryPlatformEnum: string
case WINDOWS = 'windows';
case UBUNTU = 'ubuntu';
case CENTOS = 'centos';
case GENTOO = 'gentoo';
case ALL = 'all';
}
1 change: 1 addition & 0 deletions app/Models/YnhOsqueryRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class YnhOsqueryRule extends Model
'removed',
'snapshot',
'platform',
'category',
];

protected $casts = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function up()
\App\Enums\OsqueryPlatformEnum::WINDOWS->value,
\App\Enums\OsqueryPlatformEnum::UBUNTU->value,
\App\Enums\OsqueryPlatformEnum::CENTOS->value,
\App\Enums\OsqueryPlatformEnum::GENTOO->value,
\App\Enums\OsqueryPlatformEnum::ALL->value,
])->default(\App\Enums\OsqueryPlatformEnum::ALL->value);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ynh_osquery_rules', function (Blueprint $table) {
$table->string('category')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ynh_osquery_rules', function (Blueprint $table) {
$table->dropColumn('category');
});
}
};
Loading

0 comments on commit baaba6d

Please sign in to comment.