From 8375c948c69ae6b6856cd5589b10567267877c2c Mon Sep 17 00:00:00 2001 From: myrmidex Date: Thu, 13 Aug 2026 00:15:36 +0200 Subject: [PATCH] 83 - Add a decision timestamp to route articles --- app/Models/RouteArticle.php | 3 +++ ...00021_add_decided_at_to_route_articles.php | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 database/migrations/2024_01_01_000021_add_decided_at_to_route_articles.php diff --git a/app/Models/RouteArticle.php b/app/Models/RouteArticle.php index be1e5da8..885cd3ad 100644 --- a/app/Models/RouteArticle.php +++ b/app/Models/RouteArticle.php @@ -24,6 +24,7 @@ * @property int $publish_attempts * @property Carbon|null $next_attempt_at * @property Carbon|null $validated_at + * @property Carbon|null $decided_at * @property Carbon $created_at * @property Carbon $updated_at */ @@ -41,6 +42,7 @@ class RouteArticle extends Model 'publish_attempts', 'next_attempt_at', 'validated_at', + 'decided_at', ]; protected $casts = [ @@ -49,6 +51,7 @@ class RouteArticle extends Model 'publish_attempts' => 'integer', 'next_attempt_at' => 'datetime', 'validated_at' => 'datetime', + 'decided_at' => 'datetime', ]; /** diff --git a/database/migrations/2024_01_01_000021_add_decided_at_to_route_articles.php b/database/migrations/2024_01_01_000021_add_decided_at_to_route_articles.php new file mode 100644 index 00000000..19a6bbac --- /dev/null +++ b/database/migrations/2024_01_01_000021_add_decided_at_to_route_articles.php @@ -0,0 +1,25 @@ +timestamp('decided_at')->nullable()->after('validated_at'); + + $table->index('decided_at'); + }); + } + + public function down(): void + { + Schema::table('route_articles', function (Blueprint $table) { + $table->dropIndex(['decided_at']); + $table->dropColumn('decided_at'); + }); + } +};