feat: anggota dapat menulis artikel dengan workflow approval sebelum diterbitkan
This commit is contained in:
@@ -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('posts', function (Blueprint $table) {
|
||||
$table->enum('status', ['draft', 'pending', 'published', 'rejected'])
|
||||
->default('draft')->after('author_id');
|
||||
$table->foreignId('reviewed_by')->nullable()->constrained('users')->after('status');
|
||||
$table->text('rejection_reason')->nullable()->after('reviewed_by');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('posts', function (Blueprint $table) {
|
||||
$table->dropColumn(['status', 'reviewed_by', 'rejection_reason']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user