Размер файла: 639B
<?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('articles', function (Blueprint $table) {
$table->timestamp('published_at')->nullable()->after('count_comments');
$table->boolean('active')->default(true)->after('count_comments');
});
}
public function down(): void
{
Schema::table('articles', function (Blueprint $table) {
$table->dropColumn(['active', 'published_at']);
});
}
};