From 2a5a8c788b781efa7553683d8eadd875084752e3 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Wed, 18 Mar 2026 15:28:01 +0100 Subject: [PATCH] 85 - Add auto_approve column to routes table --- app/Models/Route.php | 3 +++ ...00008_add_auto_approve_to_routes_table.php | 22 +++++++++++++++++++ tests/Unit/Models/RouteTest.php | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2024_01_01_000008_add_auto_approve_to_routes_table.php diff --git a/app/Models/Route.php b/app/Models/Route.php index c78016c..5c566e1 100644 --- a/app/Models/Route.php +++ b/app/Models/Route.php @@ -14,6 +14,7 @@ * @property int $platform_channel_id * @property bool $is_active * @property int $priority + * @property bool|null $auto_approve * @property Carbon $created_at * @property Carbon $updated_at */ @@ -34,10 +35,12 @@ class Route extends Model 'platform_channel_id', 'is_active', 'priority', + 'auto_approve', ]; protected $casts = [ 'is_active' => 'boolean', + 'auto_approve' => 'boolean', ]; /** diff --git a/database/migrations/2024_01_01_000008_add_auto_approve_to_routes_table.php b/database/migrations/2024_01_01_000008_add_auto_approve_to_routes_table.php new file mode 100644 index 0000000..1cb1b9a --- /dev/null +++ b/database/migrations/2024_01_01_000008_add_auto_approve_to_routes_table.php @@ -0,0 +1,22 @@ +boolean('auto_approve')->nullable()->after('priority'); + }); + } + + public function down(): void + { + Schema::table('routes', function (Blueprint $table) { + $table->dropColumn('auto_approve'); + }); + } +}; diff --git a/tests/Unit/Models/RouteTest.php b/tests/Unit/Models/RouteTest.php index 1903e43..e559410 100644 --- a/tests/Unit/Models/RouteTest.php +++ b/tests/Unit/Models/RouteTest.php @@ -15,7 +15,7 @@ class RouteTest extends TestCase public function test_fillable_fields(): void { - $fillableFields = ['feed_id', 'platform_channel_id', 'is_active', 'priority']; + $fillableFields = ['feed_id', 'platform_channel_id', 'is_active', 'priority', 'auto_approve']; $route = new Route; $this->assertEquals($fillableFields, $route->getFillable());