83 - Add a decision timestamp to route articles
This commit is contained in:
parent
4b895263e2
commit
8375c948c6
2 changed files with 28 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
||||||
* @property int $publish_attempts
|
* @property int $publish_attempts
|
||||||
* @property Carbon|null $next_attempt_at
|
* @property Carbon|null $next_attempt_at
|
||||||
* @property Carbon|null $validated_at
|
* @property Carbon|null $validated_at
|
||||||
|
* @property Carbon|null $decided_at
|
||||||
* @property Carbon $created_at
|
* @property Carbon $created_at
|
||||||
* @property Carbon $updated_at
|
* @property Carbon $updated_at
|
||||||
*/
|
*/
|
||||||
|
|
@ -41,6 +42,7 @@ class RouteArticle extends Model
|
||||||
'publish_attempts',
|
'publish_attempts',
|
||||||
'next_attempt_at',
|
'next_attempt_at',
|
||||||
'validated_at',
|
'validated_at',
|
||||||
|
'decided_at',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
|
@ -49,6 +51,7 @@ class RouteArticle extends Model
|
||||||
'publish_attempts' => 'integer',
|
'publish_attempts' => 'integer',
|
||||||
'next_attempt_at' => 'datetime',
|
'next_attempt_at' => 'datetime',
|
||||||
'validated_at' => 'datetime',
|
'validated_at' => 'datetime',
|
||||||
|
'decided_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('route_articles', function (Blueprint $table) {
|
||||||
|
$table->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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue